From 7131f54dfae8ee73b244dccec3b560d516fbb8fc Mon Sep 17 00:00:00 2001 From: atlldwp Date: Tue, 10 Dec 2024 16:27:33 +0100 Subject: [PATCH 1/4] updated ctl admin feature --- .../e2e/admin/administrateCtlTools.feature | 99 +++++++++++-------- .../createEditDeleteCtlToolInBoard.feature | 2 +- .../support/pages/admin/pageAdministration.js | 15 ++- .../admin/administrateCtlToolSteps.spec.js | 42 ++++---- 4 files changed, 91 insertions(+), 67 deletions(-) diff --git a/cypress/e2e/admin/administrateCtlTools.feature b/cypress/e2e/admin/administrateCtlTools.feature index a4525c84..ae8f00bb 100644 --- a/cypress/e2e/admin/administrateCtlTools.feature +++ b/cypress/e2e/admin/administrateCtlTools.feature @@ -1,11 +1,13 @@ -@unstable_test +@stable_test +@regression_test Feature: Admin CTL Tools - To add, edit and delete CTL tools by the admin As an admin I want to administrate the CTL tools used in the school - @unstable_test + #Note: Ctl tools are already created manually on the main-nbc, on staging-nbc specifically for the cypress test and it starts with the prefix CY. + Scenario: Admin adds, edits and deletes external tools - Given I am logged in as a 'admin1_nbc' at 'nbc' + Given I am logged in as a '' at '' When I click on administration in menu When I navigate to new school admin page via sub menu When I click on external tools panel @@ -13,89 +15,100 @@ Feature: Admin CTL Tools - To add, edit and delete CTL tools by the admin When I click the add external tool button Then I see the external tools configuration page Then I see the external tool configuration page title + Then I see the external tool configuration page title Then I see the tool configuration infotext - # Admin tries to find a hidden external tool - Then I do not see external tool 'CY Test Tool Hidden' in the tool selection + # Admin tries to find a hidden external tool + Then I do not see external tool '' in the tool selection - # Admin adds a tool - When I select the tool 'CY Test Tool 1' from available tools - Then I see tool 'CY Test Tool 1' is selected + # Admin adds a tool + When I select the tool '' from available tools + Then I see tool '' is selected When I click on save external tool button - Then I see the tool 'CY Test Tool 1' in external tools table + Then I see the tool '' in external tools table - # Admin adds a tool with required custom parameter + # Admin adds a tool with required custom parameter When I click the add external tool button Then I see the external tools configuration page Then I see the external tool configuration page title Then I see the tool configuration infotext - When I select the tool 'CY Test Tool Required Parameters' from available tools - Then I see tool 'CY Test Tool Required Parameters' is selected - When I enter 'test' in required custom parameter input field 'schoolParam' - Then I see custom parameter input field 'schoolParam' contains 'test' + When I select the tool '' from available tools + Then I see tool '' is selected + When I enter '' in required custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' When I click on save external tool button - Then I see the tool 'CY Test Tool Required Parameters' in external tools table + Then I see the tool '' in external tools table - # Admin adds a tool via tool link with parameter + # Admin adds a tool via tool link with parameter When I click the add external tool button Then I see the external tools configuration page Then I see the external tool configuration page title Then I see the tool configuration infotext When I insert the external tool link 'https://www.openstreetmap.org/?mlat=52.40847&mlon=9.80823&zoom=19#map=19/52.40847/9.80823' - Then I see tool 'OpenStreetMap' is selected + Then I see tool '' is selected When I click on save external tool button - Then I see the tool 'OpenStreetMap' in external tools table + Then I see the tool '' in external tools table - # Admin adds a tool with optional custom parameter + # Admin adds a tool with optional custom parameter When I click the add external tool button Then I see the external tools configuration page Then I see the external tool configuration page title Then I see the tool configuration infotext - When I select the tool 'CY Test Tool Optional Parameters' from available tools - Then I see tool 'CY Test Tool Optional Parameters' is selected - When I enter 'test' in optional custom parameter input field 'schoolParam' - Then I see custom parameter input field 'schoolParam' contains 'test' + When I select the tool '' from available tools + Then I see tool '' is selected + When I enter '' in optional custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' When I click on save external tool button - Then I see the tool 'CY Test Tool Optional Parameters' in external tools table + Then I see the tool '' in external tools table - # Admin edits a tool - When I click on edit button of tool 'CY Test Tool Optional Parameters' + # Admin edits a tool + When I click on edit button of tool '' Then I see the external tools configuration page Then I see the external tool configuration page title Then I see the tool configuration infotext - Then I see tool 'CY Test Tool Optional Parameters' is selected - When I enter 'updated test' in optional custom parameter input field 'schoolParam' - Then I see custom parameter input field 'schoolParam' contains 'updated test' + Then I see tool '' is selected + When I enter '' in optional custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' When I click on save external tool button - Then I see the tool 'CY Test Tool Optional Parameters' in external tools table - When I click on edit button of tool 'CY Test Tool Optional Parameters' + Then I see the tool '' in external tools table + When I click on edit button of tool '' Then I see the external tools configuration page - Then I see custom parameter input field 'schoolParam' contains 'updated test' + Then I see custom parameter input field schoolParam contains '' - # Admin deletes tools + # Admin deletes tools When I click on administration in menu When I navigate to new school admin page via sub menu When I click on external tools panel Then I see the external tools table - Then I see the tool 'CY Test Tool 1' in external tools table - Then I see the tool 'CY Test Tool Required Parameters' in external tools table - Then I see the tool 'CY Test Tool Optional Parameters' in external tools table - When I click on delete button of tool 'CY Test Tool 1' + Then I see the tool '' in external tools table + Then I see the tool '' in external tools table + Then I see the tool '' in external tools table + When I click on delete button of tool '' Then I see the external tool deletion dialog title Then I see the external tool deletion dialog information text When I confirm deletion on deletion dialog - Then I do not see the tool 'CY Test Tool 1' in external tools table - When I click on delete button of tool 'CY Test Tool Required Parameters' + Then I do not see the tool '' in external tools table + When I click on delete button of tool '' Then I see the external tool deletion dialog title Then I see the external tool deletion dialog information text When I confirm deletion on deletion dialog - Then I do not see the tool 'CY Test Tool Required Parameters' in external tools table - When I click on delete button of tool 'CY Test Tool Optional Parameters' + Then I do not see the tool '' in external tools table + When I click on delete button of tool '' Then I see the external tool deletion dialog title Then I see the external tool deletion dialog information text When I confirm deletion on deletion dialog - When I click on delete button of tool 'OpenStreetMap' + When I click on delete button of tool '' Then I see the external tool deletion dialog title Then I see the external tool deletion dialog information text When I confirm deletion on deletion dialog - Then I do not see the tool 'OpenStreetMap' in external tools table + Then I do not see the tool '' in external tools table Then I see the external tools table is empty + + @school_api_test + Examples: + | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | + | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | + + @staging_test + Examples: + | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | + | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | diff --git a/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature b/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature index b89451e8..9b6018fc 100644 --- a/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature +++ b/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature @@ -28,7 +28,7 @@ Feature: Course Board - To add, edit and delete a ctl tool in a board Then I see the tool 'CY Test Tool 1' in external tools table When I click the add external tool button When I select the tool 'CY Test Tool Required Parameters' from available tools - When I enter 'test' in required custom parameter input field 'schoolParam' + When I enter 'test' in required custom parameter input field schoolParam When I click on save external tool button Then I see the tool 'CY Test Tool Required Parameters' in external tools table When I click the add external tool button diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 06994c73..04619ee2 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -159,7 +159,7 @@ class Management { static #buttonSaveChangePasswordModalUserSetting = '[data-testid="submit-btn-change-password-modal"]'; static #successNotificationChangePassword = '[data-testid="notification"]'; - + static #inputBoxParamNameCtlToolConfig = '[data-testid="schoolParam"]'; seeSuccessMessageAfterChangingPasswordByAdmin() { cy.get(Management.#successNotificationChangePassword).should("be.visible"); } @@ -1008,12 +1008,17 @@ class Management { ); } - seeCustomParameterFormContains(paramName, value) { - cy.get(`[data-testid="${paramName}"]`).find("input").should("have.value", value); + seeCustomParameterFormContains(value) { + cy.get(Management.#inputBoxParamNameCtlToolConfig) + .find("input") + .should("have.value", value); } - fillInCustomParameter(paramName, value) { - cy.get(`[data-testid="${paramName}"]`).find("input").clear().type(value); + fillInCustomParameter(value) { + cy.get(Management.#inputBoxParamNameCtlToolConfig) + .find("input") + .clear() + .type(value); } insertToolLink(toolLink) { diff --git a/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js b/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js index 48450bb3..ca3dfbf7 100644 --- a/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js +++ b/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js @@ -35,8 +35,8 @@ Then("I see tool {string} is selected", (toolName) => { management.seeSelectedExternalTool(toolName); }); -Then("I see custom parameter input field {string} contains {string}", (paramName, value) => { - management.seeCustomParameterFormContains(paramName, value); +Then("I see custom parameter input field schoolParam contains {string}", (value) => { + management.seeCustomParameterFormContains(value); }); Then("I do not see the tool {string} in external tools table", (toolName) => { @@ -53,10 +53,10 @@ Then("I do not see external tool {string} in the tool selection", (toolName) => Then("I see the deactivate checkbox is {string}", (value) => { management.seeDeactivatedCheckBox(value); - if(value === "checked"){ - management.seeDeactivatedCheckBoxIsChecked() - } else if(value === "not checked"){ - management.seeDeactivatedCheckBoxIsNotChecked() + if (value === "checked") { + management.seeDeactivatedCheckBoxIsChecked(); + } else if (value === "not checked") { + management.seeDeactivatedCheckBoxIsNotChecked(); } }); @@ -112,26 +112,32 @@ When("I confirm deletion on deletion dialog", () => { management.clickOnConfirmInToolUsageDialog(); }); -When("I enter {string} in required custom parameter input field {string}", (value, paramName) => { - management.fillInCustomParameter(paramName, value); +When("I enter {string} in required custom parameter input field schoolParam", (value) => { + management.fillInCustomParameter(value); }); -When("I enter {string} in optional custom parameter input field {string}", (value, paramName) => { - management.fillInCustomParameter(paramName, value); +When("I enter {string} in optional custom parameter input field schoolParam", (value) => { + management.fillInCustomParameter(value); }); When("I insert the external tool link {string}", (toolLink) => { management.insertToolLink(toolLink); }); -Then("I see configuration {string} is filled below with {string}", (key, value) =>{ +Then("I see configuration {string} is filled below with {string}", (key, value) => { management.checkConfiguration(key, value); -}) +}); -Then("I see the tool {string} in external tools table has no context restriction", (toolName) =>{ - management.seeToolHasNoContextRestriction(toolName); -}) +Then( + "I see the tool {string} in external tools table has no context restriction", + (toolName) => { + management.seeToolHasNoContextRestriction(toolName); + } +); -Then("I see the tool {string} in external tools table has context restriction {string}", (toolName, contextRestriction) =>{ - management.seeToolHasContextRestriction(toolName,contextRestriction); -}) +Then( + "I see the tool {string} in external tools table has context restriction {string}", + (toolName, contextRestriction) => { + management.seeToolHasContextRestriction(toolName, contextRestriction); + } +); From bbc2173bc39bf20049c1600f1135f3da7d6f8bf0 Mon Sep 17 00:00:00 2001 From: atlldwp Date: Tue, 10 Dec 2024 16:31:33 +0100 Subject: [PATCH 2/4] uodate --- .../e2e/admin/administrateCtlTools.feature | 200 +++++++++--------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/cypress/e2e/admin/administrateCtlTools.feature b/cypress/e2e/admin/administrateCtlTools.feature index ae8f00bb..b7d25247 100644 --- a/cypress/e2e/admin/administrateCtlTools.feature +++ b/cypress/e2e/admin/administrateCtlTools.feature @@ -2,113 +2,113 @@ @regression_test Feature: Admin CTL Tools - To add, edit and delete CTL tools by the admin - As an admin I want to administrate the CTL tools used in the school + As an admin I want to administrate the CTL tools used in the school - #Note: Ctl tools are already created manually on the main-nbc, on staging-nbc specifically for the cypress test and it starts with the prefix CY. + #Note: Ctl tools are already created manually on the main-nbc, on staging-nbc specifically for the cypress test and it starts with the prefix CY. - Scenario: Admin adds, edits and deletes external tools - Given I am logged in as a '' at '' - When I click on administration in menu - When I navigate to new school admin page via sub menu - When I click on external tools panel - Then I see the external tools table is empty - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the external tool configuration page title - Then I see the tool configuration infotext - # Admin tries to find a hidden external tool - Then I do not see external tool '' in the tool selection + Scenario: Admin adds, edits and deletes external tools + Given I am logged in as a '' at '' + When I click on administration in menu + When I navigate to new school admin page via sub menu + When I click on external tools panel + Then I see the external tools table is empty + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the external tool configuration page title + Then I see the tool configuration infotext + # Admin tries to find a hidden external tool + Then I do not see external tool '' in the tool selection - # Admin adds a tool - When I select the tool '' from available tools - Then I see tool '' is selected - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool + When I select the tool '' from available tools + Then I see tool '' is selected + When I click on save external tool button + Then I see the tool '' in external tools table - # Admin adds a tool with required custom parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I select the tool '' from available tools - Then I see tool '' is selected - When I enter '' in required custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool with required custom parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I select the tool '' from available tools + Then I see tool '' is selected + When I enter '' in required custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' + When I click on save external tool button + Then I see the tool '' in external tools table - # Admin adds a tool via tool link with parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I insert the external tool link 'https://www.openstreetmap.org/?mlat=52.40847&mlon=9.80823&zoom=19#map=19/52.40847/9.80823' - Then I see tool '' is selected - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool via tool link with parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I insert the external tool link 'https://www.openstreetmap.org/?mlat=52.40847&mlon=9.80823&zoom=19#map=19/52.40847/9.80823' + Then I see tool '' is selected + When I click on save external tool button + Then I see the tool '' in external tools table - # Admin adds a tool with optional custom parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I select the tool '' from available tools - Then I see tool '' is selected - When I enter '' in optional custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool with optional custom parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I select the tool '' from available tools + Then I see tool '' is selected + When I enter '' in optional custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' + When I click on save external tool button + Then I see the tool '' in external tools table - # Admin edits a tool - When I click on edit button of tool '' - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - Then I see tool '' is selected - When I enter '' in optional custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table - When I click on edit button of tool '' - Then I see the external tools configuration page - Then I see custom parameter input field schoolParam contains '' + # Admin edits a tool + When I click on edit button of tool '' + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + Then I see tool '' is selected + When I enter '' in optional custom parameter input field schoolParam + Then I see custom parameter input field schoolParam contains '' + When I click on save external tool button + Then I see the tool '' in external tools table + When I click on edit button of tool '' + Then I see the external tools configuration page + Then I see custom parameter input field schoolParam contains '' - # Admin deletes tools - When I click on administration in menu - When I navigate to new school admin page via sub menu - When I click on external tools panel - Then I see the external tools table - Then I see the tool '' in external tools table - Then I see the tool '' in external tools table - Then I see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - Then I see the external tools table is empty + # Admin deletes tools + When I click on administration in menu + When I navigate to new school admin page via sub menu + When I click on external tools panel + Then I see the external tools table + Then I see the tool '' in external tools table + Then I see the tool '' in external tools table + Then I see the tool '' in external tools table + When I click on delete button of tool '' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool '' in external tools table + When I click on delete button of tool '' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool '' in external tools table + When I click on delete button of tool '' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + When I click on delete button of tool '' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool '' in external tools table + Then I see the external tools table is empty - @school_api_test - Examples: - | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | - | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | + @school_api_test + Examples: + | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | + | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | - @staging_test - Examples: - | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | - | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | + @staging_test + Examples: + | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | + | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | From e28656ae472661b1e6553caf9f6b3e9649a49cd0 Mon Sep 17 00:00:00 2001 From: atlldwp Date: Wed, 11 Dec 2024 11:48:10 +0100 Subject: [PATCH 3/4] updated feature line --- cypress/e2e/login_management/cloudLogin.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/e2e/login_management/cloudLogin.feature b/cypress/e2e/login_management/cloudLogin.feature index aba6f6f0..9e213cc8 100644 --- a/cypress/e2e/login_management/cloudLogin.feature +++ b/cypress/e2e/login_management/cloudLogin.feature @@ -18,7 +18,6 @@ Feature: Login Management - Login of users managed by SVS | brb | teacher1_brb | admin1_brb | student1_brb | @school_api_test - # currently, there is an issue (BC-7880), that consecutive logins one after another for different users/instances, shows internal server error after clicking on the button Login. Examples: | namespace | teacher | admin | student | | dbc | teacher1_dbc | admin1_dbc | student1_dbc | From 08e35307697facd61179a0345edb13d10dc8aa02 Mon Sep 17 00:00:00 2001 From: atlldwp Date: Mon, 16 Dec 2024 10:54:24 +0100 Subject: [PATCH 4/4] Revert "updated ctl admin feature" --- .../e2e/admin/administrateCtlTools.feature | 197 ++++++++---------- .../createEditDeleteCtlToolInBoard.feature | 2 +- .../support/pages/admin/pageAdministration.js | 15 +- .../admin/administrateCtlToolSteps.spec.js | 42 ++-- 4 files changed, 116 insertions(+), 140 deletions(-) diff --git a/cypress/e2e/admin/administrateCtlTools.feature b/cypress/e2e/admin/administrateCtlTools.feature index b7d25247..a4525c84 100644 --- a/cypress/e2e/admin/administrateCtlTools.feature +++ b/cypress/e2e/admin/administrateCtlTools.feature @@ -1,114 +1,101 @@ -@stable_test -@regression_test +@unstable_test Feature: Admin CTL Tools - To add, edit and delete CTL tools by the admin - As an admin I want to administrate the CTL tools used in the school + As an admin I want to administrate the CTL tools used in the school - #Note: Ctl tools are already created manually on the main-nbc, on staging-nbc specifically for the cypress test and it starts with the prefix CY. + @unstable_test + Scenario: Admin adds, edits and deletes external tools + Given I am logged in as a 'admin1_nbc' at 'nbc' + When I click on administration in menu + When I navigate to new school admin page via sub menu + When I click on external tools panel + Then I see the external tools table is empty + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + # Admin tries to find a hidden external tool + Then I do not see external tool 'CY Test Tool Hidden' in the tool selection - Scenario: Admin adds, edits and deletes external tools - Given I am logged in as a '' at '' - When I click on administration in menu - When I navigate to new school admin page via sub menu - When I click on external tools panel - Then I see the external tools table is empty - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the external tool configuration page title - Then I see the tool configuration infotext - # Admin tries to find a hidden external tool - Then I do not see external tool '' in the tool selection + # Admin adds a tool + When I select the tool 'CY Test Tool 1' from available tools + Then I see tool 'CY Test Tool 1' is selected + When I click on save external tool button + Then I see the tool 'CY Test Tool 1' in external tools table - # Admin adds a tool - When I select the tool '' from available tools - Then I see tool '' is selected - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool with required custom parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I select the tool 'CY Test Tool Required Parameters' from available tools + Then I see tool 'CY Test Tool Required Parameters' is selected + When I enter 'test' in required custom parameter input field 'schoolParam' + Then I see custom parameter input field 'schoolParam' contains 'test' + When I click on save external tool button + Then I see the tool 'CY Test Tool Required Parameters' in external tools table - # Admin adds a tool with required custom parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I select the tool '' from available tools - Then I see tool '' is selected - When I enter '' in required custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool via tool link with parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I insert the external tool link 'https://www.openstreetmap.org/?mlat=52.40847&mlon=9.80823&zoom=19#map=19/52.40847/9.80823' + Then I see tool 'OpenStreetMap' is selected + When I click on save external tool button + Then I see the tool 'OpenStreetMap' in external tools table - # Admin adds a tool via tool link with parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I insert the external tool link 'https://www.openstreetmap.org/?mlat=52.40847&mlon=9.80823&zoom=19#map=19/52.40847/9.80823' - Then I see tool '' is selected - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin adds a tool with optional custom parameter + When I click the add external tool button + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + When I select the tool 'CY Test Tool Optional Parameters' from available tools + Then I see tool 'CY Test Tool Optional Parameters' is selected + When I enter 'test' in optional custom parameter input field 'schoolParam' + Then I see custom parameter input field 'schoolParam' contains 'test' + When I click on save external tool button + Then I see the tool 'CY Test Tool Optional Parameters' in external tools table - # Admin adds a tool with optional custom parameter - When I click the add external tool button - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - When I select the tool '' from available tools - Then I see tool '' is selected - When I enter '' in optional custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table + # Admin edits a tool + When I click on edit button of tool 'CY Test Tool Optional Parameters' + Then I see the external tools configuration page + Then I see the external tool configuration page title + Then I see the tool configuration infotext + Then I see tool 'CY Test Tool Optional Parameters' is selected + When I enter 'updated test' in optional custom parameter input field 'schoolParam' + Then I see custom parameter input field 'schoolParam' contains 'updated test' + When I click on save external tool button + Then I see the tool 'CY Test Tool Optional Parameters' in external tools table + When I click on edit button of tool 'CY Test Tool Optional Parameters' + Then I see the external tools configuration page + Then I see custom parameter input field 'schoolParam' contains 'updated test' - # Admin edits a tool - When I click on edit button of tool '' - Then I see the external tools configuration page - Then I see the external tool configuration page title - Then I see the tool configuration infotext - Then I see tool '' is selected - When I enter '' in optional custom parameter input field schoolParam - Then I see custom parameter input field schoolParam contains '' - When I click on save external tool button - Then I see the tool '' in external tools table - When I click on edit button of tool '' - Then I see the external tools configuration page - Then I see custom parameter input field schoolParam contains '' - - # Admin deletes tools - When I click on administration in menu - When I navigate to new school admin page via sub menu - When I click on external tools panel - Then I see the external tools table - Then I see the tool '' in external tools table - Then I see the tool '' in external tools table - Then I see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - When I click on delete button of tool '' - Then I see the external tool deletion dialog title - Then I see the external tool deletion dialog information text - When I confirm deletion on deletion dialog - Then I do not see the tool '' in external tools table - Then I see the external tools table is empty - - @school_api_test - Examples: - | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | - | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | - - @staging_test - Examples: - | namespace | admin | hidden_tool_name | ctl_tool_on_list | ctl_tool_with_required_param | param_name | linked_tool_name | ctl_tool_with_optional_param | updated_param_name | - | nbc | admin1_nbc | CY Test Tool Hidden | CY Test Tool 1 | CY Test Tool Required Parameters | test | OpenStreetMap | CY Test Tool Optional Parameters | updated test | + # Admin deletes tools + When I click on administration in menu + When I navigate to new school admin page via sub menu + When I click on external tools panel + Then I see the external tools table + Then I see the tool 'CY Test Tool 1' in external tools table + Then I see the tool 'CY Test Tool Required Parameters' in external tools table + Then I see the tool 'CY Test Tool Optional Parameters' in external tools table + When I click on delete button of tool 'CY Test Tool 1' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool 'CY Test Tool 1' in external tools table + When I click on delete button of tool 'CY Test Tool Required Parameters' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool 'CY Test Tool Required Parameters' in external tools table + When I click on delete button of tool 'CY Test Tool Optional Parameters' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + When I click on delete button of tool 'OpenStreetMap' + Then I see the external tool deletion dialog title + Then I see the external tool deletion dialog information text + When I confirm deletion on deletion dialog + Then I do not see the tool 'OpenStreetMap' in external tools table + Then I see the external tools table is empty diff --git a/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature b/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature index 9b6018fc..b89451e8 100644 --- a/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature +++ b/cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature @@ -28,7 +28,7 @@ Feature: Course Board - To add, edit and delete a ctl tool in a board Then I see the tool 'CY Test Tool 1' in external tools table When I click the add external tool button When I select the tool 'CY Test Tool Required Parameters' from available tools - When I enter 'test' in required custom parameter input field schoolParam + When I enter 'test' in required custom parameter input field 'schoolParam' When I click on save external tool button Then I see the tool 'CY Test Tool Required Parameters' in external tools table When I click the add external tool button diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 04619ee2..06994c73 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -159,7 +159,7 @@ class Management { static #buttonSaveChangePasswordModalUserSetting = '[data-testid="submit-btn-change-password-modal"]'; static #successNotificationChangePassword = '[data-testid="notification"]'; - static #inputBoxParamNameCtlToolConfig = '[data-testid="schoolParam"]'; + seeSuccessMessageAfterChangingPasswordByAdmin() { cy.get(Management.#successNotificationChangePassword).should("be.visible"); } @@ -1008,17 +1008,12 @@ class Management { ); } - seeCustomParameterFormContains(value) { - cy.get(Management.#inputBoxParamNameCtlToolConfig) - .find("input") - .should("have.value", value); + seeCustomParameterFormContains(paramName, value) { + cy.get(`[data-testid="${paramName}"]`).find("input").should("have.value", value); } - fillInCustomParameter(value) { - cy.get(Management.#inputBoxParamNameCtlToolConfig) - .find("input") - .clear() - .type(value); + fillInCustomParameter(paramName, value) { + cy.get(`[data-testid="${paramName}"]`).find("input").clear().type(value); } insertToolLink(toolLink) { diff --git a/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js b/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js index ca3dfbf7..48450bb3 100644 --- a/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js +++ b/cypress/support/step_definition/admin/administrateCtlToolSteps.spec.js @@ -35,8 +35,8 @@ Then("I see tool {string} is selected", (toolName) => { management.seeSelectedExternalTool(toolName); }); -Then("I see custom parameter input field schoolParam contains {string}", (value) => { - management.seeCustomParameterFormContains(value); +Then("I see custom parameter input field {string} contains {string}", (paramName, value) => { + management.seeCustomParameterFormContains(paramName, value); }); Then("I do not see the tool {string} in external tools table", (toolName) => { @@ -53,10 +53,10 @@ Then("I do not see external tool {string} in the tool selection", (toolName) => Then("I see the deactivate checkbox is {string}", (value) => { management.seeDeactivatedCheckBox(value); - if (value === "checked") { - management.seeDeactivatedCheckBoxIsChecked(); - } else if (value === "not checked") { - management.seeDeactivatedCheckBoxIsNotChecked(); + if(value === "checked"){ + management.seeDeactivatedCheckBoxIsChecked() + } else if(value === "not checked"){ + management.seeDeactivatedCheckBoxIsNotChecked() } }); @@ -112,32 +112,26 @@ When("I confirm deletion on deletion dialog", () => { management.clickOnConfirmInToolUsageDialog(); }); -When("I enter {string} in required custom parameter input field schoolParam", (value) => { - management.fillInCustomParameter(value); +When("I enter {string} in required custom parameter input field {string}", (value, paramName) => { + management.fillInCustomParameter(paramName, value); }); -When("I enter {string} in optional custom parameter input field schoolParam", (value) => { - management.fillInCustomParameter(value); +When("I enter {string} in optional custom parameter input field {string}", (value, paramName) => { + management.fillInCustomParameter(paramName, value); }); When("I insert the external tool link {string}", (toolLink) => { management.insertToolLink(toolLink); }); -Then("I see configuration {string} is filled below with {string}", (key, value) => { +Then("I see configuration {string} is filled below with {string}", (key, value) =>{ management.checkConfiguration(key, value); -}); +}) -Then( - "I see the tool {string} in external tools table has no context restriction", - (toolName) => { - management.seeToolHasNoContextRestriction(toolName); - } -); +Then("I see the tool {string} in external tools table has no context restriction", (toolName) =>{ + management.seeToolHasNoContextRestriction(toolName); +}) -Then( - "I see the tool {string} in external tools table has context restriction {string}", - (toolName, contextRestriction) => { - management.seeToolHasContextRestriction(toolName, contextRestriction); - } -); +Then("I see the tool {string} in external tools table has context restriction {string}", (toolName, contextRestriction) =>{ + management.seeToolHasContextRestriction(toolName,contextRestriction); +})