emptyDashboardsAreHidden.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. takeScreenshotOnFailure,
  10. } from '../lib/elements.js'
  11. describe('config: empty dashboards are hidden', function () {
  12. before(async function () {
  13. await runner.start('emptyDashboardsAreHidden')
  14. })
  15. after(async () => {
  16. await runner.stop()
  17. })
  18. afterEach(function () {
  19. takeScreenshotOnFailure(this.currentTest, webdriver);
  20. });
  21. it('Test hidden dashboard', async function () {
  22. await getRootAndWait()
  23. const title = await webdriver.getTitle()
  24. expect(title).to.be.equal("OliveTin")
  25. await openSidebar()
  26. const navigationLinks = await getNavigationLinks()
  27. expect(navigationLinks).to.not.be.empty
  28. expect(navigationLinks.length).to.be.equal(1, 'Expected the nav to only have 1 link')
  29. const firstLinkId = await navigationLinks[0].getAttribute('id')
  30. expect(firstLinkId).to.be.equal('showActions', 'Expected the first link to be the actions link')
  31. })
  32. })