emptyDashboardsAreHidden.mjs 1.0 KB

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