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

Update protracto config and e2e tests

parent 8748258b
No related branches found
No related tags found
1 merge request!53Resolve "Déplacer au maximum la configuration d'un module vers JaLHyd"
......@@ -37,7 +37,7 @@ describe("ngHyd − cloisons", () => {
await browser.sleep(300);
// 4. change LoiDebit
await calcPage.changeSelectValue(calcPage.getSelectById("select_loidebit1"), 1);
await calcPage.changeSelectValue(calcPage.getSelectById("select_loidebit"), 1);
await browser.sleep(300);
// 5. check number of inputs in CALC mode
......
......@@ -21,14 +21,14 @@ describe("ngHyd − parallel structures with multiple linked parameters − ", (
await listPage.clickMenuEntryForCalcType(8);
await calcPage.getAddStructureButton().click();
const nb1 = await calcPage.getAllLinkButtons().count();
expect(nb1).toBe(10); // link buttons on children but not on parent
expect(nb1).toBe(8); // link buttons on children but not on parent
// 2. check Passe à bassin: Cloisons
await startPage.navigateTo();
await listPage.clickMenuEntryForCalcType(10);
await calcPage.getAddStructureButton().click();
const nb2 = await calcPage.getAllLinkButtons().count();
expect(nb2).toBe(4); // link buttons on children but not on parent
expect(nb2).toBe(6); // link buttons on children but not on parent
// 3. check Lois de déversoirs dénoyés
......@@ -36,7 +36,7 @@ describe("ngHyd − parallel structures with multiple linked parameters − ", (
await listPage.clickMenuEntryForCalcType(9);
await calcPage.getAddStructureButton().click();
const nb3 = await calcPage.getAllLinkButtons().count();
expect(nb3).toBe(4); // link buttons on children but not on parent
expect(nb3).toBe(6); // link buttons on children but not on parent
});
});
......@@ -79,10 +79,6 @@ describe("ngHyd − load session with multiple linked parameters − ", () => {
const lo_wv = await calcPage.getSelectValueText(lo_w);
expect(lo_wv).toContain("Ouverture de vanne (Ouvrages, ouvrage 2)");
const lo_cd = calcPage.getSelectById("2_linked_Cd");
const lo_cdv = await calcPage.getSelectValueText(lo_cd);
expect(lo_cdv).toContain("Coefficient de débit (Ouvrages, ouvrage 1)");
// 4. check Régime uniforme
await navbar.clickCalculatorTab(3);
await browser.sleep(500);
......
......@@ -59,7 +59,7 @@ describe("ngHyd − save and load sessions", () => {
await listPage.clickMenuEntryForCalcType(2); // Section paramétrée
await browser.sleep(500);
await calcPage.changeSelectValue(calcPage.getSelectById("select_section"), 2); // mode "circulaire"
await calcPage.changeSelectValue(calcPage.getSelectById("select_section"), 2); // mode "trapezoidal"
await calcPage.getInputById("Ks").clear(); // coefficient de Strickler
await browser.sleep(1000);
......@@ -83,7 +83,7 @@ describe("ngHyd − save and load sessions", () => {
const fileContent = fs.readFileSync(filename, { encoding: "utf8" });
// tslint:disable-next-line:quotemark
expect(fileContent).toContain('"nodeType":3');
expect(fileContent).toContain('"nodeType":1');
// tslint:disable-next-line:quotemark
expect(fileContent).toContain('{"symbol":"Ks","mode":"SINGLE","value":42}');
});
......
......@@ -3,6 +3,11 @@
const { SpecReporter } = require('jasmine-spec-reporter');
const path = require("path");
const os = require("os");
const downloadsPath = path.resolve(os.homedir(), "Téléchargements");
exports.config = {
allScriptsTimeout: 11000,
specs: [
......@@ -16,7 +21,7 @@ exports.config = {
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: '/tmp/e2e-downloads'
// default_directory: '/tmp/e2e-downloads'
},
},
},
......@@ -35,5 +40,9 @@ exports.config = {
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
browser.manage().window().setSize(1600, 1000);
browser.driver.sendChromiumCommand('Page.setDownloadBehavior', {
behavior: 'allow',
downloadPath: downloadsPath
});
}
};
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