updated integration tests for new ui

This commit is contained in:
Danny Coates 2018-10-31 11:31:17 -07:00
parent 891ffc20af
commit 6ba3be8a0f
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
11 changed files with 65 additions and 153 deletions

View file

@ -3,45 +3,30 @@ 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 legalLinks = [
const footerLinks = [
'legal',
'about',
'legal',
'cookies',
'report-infringement'
'report-infringement',
'github',
'twitter'
];
const socialLinks = ['github', 'twitter', 'mozilla'];
beforeEach(function() {
browser.url('/');
browser.pause(500);
homePage.open();
});
it('should have the right title', function() {
assert.equal(browser.getTitle(), 'Firefox Send');
});
legalLinks.forEach((link, i) => {
it(`should navigate to the correct legal pages, page: ${link}`, function() {
const homePage = new HomePage();
footerLinks.forEach((link, i) => {
it(`should navigate to the correct page: ${link}`, function() {
// Click links on bottom of page
const els = browser.elements(homePage.legalLinks);
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));
});
});
socialLinks.forEach((link, i) => {
it(`should navigate to the correct social pages, page: ${link}`, function() {
const homePage = new HomePage();
// Click links on bottom of page
const els = browser.elements(homePage.socialLinks);
const els = browser.elements(homePage.footerLinks);
browser.elementIdClick(els.value[i].ELEMENT);
// Wait for page to load
browser.waitUntil(() => {