emptyDashboardsAreHidden.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { describe, it, before, after } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By, until, Condition } from 'selenium-webdriver'
  4. //import * as waitOn from 'wait-on'
  5. import {
  6. getRootAndWait,
  7. openSidebar,
  8. getNavigationLinks,
  9. waitForNavigationLinks,
  10. takeScreenshotOnFailure,
  11. } from '../../lib/elements.js'
  12. describe('config: empty dashboards are hidden', function () {
  13. this.timeout(30000)
  14. before(async function () {
  15. await runner.start('emptyDashboardsAreHidden')
  16. })
  17. after(async () => {
  18. await runner.stop()
  19. })
  20. afterEach(function () {
  21. takeScreenshotOnFailure(this.currentTest, webdriver);
  22. });
  23. it('Test hidden dashboard', async function () {
  24. await getRootAndWait()
  25. await openSidebar()
  26. await waitForNavigationLinks(3)
  27. const title = await webdriver.getTitle()
  28. expect(title).to.be.equal("Actions - OliveTin")
  29. const navigationLinks = await getNavigationLinks()
  30. expect(navigationLinks).to.not.be.empty
  31. expect(navigationLinks.length).to.be.equal(3, 'Expected the nav to only have 3 links') // entities + logs + diagnostics
  32. })
  33. })