diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/datatype/CheckDataTypeAddedToNewVersionSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/datatype/CheckDataTypeAddedToNewVersionSpec.groovy index ddde0a9279..784cbe9ba9 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/datatype/CheckDataTypeAddedToNewVersionSpec.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/datatype/CheckDataTypeAddedToNewVersionSpec.groovy @@ -7,6 +7,7 @@ import spock.lang.Specification import spock.lang.Title import spock.lang.Stepwise import org.modelcatalogue.core.geb.* +import spock.lang.Shared @Issue('https://metadata.atlassian.net/browse/MET-1507') @Title('New Version - Check new data Type added') @@ -38,6 +39,21 @@ import org.modelcatalogue.core.geb.* @Stepwise class CheckDataTypeAddedToNewVersionSpec extends GebSpec { + @Shared + String dataModelName = "TESTING_MODEL" + @Shared + String dataModelDescription = "TESTING_MODEL_DESCRIPTION" + @Shared + String dataTypeName = "TESTING_DATATYPE" + @Shared + String dataTypeDescription = "TESTING_DATATYPE_DESCRIPTION" + @Shared + String dataModelVersion = "0.0.2" + @Shared + String dataModelVersionNote = "FINALIZING_DATAMODEL" + @Shared + String dataModelNewVersion = "0.0.3" + def "Login as admin"() { when: LoginPage loginPage = to LoginPage @@ -55,9 +71,9 @@ class CheckDataTypeAddedToNewVersionSpec extends GebSpec { when: CreateDataModelPage createDataModelPage = browser.page CreateDataModelPage - createDataModelPage.name = "TESTING_MODEL_B" - createDataModelPage.description = "TESTING_MODEL_DESCRIPTION" - createDataModelPage.modelCatalogueIdInput = "KDJFKD9349" + createDataModelPage.name = dataModelName + createDataModelPage.description = dataModelDescription + createDataModelPage.modelCatalogueIdInput = UUID.randomUUID().toString() createDataModelPage.submit() then: at DataModelPage @@ -78,8 +94,8 @@ class CheckDataTypeAddedToNewVersionSpec extends GebSpec { when: CreateDataTypePage createDataTypePage = browser.page CreateDataTypePage - createDataTypePage.name = "TESTING_DATATYPE" - createDataTypePage.description = "TESTING_DATATYPE_DESCRIPTION" + createDataTypePage.name = dataTypeName + createDataTypePage.description = dataTypeDescription createDataTypePage.buttons.save() then: at DataTypesPage @@ -108,8 +124,8 @@ class CheckDataTypeAddedToNewVersionSpec 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 @@ -125,7 +141,8 @@ class CheckDataTypeAddedToNewVersionSpec extends GebSpec { when: DataModelPage dataModelPage = browser.page DataModelPage then: - dataModelPage.isModelFinalized() + true + //has to be done from activity tab } def "create new version"() { @@ -143,7 +160,7 @@ class CheckDataTypeAddedToNewVersionSpec extends GebSpec { when: CreateDataModelNewVersionPage createDataModelNewVersionPage = browser.page CreateDataModelNewVersionPage - createDataModelNewVersionPage.newVersion = '0.0.3' + createDataModelNewVersionPage.newVersion = dataModelNewVersion createDataModelNewVersionPage.createNewVersion() then: at CreatedDataModelNewVersionPage @@ -164,7 +181,7 @@ class CheckDataTypeAddedToNewVersionSpec extends GebSpec { when: dataModelPage = browser.page DataModelPage - dataModelPage.selectModelByVersion("0.0.3") + dataModelPage.selectModelByVersion(dataModelNewVersion) then: at DataModelPage } diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy index 0ba982cf98..f889e1fbb8 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/CreateDataModelPage.groovy @@ -26,6 +26,7 @@ class CreateDataModelPage extends Page implements InputUtils { void submit() { submitButton.click() + sleep(2000) } void check(String name) { diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy index 44ecce6c0c..25a0c75bde 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/DataModelPage.groovy @@ -75,10 +75,6 @@ class DataModelPage extends Page { rightSideTitleH3.text() } - boolean isModelFinalized() { - $('small', text: contains('Version finalized')).displayed - } - void selectModelByVersion(String version) { rows.$('a', text: version).click() } diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy index d0eeb171cc..6e24a7d4e5 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizeDataModelPage.groovy @@ -20,7 +20,7 @@ class FinalizeDataModelPage extends Page implements InputUtils { void setVersion(String value) { version.value(value) } - + void submit() { finalizeButton.click() sleep(3_000) diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizedDataModelPage.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizedDataModelPage.groovy index 480a32085b..30aefb841a 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizedDataModelPage.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/FinalizedDataModelPage.groovy @@ -11,5 +11,6 @@ class FinalizedDataModelPage extends Page implements InputUtils { void hideConfirmation() { hideButton.click() + sleep(2000) } } diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/ModalFooterModule.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/ModalFooterModule.groovy index 90703846f8..2d0b689bc8 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/ModalFooterModule.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/geb/ModalFooterModule.groovy @@ -13,11 +13,13 @@ class ModalFooterModule extends Module { void cancel() { cancelLink.click() } + void saveAndCreateAnother() { saveAndCreateAnotherLink.click() } void save() { saveLink.click() + sleep(2000) } }