entities.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By, until } from 'selenium-webdriver'
  4. import {
  5. getRootAndWait,
  6. takeScreenshot,
  7. takeScreenshotOnFailure,
  8. } from '../lib/elements.js'
  9. describe('config: entities', function () {
  10. before(async function () {
  11. await runner.start('entities')
  12. })
  13. after(async () => {
  14. await runner.stop()
  15. })
  16. afterEach(function () {
  17. takeScreenshotOnFailure(this.currentTest, webdriver);
  18. });
  19. it('Entity buttons are rendered', async function() {
  20. await getRootAndWait()
  21. const buttons = await webdriver.findElement(By.id('root-group')).findElements(By.tagName('button'))
  22. expect(buttons).to.not.be.null
  23. expect(buttons).to.have.length(3)
  24. expect(await buttons[0].getAttribute('title')).to.be.equal('Ping server1')
  25. expect(await buttons[1].getAttribute('title')).to.be.equal('Ping server2')
  26. expect(await buttons[2].getAttribute('title')).to.be.equal('Ping server3')
  27. const dialogErr = await webdriver.findElement(By.id('big-error'))
  28. expect(dialogErr).to.not.be.null
  29. expect(await dialogErr.isDisplayed()).to.be.false
  30. })
  31. })