multipleDropdowns.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By, until } from 'selenium-webdriver'
  4. import { getActionButtons } from '../lib/elements.js'
  5. describe('config: multipleDropdowns', function () {
  6. before(async function () {
  7. await runner.start('multipleDropdowns')
  8. })
  9. after(async () => {
  10. await runner.stop()
  11. })
  12. it('Multiple dropdowns are possible', async function() {
  13. await webdriver.get(runner.baseUrl())
  14. await webdriver.manage().setTimeouts({ implicit: 2000 })
  15. const buttons = await getActionButtons(webdriver)
  16. let button = null
  17. for (const b of buttons) {
  18. const title = await b.getAttribute('title')
  19. console.log('title: ' + title)
  20. if (title === 'Test multiple dropdowns') {
  21. button = b
  22. }
  23. }
  24. expect(buttons).to.have.length(2)
  25. expect(button).to.not.be.null
  26. await button.click()
  27. const dialog = await webdriver.findElement(By.id('argument-popup'))
  28. await webdriver.wait(until.elementIsVisible(dialog), 3500)
  29. const selects = await dialog.findElements(By.tagName('select'))
  30. expect(selects).to.have.length(2)
  31. expect(await selects[0].findElements(By.tagName('option'))).to.have.length(2)
  32. expect(await selects[1].findElements(By.tagName('option'))).to.have.length(3)
  33. })
  34. })