homepage-tests.js 1018 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* global browser */
  2. const assert = require('assert');
  3. const HomePage = require('./pages/desktop/home_page');
  4. describe('Firefox Send homepage', function() {
  5. this.retries(2);
  6. const homePage = new HomePage();
  7. const baseUrl = browser.options['baseUrl'];
  8. const footerLinks = ['mozilla', 'legal', 'legal', 'cookies', 'github'];
  9. beforeEach(function() {
  10. homePage.open();
  11. if (process.env.ANDROID) {
  12. this.skip();
  13. }
  14. });
  15. it('should have the right title', function() {
  16. assert.equal(browser.getTitle(), 'Firefox Send');
  17. });
  18. footerLinks.forEach((link, i) => {
  19. it(`should navigate to the correct page: ${link}`, function() {
  20. // Click links on bottom of page
  21. const els = browser.elements(homePage.footerLinks);
  22. browser.elementIdClick(els.value[i].ELEMENT);
  23. // Wait for page to load
  24. browser.waitUntil(() => {
  25. const url = browser.getUrl();
  26. return url !== baseUrl;
  27. });
  28. assert.ok(browser.getUrl().includes(link));
  29. });
  30. });
  31. });