sleep.mjs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By } from 'selenium-webdriver'
  4. import {
  5. takeScreenshotOnFailure,
  6. findExecutionDialog,
  7. requireExecutionDialogStatus,
  8. getRootAndWait,
  9. getActionButton
  10. } from '../../lib/elements.js'
  11. describe('config: sleep', function () {
  12. before(async function () {
  13. await runner.start('sleep')
  14. })
  15. after(async () => {
  16. await runner.stop()
  17. })
  18. afterEach(function () {
  19. takeScreenshotOnFailure(this.currentTest, webdriver);
  20. });
  21. it('Sleep action kill', async function() {
  22. await getRootAndWait()
  23. const btnSleep = await getActionButton(webdriver, "Sleep")
  24. await btnSleep.click()
  25. await webdriver.sleep(1000)
  26. const dialog = await findExecutionDialog(webdriver)
  27. expect(await dialog.isDisplayed()).to.be.true
  28. await requireExecutionDialogStatus(webdriver, "Still running...")
  29. const killButton = await webdriver.findElement(By.id('execution-dialog-kill-action'))
  30. expect(killButton).to.not.be.undefined
  31. await killButton.click()
  32. await requireExecutionDialogStatus(webdriver, "Completed (Exit code: -1)")
  33. })
  34. })