Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement VerifyCuratorCannotDeleteFinalizedDataModelSpec #1248

Merged
merged 5 commits into from
May 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ModelCatalogueCorePluginTestApp/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CreateDataModelPage extends Page implements InputUtils {
}

void setDescription(String value) {
fillInput(modelCatalogueIdInput, value)
fillInput(descriptionTextArea, value)
}

void removeTag() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
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
import spock.lang.Stepwise
import spock.lang.Shared
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')
@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
''')
@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
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 = dataModelName
createDataModelPage.description = dataModelDescription
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 = dataModelVersion
finalizeDataModelPage.versionNote = dataModelVersionNote
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)
}
}
Original file line number Diff line number Diff line change
@@ -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 {
}