Skip to content
Snippets Groups Projects
Commit 5e8b87b3 authored by François Grand's avatar François Grand
Browse files

test(e2e): add check of Mathjax formula in calculator help

refs #608
parent 4cee8d98
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!209Resolve "Documentation: Les formules de math ne s'affichent pas dans la version anglaise"
Pipeline #140240 passed
......@@ -441,4 +441,11 @@ export class CalculatorPage {
n++;
}
}
/**
* get help button related to calculator
*/
getCalculatorHelpButton() {
return element(by.css("#help-calc"));
}
}
import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po";
import { Navbar } from "./navbar.po";
import { browser, by, element } from "protractor";
import { PreferencesPage } from "./preferences.po";
describe("documentation − ", () => {
let listPage: ListPage;
let calcPage: CalculatorPage;
let prefPage: PreferencesPage;
let navbar: Navbar;
beforeAll(() => {
calcPage = new CalculatorPage();
prefPage = new PreferencesPage();
navbar = new Navbar();
listPage = new ListPage();
// browser.manage().window().setPosition(2000, 30);
});
async function checkMathjaxInHelp(lang: number) {
// change setup to French
await prefPage.navigateTo();
await prefPage.changeLanguage(lang);
await browser.sleep(200);
// start page
await navbar.clickNewCalculatorButton();
// open "fish ladder: fall" calculator
await listPage.clickMenuEntryForCalcType(12);
await browser.sleep(200);
// click help
await calcPage.getCalculatorHelpButton().click();
await browser.sleep(200);
browser.getAllWindowHandles().then(async (handles) => {
browser.ignoreSynchronization = true; // deprecated but the only solution to work in the newly opened tab
browser.switchTo().window(handles[1]).then(async () => {
// check Mathjax element is present
expect(element.all(by.css("mjx-container")).isPresent()).toBe(true);
});
});
}
it("check Mathjax formula are displayed in calculator French help", async () => {
await checkMathjaxInHelp(1); // fr
});
it("check Mathjax formula are displayed in calculator English help", async () => {
await checkMathjaxInHelp(0); // en
});
});
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