2018-10-04 02:39:39 +02:00
|
|
|
/* global browser */
|
2018-10-02 22:15:02 +02:00
|
|
|
const assert = require('assert');
|
2018-10-04 02:39:39 +02:00
|
|
|
const HomePage = require('./pages/desktop/home_page');
|
2018-10-02 22:15:02 +02:00
|
|
|
|
2020-10-15 18:52:41 +02:00
|
|
|
describe('Send homepage', function() {
|
2019-03-13 01:47:54 +01:00
|
|
|
this.retries(2);
|
2018-10-31 19:31:17 +01:00
|
|
|
const homePage = new HomePage();
|
2018-10-02 22:15:02 +02:00
|
|
|
const baseUrl = browser.options['baseUrl'];
|
2021-01-09 18:59:45 +01:00
|
|
|
const footerLinks = ['mozilla', 'cookies', 'github'];
|
2018-10-02 22:15:02 +02:00
|
|
|
|
2018-10-04 02:39:39 +02:00
|
|
|
beforeEach(function() {
|
2018-10-31 19:31:17 +01:00
|
|
|
homePage.open();
|
2019-03-13 01:47:54 +01:00
|
|
|
if (process.env.ANDROID) {
|
|
|
|
this.skip();
|
|
|
|
}
|
2018-10-02 22:15:02 +02:00
|
|
|
});
|
|
|
|
|
2018-10-04 02:39:39 +02:00
|
|
|
it('should have the right title', function() {
|
2020-10-15 18:52:41 +02:00
|
|
|
assert.equal(browser.getTitle(), 'Send');
|
2018-10-02 22:15:02 +02:00
|
|
|
});
|
|
|
|
|
2018-10-31 19:31:17 +01:00
|
|
|
footerLinks.forEach((link, i) => {
|
|
|
|
it(`should navigate to the correct page: ${link}`, function() {
|
2018-10-02 22:15:02 +02:00
|
|
|
// Click links on bottom of page
|
2018-10-31 19:31:17 +01:00
|
|
|
const els = browser.elements(homePage.footerLinks);
|
2018-10-02 22:15:02 +02:00
|
|
|
browser.elementIdClick(els.value[i].ELEMENT);
|
|
|
|
// Wait for page to load
|
|
|
|
browser.waitUntil(() => {
|
2018-10-04 02:39:39 +02:00
|
|
|
const url = browser.getUrl();
|
2018-10-02 22:15:02 +02:00
|
|
|
return url !== baseUrl;
|
|
|
|
});
|
|
|
|
assert.ok(browser.getUrl().includes(link));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|