| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { describe, it, before, after } from 'mocha'
- import { expect } from 'chai'
- import { By } from 'selenium-webdriver'
- import {
- takeScreenshotOnFailure,
- findExecutionDialog,
- requireExecutionDialogStatus,
- getRootAndWait,
- getActionButton
- } from '../../lib/elements.js'
- describe('config: sleep', function () {
- before(async function () {
- await runner.start('sleep')
- })
- after(async () => {
- await runner.stop()
- })
- afterEach(function () {
- takeScreenshotOnFailure(this.currentTest, webdriver);
- });
- it('Sleep action kill', async function() {
- await getRootAndWait()
- const btnSleep = await getActionButton(webdriver, "Sleep")
- await btnSleep.click()
- await webdriver.sleep(1000)
- const dialog = await findExecutionDialog(webdriver)
- expect(await dialog.isDisplayed()).to.be.true
- await requireExecutionDialogStatus(webdriver, "Still running...")
- const killButton = await webdriver.findElement(By.id('execution-dialog-kill-action'))
- expect(killButton).to.not.be.undefined
- await killButton.click()
- await requireExecutionDialogStatus(webdriver, "Completed (Exit code: -1)")
- })
- })
|