updated integration tests for new ui
This commit is contained in:
parent
891ffc20af
commit
6ba3be8a0f
11 changed files with 65 additions and 153 deletions
|
@ -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(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue