drop.chapril.org-firefoxsend/test/integration/homepage-tests.js
2018-11-01 10:44:47 -07:00

40 lines
1007 B
JavaScript

/* global browser */
const assert = require('assert');
const HomePage = require('./pages/desktop/home_page');
describe('Firefox Send homepage', function() {
const homePage = new HomePage();
const baseUrl = browser.options['baseUrl'];
const footerLinks = [
'legal',
'about',
'legal',
'cookies',
'report-infringement',
'github',
'twitter'
];
beforeEach(function() {
homePage.open();
});
it('should have the right title', function() {
assert.equal(browser.getTitle(), 'Firefox Send');
});
footerLinks.forEach((link, i) => {
it(`should navigate to the correct page: ${link}`, function() {
// Click links on bottom of page
const els = browser.elements(homePage.footerLinks);
browser.elementIdClick(els.value[i].ELEMENT);
// Wait for page to load
browser.waitUntil(() => {
const url = browser.getUrl();
return url !== baseUrl;
});
assert.ok(browser.getUrl().includes(link));
});
});
});