entities.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By } from 'selenium-webdriver'
  4. import {
  5. getRootAndWait,
  6. takeScreenshotOnFailure,
  7. } from '../../lib/elements.js'
  8. describe('config: entities', function () {
  9. before(async function () {
  10. await runner.start('entities')
  11. await getRootAndWait()
  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. // The old test was looking for #root-group, but that doesn't exist in the new Vue UI
  22. // Instead, we should look for action buttons directly
  23. const actionButtons = await webdriver.findElements(By.css('.action-button button'))
  24. expect(actionButtons).to.not.be.null
  25. expect(actionButtons).to.have.length(3)
  26. expect(await actionButtons[0].getAttribute('title')).to.be.equal('Ping server1')
  27. expect(await actionButtons[1].getAttribute('title')).to.be.equal('Ping server2')
  28. expect(await actionButtons[2].getAttribute('title')).to.be.equal('Ping server3')
  29. // Check that there's no error dialog visible
  30. const dialogErr = await webdriver.findElements(By.id('big-error'))
  31. if (dialogErr.length > 0) {
  32. expect(await dialogErr[0].isDisplayed()).to.be.false
  33. }
  34. })
  35. })