From 5b6386cfca34afa3b642c59523284dab0b05e988 Mon Sep 17 00:00:00 2001 From: Victor Frunze Date: Mon, 16 Dec 2024 15:30:18 +0200 Subject: [PATCH] MWB-904: fix tests --- .../frontend/cypress/e2e/activities.feature | 9 ++++++--- mapping_workbench/frontend/cypress/e2e/cleanUp.feature | 1 + mapping_workbench/frontend/cypress/e2e/common/common.js | 3 +++ .../frontend/cypress/e2e/mappingPackages.feature | 5 +++-- .../frontend/cypress/e2e/mappingPackagesStates.feature | 9 +++++---- .../frontend/cypress/e2e/ontologyNamespaces.feature | 4 ++++ .../e2e/ontologyNamespaces/ontologyNamespacesSteps.js | 2 +- .../frontend/cypress/e2e/ontologyTerms.feature | 1 + mapping_workbench/frontend/cypress/e2e/projects.feature | 4 ++++ .../frontend/cypress/e2e/shaclTestSuites.feature | 2 ++ .../frontend/cypress/e2e/sparqlTestSuites.feature | 2 ++ .../frontend/cypress/e2e/testDataSuites.feature | 2 ++ .../frontend/cypress/e2e/tripleMapFragments.feature | 2 ++ .../frontend/cypress/e2e/valueMappingResources.feature | 2 ++ .../frontend/src/components/menu-actions.js | 3 ++- 15 files changed, 40 insertions(+), 11 deletions(-) diff --git a/mapping_workbench/frontend/cypress/e2e/activities.feature b/mapping_workbench/frontend/cypress/e2e/activities.feature index 18e057669..78350ec31 100644 --- a/mapping_workbench/frontend/cypress/e2e/activities.feature +++ b/mapping_workbench/frontend/cypress/e2e/activities.feature @@ -5,9 +5,9 @@ Feature: Activities Background: Given Session Login Then Go Home - Then I open side menu Scenario: Import Packages + When I open side menu Then I go to Mapping Packages Then I get redirected to Mapping Packages list page When I click on Mapping Packages import @@ -16,12 +16,13 @@ Feature: Activities Then I get success upload Scenario: View Activities + When I open side menu Then I go to Activities page Then I get redirected to Tasks page Then I receive Tasks - Scenario: Refresh Activities + When I open side menu Then I go to Activities page Then I get redirected to Tasks page Then I receive Tasks @@ -29,14 +30,16 @@ Feature: Activities Then I receive Tasks Scenario: Delete Activity + When I open side menu Then I go to Activities page Then I get redirected to Tasks page Then I receive Tasks + When I open actions menu When I delete Task Then I get success delete - Scenario: Delete all Activities + When I open side menu Then I go to Activities page Then I get redirected to Tasks page Then I receive Tasks diff --git a/mapping_workbench/frontend/cypress/e2e/cleanUp.feature b/mapping_workbench/frontend/cypress/e2e/cleanUp.feature index dd0eb846d..adf6f1ead 100644 --- a/mapping_workbench/frontend/cypress/e2e/cleanUp.feature +++ b/mapping_workbench/frontend/cypress/e2e/cleanUp.feature @@ -12,6 +12,7 @@ Feature: CleanUp after test Then I get redirected to projects list page Then I type project name + When I open actions menu When I click on delete button Then I click yes button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/common/common.js b/mapping_workbench/frontend/cypress/e2e/common/common.js index 45f27a8db..020800756 100644 --- a/mapping_workbench/frontend/cypress/e2e/common/common.js +++ b/mapping_workbench/frontend/cypress/e2e/common/common.js @@ -34,6 +34,9 @@ When('I select project', () => { cy.get('#project_switch').click().get('ul > li > p').contains('TEST_PROJECT').click() }) +When('I open actions menu',() => { + cy.get('#actions-menu-button').click() +}) Then('I expand tasks', () => { cy.get('#nav_tasks').click() diff --git a/mapping_workbench/frontend/cypress/e2e/mappingPackages.feature b/mapping_workbench/frontend/cypress/e2e/mappingPackages.feature index 8ad47f590..3158d24c0 100644 --- a/mapping_workbench/frontend/cypress/e2e/mappingPackages.feature +++ b/mapping_workbench/frontend/cypress/e2e/mappingPackages.feature @@ -15,7 +15,7 @@ Feature: Mapping Packages Then I click on upload button Then I get success upload - Scenario: View Pacakges + Scenario: View Packages Then I receive Mapping Packages When I expand first package details @@ -26,9 +26,9 @@ Feature: Mapping Packages Then I click on submit button Then I get success create - Scenario: Update Package Then I search for Mapping Package + When I open actions menu Then I edit Mapping Package Then I update name Then I click on submit button @@ -36,6 +36,7 @@ Feature: Mapping Packages Scenario: Delete Package Then I search for updated Mapping Package + When I open actions menu When I delete Mapping Package Then I click yes Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/mappingPackagesStates.feature b/mapping_workbench/frontend/cypress/e2e/mappingPackagesStates.feature index 7084de818..d2fac1077 100644 --- a/mapping_workbench/frontend/cypress/e2e/mappingPackagesStates.feature +++ b/mapping_workbench/frontend/cypress/e2e/mappingPackagesStates.feature @@ -9,6 +9,7 @@ Feature: Mapping Packages States Then I go to Mapping Packages Then I get redirected to Mapping Packages list page Then I search for Mapping Package + When I open actions menu Then I click on View Last State Then I receive Mapping Packages State @@ -20,7 +21,7 @@ Feature: Mapping Packages States Then I click on "" Data Then I receive Mapping Packages Test "" Examples: - | tab_name | - | Xpath | - | Sparql | - | Shacl | \ No newline at end of file + | tab_name | + | Xpath | + | Sparql | + | Shacl | \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces.feature b/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces.feature index 5e23fec75..d2012aa3d 100644 --- a/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces.feature +++ b/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces.feature @@ -16,6 +16,7 @@ Feature: Namespaces Scenario: Update Namespace Then I search for Namespaces + When I open actions menu Then I click edit Namespace button Then I get redirected to edit page @@ -24,6 +25,7 @@ Feature: Namespaces Scenario: Delete Namespace Then I search for updated Namespace + When I open actions menu Then I click delete Namespace button Then I get success delete @@ -34,6 +36,8 @@ Feature: Namespaces Then I successfully create Namespace Scenario: Delete Custom Namespace Ontology + Then I search for updated Namespace Then I search for Custom Namespaces + When I open actions menu Then I click delete Custom Namespace button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces/ontologyNamespacesSteps.js b/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces/ontologyNamespacesSteps.js index 91be77baa..168c70cd1 100644 --- a/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces/ontologyNamespacesSteps.js +++ b/mapping_workbench/frontend/cypress/e2e/ontologyNamespaces/ontologyNamespacesSteps.js @@ -112,7 +112,7 @@ Then('I search for Custom Namespaces', () => { Then('I click delete Custom Namespace button', () => { cy.intercept('DELETE', appURLPrefix + 'ontology/namespaces_custom/*').as('delete') - cy.get('#ontology_namespaces_custom #delete_button').click() + cy.get('#delete_button').click() cy.get('#yes_dialog_button').click() }) diff --git a/mapping_workbench/frontend/cypress/e2e/ontologyTerms.feature b/mapping_workbench/frontend/cypress/e2e/ontologyTerms.feature index 80f281d85..94a20036f 100644 --- a/mapping_workbench/frontend/cypress/e2e/ontologyTerms.feature +++ b/mapping_workbench/frontend/cypress/e2e/ontologyTerms.feature @@ -20,5 +20,6 @@ Feature: Ontology Terms Scenario: Delete Ontology Term Then I search for Ontology Terms + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/projects.feature b/mapping_workbench/frontend/cypress/e2e/projects.feature index 72f277625..854e9ac15 100644 --- a/mapping_workbench/frontend/cypress/e2e/projects.feature +++ b/mapping_workbench/frontend/cypress/e2e/projects.feature @@ -22,6 +22,7 @@ Feature: Entry Projects Then I get redirected to projects list page Then I search for project + When I open actions menu When I select project Then I get success select @@ -33,6 +34,7 @@ Feature: Entry Projects Then I get redirected to projects list page Then I search for project + When I open actions menu When I click on edit button Then I get redirected to project edit page Then I update project description @@ -48,6 +50,7 @@ Feature: Entry Projects Then I get redirected to projects list page Then I search for project + When I open actions menu When I click on view button Then I get redirected to project view page Then I read description @@ -61,6 +64,7 @@ Feature: Entry Projects Then I get redirected to projects list page Then I search for project + When I open actions menu When I click on delete button Then I click yes button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/shaclTestSuites.feature b/mapping_workbench/frontend/cypress/e2e/shaclTestSuites.feature index 705490d6d..611c35159 100644 --- a/mapping_workbench/frontend/cypress/e2e/shaclTestSuites.feature +++ b/mapping_workbench/frontend/cypress/e2e/shaclTestSuites.feature @@ -19,6 +19,7 @@ Feature: SHACL Test Suite Scenario: Update SHACL Test Suite Then I search for suite + When I open actions menu Then I click edit button Then I get redirected to edit page @@ -28,5 +29,6 @@ Feature: SHACL Test Suite Scenario: Delete SHACL Test Suite Then I search for updated suite + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/sparqlTestSuites.feature b/mapping_workbench/frontend/cypress/e2e/sparqlTestSuites.feature index a5fda81e4..ecefebc4c 100644 --- a/mapping_workbench/frontend/cypress/e2e/sparqlTestSuites.feature +++ b/mapping_workbench/frontend/cypress/e2e/sparqlTestSuites.feature @@ -18,6 +18,7 @@ Feature: SPARQL Test Suites Scenario: Update SPARQL Test Suite Then I search for suite + When I open actions menu Then I click edit button Then I get redirected to edit page @@ -27,5 +28,6 @@ Feature: SPARQL Test Suites Scenario: Delete SPARQL Test Suite Then I search for updated suite + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/testDataSuites.feature b/mapping_workbench/frontend/cypress/e2e/testDataSuites.feature index 40b84f5b9..1988b1dd4 100644 --- a/mapping_workbench/frontend/cypress/e2e/testDataSuites.feature +++ b/mapping_workbench/frontend/cypress/e2e/testDataSuites.feature @@ -16,6 +16,7 @@ Feature: Test Data Suites Scenario: Update Test Data Then I search for suite + When I open actions menu Then I click view button Then I click edit button Then I get redirected to edit page @@ -25,5 +26,6 @@ Feature: Test Data Suites Scenario: Delete Test Data Then I search for updated suite + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/tripleMapFragments.feature b/mapping_workbench/frontend/cypress/e2e/tripleMapFragments.feature index 793c8df94..b829dca4f 100644 --- a/mapping_workbench/frontend/cypress/e2e/tripleMapFragments.feature +++ b/mapping_workbench/frontend/cypress/e2e/tripleMapFragments.feature @@ -20,6 +20,7 @@ Feature: Generic Triple Maps Then I get redirected to Generic Triple Maps Then I search for Generic Triple Map + When I open actions menu Then I click edit button Then I get redirected to edit page @@ -31,5 +32,6 @@ Feature: Generic Triple Maps Then I get redirected to Generic Triple Maps Then I search for updated Generic Triple Map + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/cypress/e2e/valueMappingResources.feature b/mapping_workbench/frontend/cypress/e2e/valueMappingResources.feature index 9104be6b4..22ac9197b 100644 --- a/mapping_workbench/frontend/cypress/e2e/valueMappingResources.feature +++ b/mapping_workbench/frontend/cypress/e2e/valueMappingResources.feature @@ -20,6 +20,7 @@ Feature: Resources Then I get redirected to Resources Then I search for resource + When I open actions menu Then I click edit button Then I get redirected to edit page @@ -31,5 +32,6 @@ Feature: Resources Then I get redirected to Resources Then I search for updated resource + When I open actions menu Then I click delete button Then I get success delete \ No newline at end of file diff --git a/mapping_workbench/frontend/src/components/menu-actions.js b/mapping_workbench/frontend/src/components/menu-actions.js index 03eb8240d..4d65c8df1 100644 --- a/mapping_workbench/frontend/src/components/menu-actions.js +++ b/mapping_workbench/frontend/src/components/menu-actions.js @@ -14,7 +14,8 @@ export const MenuActions = ({children}) => { const [anchor, setAnchor] = useState(null) return <> - setAnchor(e.target)}> + setAnchor(e.target)}>