multipleDropdowns.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By, until } from 'selenium-webdriver'
  4. import { getActionButtons, getRootAndWait } 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 getRootAndWait()
  14. const buttons = await getActionButtons(webdriver)
  15. let button = null
  16. for (const b of buttons) {
  17. const title = await b.getAttribute('title')
  18. if (title === 'Test multiple dropdowns') {
  19. button = b
  20. }
  21. }
  22. expect(buttons).to.have.length(2)
  23. expect(button).to.not.be.null
  24. await button.click()
  25. const dialog = await webdriver.findElement(By.id('argument-popup'))
  26. await webdriver.wait(until.elementIsVisible(dialog), 3500)
  27. const selects = await dialog.findElements(By.tagName('select'))
  28. expect(selects).to.have.length(2)
  29. expect(await selects[0].findElements(By.tagName('option'))).to.have.length(2)
  30. expect(await selects[1].findElements(By.tagName('option'))).to.have.length(3)
  31. })
  32. })