multipleDropdowns.js 1.2 KB

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