Skip to content
Snippets Groups Projects
Commit 4c240b2c authored by mathias.chouet's avatar mathias.chouet
Browse files

Update translation checking e2e test

parent 4ba4b273
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import { SideNav } from "./sidenav.po";
* For all calculators, try to calculate every parameter: check that only one parameter
* is set to CAL mode, trigger the calculation, check that result is not empty
*/
fdescribe("ngHyd − check translation of all calculators", () => {
describe("ngHyd − check translation of all calculators", () => {
let listPage: ListPage;
let calcPage: CalculatorPage;
let navBar: Navbar;
......@@ -37,15 +37,29 @@ fdescribe("ngHyd − check translation of all calculators", () => {
beforeAll(async () => {
await prefPage.navigateTo();
await prefPage.changeLanguage(i);
await browser.sleep(2000);
await browser.sleep(200);
await navBar.clickNewCalculatorButton();
});
beforeEach(function () {
jasmine.addMatchers({
toContain: function () {
return {
compare: function (actual, expected) {
const result = {
pass: actual.includes(expected),
message: "error" // short message to avoid whole page source being dumped on expect() failure
};
return result;
}
};
}
});
});
// for each calculator
for (const ct of calcTypes) {
it(" − check translations of calculator type [" + ct + "]", async () => {
// go to list page
await navBar.clickNewCalculatorButton();
// click calculator button (instanciate)
await listPage.clickMenuEntryForCalcType(ct);
......@@ -60,10 +74,12 @@ fdescribe("ngHyd − check translation of all calculators", () => {
const hasResults = await calcPage.hasResults();
expect(hasResults).toBe(true);
// @TODO check absence of "*** message not found" in whole DOM
expect(" SOURCE CODE ").not.toContain("*** message not found");
// check absence of "*** message not found" in whole DOM
expect(await browser.getPageSource()).not.toContain("*** message not found");
// close calc
// empty session
await navBar.clickMenuButton();
await browser.sleep(200);
await sideNav.clickNewSessionButton();
browser.sleep(200);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment