diff --git a/CHANGELOG.md b/CHANGELOG.md index a56bc3b8c5babe3aed662a852a7452e831becec2..0ab64230aa24bb21e04e47ee2d667f32dc088dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Historique des versions +### 4.16.2 - 2023-01-10 + +#### Correction de bogues + +* Lechapt et Calmon : erreur de sélection de matériau +([jalhyd#337](https://gitlab.irstea.fr/cassiopee/jalhyd/-/issues/337), [nghyd#589](https://gitlab.irstea.fr/cassiopee/nghyd/-/issues/589)) + ### 4.16.1 - 2022-11-16 #### Correction de bogues diff --git a/e2e/lechapt-calmon.e2e-spec.ts b/e2e/lechapt-calmon.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0b991c6dc52504a8c725ef68306d2a1cc09b229 --- /dev/null +++ b/e2e/lechapt-calmon.e2e-spec.ts @@ -0,0 +1,74 @@ +import { ListPage } from "./list.po"; +import { browser, by } from "protractor"; +import { CalculatorPage } from "./calculator.po"; +import { PreferencesPage } from "./preferences.po"; +import { Navbar } from "./navbar.po"; + +/** + * Check that created/cloned structures have empty fields when + * "empty fields on calculator creation" is enabled + */ +describe("Lechapt&Calmon - ", () => { + let prefPage: PreferencesPage; + let listPage: ListPage; + let calcPage: CalculatorPage; + let navBar: Navbar; + + beforeAll(() => { + prefPage = new PreferencesPage(); + listPage = new ListPage(); + calcPage = new CalculatorPage(); + navBar = new Navbar(); + browser.manage().window().setPosition(2000, 30); + }); + + beforeEach(async () => { + // disable evil option "empty fields on module creation" + await prefPage.navigateTo(); + await browser.sleep(200); + await prefPage.disableEvilEmptyFields(); + await browser.sleep(200); + }); + + async function setup() { + // start page + await navBar.clickNewCalculatorButton(); + await browser.sleep(200); + + // open Lechapt-Calmon calculator + await listPage.clickMenuEntryForCalcType(1); + await browser.sleep(200); + } + + it("when material is modified, results should change", async () => { + await setup(); + + // select last material type + const materialSelect = calcPage.getSelectById("select_material"); + await calcPage.changeSelectValue(materialSelect, 8); + await browser.sleep(200); + + // run calculation + const calcButton = calcPage.getCalculateButton(); + await calcButton.click(); + await browser.sleep(200); + + // store total pressure loss result + const res1 = calcPage.getAllFixedResultsRows().get(4); + const pl1 = await res1.all(by.css("td")).get(1).getText(); + + // select first material type + await calcPage.changeSelectValue(materialSelect, 0); + await browser.sleep(200); + + // run calculation + await calcButton.click(); + await browser.sleep(200); + + // compare total pressure loss result with first calculaiotn + const res2 = calcPage.getAllFixedResultsRows().get(4); + const pl2 = await res2.all(by.css("td")).get(1).getText(); + + expect(pl1).not.toEqual(pl2); + }); +}); diff --git a/src/app/calculators/lechaptcalmon/config.json b/src/app/calculators/lechaptcalmon/config.json index 431552de8fe835cc1124910f5ac257babf02690b..610dc7f1a063ede487dc9cc4817ddbf8ded6ece7 100644 --- a/src/app/calculators/lechaptcalmon/config.json +++ b/src/app/calculators/lechaptcalmon/config.json @@ -2,7 +2,6 @@ { "id": "fs_materiau", "type": "fieldset", - "defaultMaterial": "UnlinedCastIronCoarseConcrete", "fields": [ { "id": "select_material", @@ -31,4 +30,4 @@ "selectIds": [ "select_material" ], "help": "hyd_en_charge/lechapt-calmon.html" } -] \ No newline at end of file +]