diff --git a/test/cucumber/steps/XMLImportSteps.groovy b/test/cucumber/steps/XMLImportSteps.groovy index 61204034..f7b8ae40 100644 --- a/test/cucumber/steps/XMLImportSteps.groovy +++ b/test/cucumber/steps/XMLImportSteps.groovy @@ -187,3 +187,12 @@ And(~'^no new orientation entitled "([^"]*)" is stored by the system$') { String assert orientation == null } +When(~'^I click on "upload" informing the tolerance level$') { -> + page.setToleranceValue(10) + page.uploadClick() +} + +Then(~'^the system outputs a successful message$') { -> + //se for um erro a mensagem é colocada em readErrorMessage + assert page.readFlashMessage() != null +} \ No newline at end of file diff --git a/test/functional/pages/XMLImportPage.groovy b/test/functional/pages/XMLImportPage.groovy index bf3cf6f1..4137146b 100644 --- a/test/functional/pages/XMLImportPage.groovy +++ b/test/functional/pages/XMLImportPage.groovy @@ -22,8 +22,17 @@ class XMLImportPage extends Page { } static content = { - readFlashMessage(){ $("div .message").text() } - readErrorsMessage() { $("div.errors").text() } + //readFlashMessage(){ $("div .message").text() } + //readErrorsMessage() { $("div.errors").text() } + } + + String readFlashMessage(){ + String str = $("div .message").text().toString() + return str + } + + String readErrorsMessage() { + return $("div .errors").text() } def selectButton(String name) { @@ -45,4 +54,8 @@ class XMLImportPage extends Page { boolean isRequiredEnabledOnToleranceSelect(){ return $("#toleranceSelect").getAttribute("required") } + + def setToleranceValue(int value) { + $("#toleranceSelect").value(value) + } }