diff --git a/.vscode/launch.json b/.vscode/launch.json index 560298a3045c52d0ab3ab4eaeeec40ee183c8432..1d92791fcaaab47792e582858c23e003bd0b8cb0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,10 @@ "name": "Launch Chrome (local webserver)", "url": "http://localhost:4200", "webRoot": "${workspaceFolder}", - "runtimeExecutable": "/usr/bin/chromium-browser" + "runtimeExecutable": "/usr/bin/chromium", + "runtimeArgs": [ + "--preserve-symlinks" + ] }, { "name": "Launch Firefox (local webserver)", @@ -19,6 +22,23 @@ "reAttach": true, "url": "http://localhost:4200", "webRoot": "${workspaceFolder}" + }, + { + "name": "Launch e2e current file", + "type": "node", + "request": "launch", + "stopOnEntry": false, + "program": "${workspaceRoot}/node_modules/protractor/bin/protractor", + "args": [ + "${workspaceRoot}/protractor.conf.js", + "--specs=${file}" + ], + "cwd": "${workspaceRoot}", + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/dist/out-tsc-e2e/*.js" + ], + "skipSourceMapSupport": true } ] -} \ No newline at end of file +} diff --git a/e2e/variable-param-cancel.e2e-spec.ts b/e2e/variable-param-cancel.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..750fdd160d73588540e51b7d4bcb64abe0d18b84 --- /dev/null +++ b/e2e/variable-param-cancel.e2e-spec.ts @@ -0,0 +1,30 @@ +import { ListPage } from "./list.po"; +import { by, element } from "protractor"; + +/** + * Check that a cancel button is present in min/max/list edition dialog + * for variable parameters + */ +describe("ngHyd - check cancel button for variable parameters - ", () => { + let listPage: ListPage; + + beforeAll(async () => { + listPage = new ListPage(); + }); + + fit("when min/max/list values dialog opens, a cancel button should be present", async () => { + // start page + await listPage.navigateTo(); + + // open PAB chute + await listPage.clickMenuEntryForCalcType(12); + + // click "var" radio on Z1 parameter + const z1btn = element(by.id("mat-button-toggle-2-button")); + await z1btn.click(); + + // cancel button presence + const cancelbtn = element(by.id("btn-cancel")); + expect(await cancelbtn.isPresent() && await cancelbtn.isDisplayed()).toBeTruthy(); + }); +}); diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html index e8dbbb2c9f2ad66dc5e7b161b57bf2973818201f..5fc7c8482a5c80a96117ad4c164b08dd66f6bee5 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html @@ -121,7 +121,7 @@ <div mat-dialog-actions [attr.align]="'end'"> <div> - <button mat-raised-button color="primary" [mat-dialog-close]="true" cdkFocusInitial> + <button id="btn-cancel" mat-raised-button color="primary" [mat-dialog-close]="true" cdkFocusInitial> {{ uitextCancel }} </button> <button mat-raised-button color="warn" (click)="onValidate()" [disabled]=" !isFormValid">