More work with titles & descriptions

This commit is contained in:
vjrj 2018-02-07 15:27:12 +01:00
parent a1138c8c43
commit 464af6b9d1
21 changed files with 178 additions and 51 deletions

View file

@ -65,8 +65,8 @@ module.exports = function doSteps(notos) {
*/
function closeAlert() {
client.waitForVisible('.bert-alert', 5000);
client.click('.bert-content');
// client.waitForVisible('.bert-alert', 5000);
// client.click('.bert-content');
client.waitUntil(() => client.isVisible('.bert-alert') === false, 10000);
}

View file

@ -17,6 +17,21 @@ module.exports = function () {
client.waitForVisible(id, 10000);
client.click(id);
client.waitForText('#react-root', content);
// https://jasmine.github.io/2.3/introduction.html#section-Expectations
expect(client.getTitle()).toContain(pages[i][1]);
}
function processPageUrl(i) {
const url = `${pages[i][0]}`;
const content = pages[i][1];
client.url(`${process.env.ROOT_URL}/${url}`);
client.waitForVisible('#react-root', 10000);
client.waitForText('#react-root', content);
const checkTitle = pages[i][2] === 'true';
// https://jasmine.github.io/2.3/introduction.html#section-Expectations
if (checkTitle) {
expect(client.getTitle()).toContain(pages[i][1]);
}
}
this.Given(/^a list of non visible pages ids and contents$/, (table, callback) => {
@ -35,9 +50,25 @@ module.exports = function () {
this.Then(/^I check that all pages works properly$/, (callback) => {
goHome(client);
if (client.isVisible('#logout')) {
client.click('#logout');
}
for (let i = 0; i < pages.length; i += 1) {
processPage(i);
}
callback();
});
this.Given(/^a list of page urls and contents$/, (table, callback) => {
pages = table.raw();
callback();
});
this.Then(/^I check that all page urls works properly$/, (callback) => {
goHome(client);
for (let i = 0; i < pages.length; i += 1) {
processPageUrl(i);
}
callback();
});
};