From e143ed562c61bd18ed7b781ebbbd2ef3fd7bca30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Tue, 28 Feb 2023 12:48:42 +0100
Subject: [PATCH] test(e2e): check that input empty in empty fields mode when
 modifying the target module

refs #601
---
 e2e/solveur.e2e-spec.ts | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/e2e/solveur.e2e-spec.ts b/e2e/solveur.e2e-spec.ts
index 281aeec5a..9c7160e07 100644
--- a/e2e/solveur.e2e-spec.ts
+++ b/e2e/solveur.e2e-spec.ts
@@ -375,4 +375,34 @@ describe("Solveur - nghyd#601 without empty fields option", () => {
         await calcPage.checkEmptyInput("Xinit", false);
         await browser.sleep(200);
     });
+
+    it(" with empty fields option, check selecting a target module does not fill inputs", async () => {
+        // disable evil option "empty fields on module creation"
+        await prefPage.setEmptyFields(false);
+        await browser.sleep(200);
+
+        await navBar.clickNewCalculatorButton();
+        await browser.sleep(200);
+
+        // open "channel flow with hydraulic structures" example
+        const examples = await element.all(by.css("#examples-list .load-example"));
+        await examples[1].click();
+        await browser.sleep(500);
+
+        // close existing "solver" calculator
+        await navBar.middleClickCalculatorTab(3);
+        await browser.sleep(500);
+
+        // open new solver calculator
+        await openSolver();
+        await browser.sleep(500);
+
+        // select other target module
+        const ntc = calcPage.getSelectById("select_target_nub");
+        await calcPage.changeSelectValue(ntc, 1);
+
+        // check target value input is empty
+        await calcPage.checkEmptyInput("Ytarget", true);
+        await browser.sleep(200);
+    });
 });
-- 
GitLab