From 379449a1a032b22ae3d01b8e6777ea0378a63cec Mon Sep 17 00:00:00 2001 From: johncross Date: Mon, 30 Apr 2018 11:35:06 +0100 Subject: [PATCH 1/5] Sets the app.version to T2.3.1 --- ModelCatalogueCorePluginTestApp/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModelCatalogueCorePluginTestApp/application.properties b/ModelCatalogueCorePluginTestApp/application.properties index 35568a130d..c743c7e79b 100644 --- a/ModelCatalogueCorePluginTestApp/application.properties +++ b/ModelCatalogueCorePluginTestApp/application.properties @@ -3,4 +3,4 @@ app.grails.version=2.5.6 app.name=ModelCatalogueCorePluginTestApp app.servlet.version=3.0 -app.version=T.2.3.0.11 +app.version=T2.3.1 From f97c3ec103d234115e1c921815227169ff0501d1 Mon Sep 17 00:00:00 2001 From: johncross Date: Mon, 30 Apr 2018 12:39:49 +0100 Subject: [PATCH 2/5] See: #1235 --- ...fyViewerCannotAccessFactActionsSpec.groovy | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyViewerCannotAccessFactActionsSpec.groovy diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyViewerCannotAccessFactActionsSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyViewerCannotAccessFactActionsSpec.groovy new file mode 100644 index 0000000000..b59aea152b --- /dev/null +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyViewerCannotAccessFactActionsSpec.groovy @@ -0,0 +1,27 @@ +package org.modelcatalogue.core.rolevisibility + +import geb.spock.GebSpec +import spock.lang.Issue +import spock.lang.Narrative +import spock.lang.Specification +import spock.lang.Title + +@Issue('https://metadata.atlassian.net/browse/MET-1959') +@Title('Verify that the viewer does not have access to Fast Actions(Imports)') +@Narrative(''' + - Login to Metadata Exchange As Supervisor | Login successful + - Select Settings menu button from right-hand top menu | Settings menu Drop-down appears. + - Select Users from the Settings drop-down menu | Redirected to the backend page with title 'Spring Security Management Console' with a User Search box present. + - In the form box titled 'Username' type the name of User X (that has a User role) and press the search button | A list appears under the User Search box with results + - Select User X's name from the list of results | Taken to page with 'Edit User' title. User details are shown + - Select the tab titled 'Roles' next to 'User Details' | User Roles are shown + - Verify that User X only has ROLE_USER ticked | Verified that User X has a role of user and nothing more + - Log out of Metadata Exchange | Log out successful + - Login to Metadata Exchange As User X | Login successful + - On the top right hand-menu, Select the Settings menu Button | Settings menu drop-down appears + - Verify that the only options on the settings menu drop down are: Code Version, Relationship Types, Data Model Policies and Feedbacks | Options for Settings menu drop down are limited to: Code Version, Relationship Types, Data Model Policies and Feedbacks + - Logout of the Metadata Exchange | Logout successful +''') + +class VerifyViewerCannotAccessFactActionsSpec extends GebSpec { +} From 9410e9896089a28b3e59bc3c34e0d05e464b4a6b Mon Sep 17 00:00:00 2001 From: johncross Date: Mon, 30 Apr 2018 13:09:24 +0100 Subject: [PATCH 3/5] See: #1236 --- ...rCannotDeleteFinalizedDataModelSpec.groovy | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy new file mode 100644 index 0000000000..8b1166dbd5 --- /dev/null +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy @@ -0,0 +1,24 @@ +package org.modelcatalogue.core.rolevisibility + +import geb.spock.GebSpec +import spock.lang.Issue +import spock.lang.Narrative +import spock.lang.Specification +import spock.lang.Title + +@Issue('https://metadata.atlassian.net/browse/MET-1441') +@Title('Verify that a curator is not able to delete a finalized Data Model after creation') +@Narrative(''' + - Login to Metadata Exchange as Curator | Login Successful + - Click on 'Create New Data Model' button ( plus sign) in the top-right hand menu | Redirected to the 'Create New Data Model' page + - Fill in Name, Catalogue Id, Description, and press save | Data Model is created. Redirected to main page of new data model + - Navigate to the top left hand menu and click on the Data Model menu button | Data Model menu drop-down appears + - Scroll down and select option 'finalize' | The 'Finalize Data Model' pop-up dialogue box appears + - Fill in the semantic version number and the revision notes. Click 'Finalize' button | Data Model is finalized. Redirected to the finalized data model main page + - On the top left hand menu, click on the data model button on the left hand top menu | Data Model menu drop-down appears + - If present, Click on the delete option to delete data model. | The delete option is disabled or absent + - The data model is not deleted +''') + +class VerifyCuratorCannotDeleteFinalizedDataModelSpec extends GebSpec { +} From b7f26a31781fb33624c68ed9e31e539bac09da8a Mon Sep 17 00:00:00 2001 From: Vijay Date: Tue, 1 May 2018 14:05:34 +0530 Subject: [PATCH 4/5] implement VerifyCuratorCannotDeleteFinalizedDataModel(#1236) --- .../core/geb/CreateDataModelPage.groovy | 2 +- .../core/geb/DataModelPage.groovy | 4 +- .../core/geb/FinalizeDataModelPage.groovy | 5 ++ ...rCannotDeleteFinalizedDataModelSpec.groovy | 74 ++++++++++++++++++- 4 files changed, 81 insertions(+), 4 deletions(-) diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy index 2c33847cbd..0ba982cf98 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy @@ -53,7 +53,7 @@ class CreateDataModelPage extends Page implements InputUtils { } void setDescription(String value) { - fillInput(modelCatalogueIdInput, value) + fillInput(descriptionTextArea, value) } void removeTag() { diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy index fe7e437cec..06139b9190 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy @@ -26,7 +26,9 @@ class DataModelPage extends Page { deleteButton(required: false) { $('#delete-menu-item-link', 0) } modalDialog(required: false) { $('.modal-dialog', 0).module(ModalDialogModule) } dropdownLink(wait: true, required: false) { $('a#role_item_catalogue-element-menu-item-link', 0) } - dropdownMenu(required: false) { $('#role_item_catalogue-element-menu-item-link').module(DataModelNavModule) } + dropdownMenu(required: false) { + $('#role_item_catalogue-element-menu-item-link').siblings('ul').module(DataModelNavModule) + } exportLink(required: false) { $('a#role_item_export-menu-item-link') } exportXMLLink(required: false) { $('a#catalogue-element-export-specific-reports_12-menu-item-link') } finalizedLink(required: false) { $("a#finalize-menu-item-link") } diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy index cd9255bb00..6e24a7d4e5 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy @@ -10,12 +10,17 @@ class FinalizeDataModelPage extends Page implements InputUtils { static content = { versionNoteTextarea { $('textarea#revisionNotes') } finalizeButton { $('a#role_modal_modal-finalize-data-modalBtn', 0) } + version { $('#semanticVersion') } } void setVersionNote(String value) { fillInput(versionNoteTextarea, value) } + void setVersion(String value) { + version.value(value) + } + void submit() { finalizeButton.click() sleep(3_000) diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy index 8b1166dbd5..aa4044bd34 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy @@ -5,6 +5,8 @@ import spock.lang.Issue import spock.lang.Narrative import spock.lang.Specification import spock.lang.Title +import spock.lang.Stepwise +import org.modelcatalogue.core.geb.* @Issue('https://metadata.atlassian.net/browse/MET-1441') @Title('Verify that a curator is not able to delete a finalized Data Model after creation') @@ -19,6 +21,74 @@ import spock.lang.Title - If present, Click on the delete option to delete data model. | The delete option is disabled or absent - The data model is not deleted ''') - +@Stepwise class VerifyCuratorCannotDeleteFinalizedDataModelSpec extends GebSpec { -} + + def "Login as curator"() { + when: + LoginPage loginPage = to LoginPage + loginPage.login("curator", "curator") + then: + at DashboardPage + } + + def "create a data model"() { + when: + DashboardPage dashboardPage = browser.page DashboardPage + dashboardPage.nav.createDataModel() + then: + at CreateDataModelPage + + when: + CreateDataModelPage createDataModelPage = browser.page CreateDataModelPage + createDataModelPage.name = "TESTING_MODES" + createDataModelPage.description = "TESTING_MODEL_DESCRIPTION" + createDataModelPage.modelCatalogueIdInput = UUID.randomUUID().toString() + createDataModelPage.submit() + then: + at DataModelPage + + } + + def "finalize the data model"() { + when: + DataModelPage dataModelPage = browser.page DataModelPage + dataModelPage.dropdown() + then: + at DataModelPage + + when: + dataModelPage = browser.page DataModelPage + dataModelPage.finalizedDataModel() + then: + at FinalizeDataModelPage + + when: + FinalizeDataModelPage finalizeDataModelPage = browser.page FinalizeDataModelPage + finalizeDataModelPage.version = "0.0.2" + finalizeDataModelPage.versionNote = "Version finalized" + finalizeDataModelPage.submit() + then: + at FinalizedDataModelPage + + when: + FinalizedDataModelPage finalizedDataModelPage = browser.page FinalizedDataModelPage + finalizedDataModelPage.hideConfirmation() + then: + at DataModelPage + } + + + def "is delete button present"() { + when: + DataModelPage dataModelPage = browser.page DataModelPage + dataModelPage.dropdown() + then: + at DataModelPage + + when: + dataModelPage = browser.page DataModelPage + then: + !dataModelPage.dropdownMenu.existsDelete(browser) + } +} \ No newline at end of file From 2174b93888be88277aa05b8fdde4b9093947b50d Mon Sep 17 00:00:00 2001 From: Vijay Date: Fri, 4 May 2018 11:46:37 +0530 Subject: [PATCH 5/5] code refactoring(#1236) --- ...orCannotDeleteFinalizedDataModelSpec.groovy | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy index aa4044bd34..e1594aa2c6 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/rolevisibility/VerifyCuratorCannotDeleteFinalizedDataModelSpec.groovy @@ -6,6 +6,7 @@ import spock.lang.Narrative import spock.lang.Specification import spock.lang.Title import spock.lang.Stepwise +import spock.lang.Shared import org.modelcatalogue.core.geb.* @Issue('https://metadata.atlassian.net/browse/MET-1441') @@ -24,6 +25,15 @@ import org.modelcatalogue.core.geb.* @Stepwise class VerifyCuratorCannotDeleteFinalizedDataModelSpec extends GebSpec { + @Shared + String dataModelName = "TESTING_MODEL" + @Shared + String dataModelDescription = "TESTING_MODEL_DESCRIPTION" + @Shared + String dataModelVersion = "0.0.2" + @Shared + String dataModelVersionNote = "Version finalized" + def "Login as curator"() { when: LoginPage loginPage = to LoginPage @@ -41,8 +51,8 @@ class VerifyCuratorCannotDeleteFinalizedDataModelSpec extends GebSpec { when: CreateDataModelPage createDataModelPage = browser.page CreateDataModelPage - createDataModelPage.name = "TESTING_MODES" - createDataModelPage.description = "TESTING_MODEL_DESCRIPTION" + createDataModelPage.name = dataModelName + createDataModelPage.description = dataModelDescription createDataModelPage.modelCatalogueIdInput = UUID.randomUUID().toString() createDataModelPage.submit() then: @@ -65,8 +75,8 @@ class VerifyCuratorCannotDeleteFinalizedDataModelSpec extends GebSpec { when: FinalizeDataModelPage finalizeDataModelPage = browser.page FinalizeDataModelPage - finalizeDataModelPage.version = "0.0.2" - finalizeDataModelPage.versionNote = "Version finalized" + finalizeDataModelPage.version = dataModelVersion + finalizeDataModelPage.versionNote = dataModelVersionNote finalizeDataModelPage.submit() then: at FinalizedDataModelPage