From a30719b8852534800d146165e1fea2bf239fe90b Mon Sep 17 00:00:00 2001 From: Samuel Romeiro Date: Mon, 16 Jun 2014 15:26:31 -0300 Subject: [PATCH 01/12] --- test/cucumber/Conferencia.feature | 15 ++--- test/cucumber/steps/ConferenciaSteps.groovy | 70 ++++++++++++++++++++- 2 files changed, 75 insertions(+), 10 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index 261dc9f4..3a98c51e 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -118,19 +118,16 @@ Scenario: Order conference web by research line When I click on the column "Research Line" at the conference list table then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order -Scenario: Go to search page - Given I am at the conference page - When I select the Search Conference option - Then I am at the search conference page + Scenario: Search for conference Given the system has conference entitled "IV Conference on Software Product Lines" When I search for the conferencia entitled "IV Conference on Software Product Lines" Then theres no change in the data stored by the system. -Scenario: Search for conference web by date - Given I am at the Seach Conference page - And the system has conference dated "2007" +Scenario: Search for conference web + Given I'm at the conference page + And the system has conference dated "2007" When I write "2007" at the date field - And I select the option Serach for Conference at the conference page - then a list of all conferences containing that date will be presented in the conference screen \ No newline at end of file + And I select the option Search for Conference at the conference page + then a list of all conferences containing the date "2007" will be presented in the conference screen diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index f11e0542..a61046bf 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -144,4 +144,72 @@ And(~'^the conferencias are not stored by the system$') {-> at ConferenciaPage page.checkIfConferenciaListIsEmpty() -} \ No newline at end of file +} + +//if(ConferenciaFeature) + +When(~'^I click on the column "Date" at the conferencia list table$') {-> + at ConferenciaPage + page.selectColumn("Date") //Método a ser criado +} + +Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {-> + at ConferenciaPage + page.listConferencia() + page.orderListConferencia("Date") //Método a ser criado +} + +When(~'^I click on the column "Research Line" at the conferencia list table$') {-> + at ConferenciaPage + page.selectColumn("Research Line") //Método a ser criado +} + +Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending alphabetic order$') {-> + at ConferenciaPage + page.listConferencia() + page.orderListConferencia("Research Line") //Método a ser criado +} + +When(~'^I select the search conferencia option at the conferencia page$') {-> + at ConferenciaPage //Página a ser criada + page.selectSearchConferencia() //Método a ser criado +} + +Then(~'^I am at the search conference page$') {-> + at ConferenciaSearchPage //Página a ser criada +} + +Given(~'^the system has conferencia entitled "([^"]*)"$') { String title -> + conferencia = Conferencia.findByTitle(title) + assert ConferenciaTestDataAndOperations.conferenciaCompatibleTo(conferencia, title) +} + +When(~'^I search for the conferencia "([^"]*)"$') { String title -> + ConferenciaTestDataAndOperations.searchConferencia(title) +} + +Then(~'^there is no change in the data stored by the system$') {-> + +} + + +Given(~'^The system has conference dated "([^"]*)"$') {String date-> + conferencia = Conferencia.findByDate(date) //Método a ser criado +} + +When(~'^I write "([^"]*)" at the date field$') {String date-> + at ConferenciaPage + page.fillDateField(date) //Método a ser criado +} + +When(~'^I select the option Search for Conference at the conference page$') {-> + at at ConferenciaPage + page.selectSearchConferencia() //Método a ser criado +} + +Then(~'^a list of all conferences containing the date "([^"]*)" will be presented in the conference screen$') { String date-> + at ConferenciaPage + page.FindByDate(date) //Método a ser criado +} + +//#End \ No newline at end of file From e2bd130dcad13a163b093741870d4b97cdf03f90 Mon Sep 17 00:00:00 2001 From: Micael Date: Tue, 17 Jun 2014 05:47:05 -0300 Subject: [PATCH 02/12] =?UTF-8?q?Altera=C3=A7=C3=A3o=20e=20corre=C3=A7?= =?UTF-8?q?=C3=B5es=20de=20cen=C3=A1rios=20cria=C3=A7=C3=A3o=20de=20passos?= =?UTF-8?q?=20de=20testes=20em=20"conferenciaSteps"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 29 ++-- test/cucumber/steps/ConferenciaSteps.groovy | 158 +++++++++++++++++++- 2 files changed, 169 insertions(+), 18 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index 261dc9f4..7858efac 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -79,14 +79,14 @@ Feature: conferencia And the conferencias are not stored by the system Scenario: edit existing conference - Given the system has conference entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" + Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" When I change the conference file from "SPLC.pdf" to "SPLC2.pdf" Then the conference "IV Conference on Software Product Lines" is properly updated by the system Scenario: edit existing conference web Given I am at the conference page - And the conference "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" - When I select to view "IV Conference on Software Product Lines" in resulting list + And the conference entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" + When I select to view the conference "IV Conference on Software Product Lines" in resulting list And I change the conference file to "SPLC2.pdf" And I select the "Alterar" option in Conference Registration Page And A success message is displayed @@ -101,36 +101,31 @@ Scenario: new invalid conference web (fields blank) Scenario: list existing conference Given the system has conference entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" When I view the conference list - Then my conference list contains "IV Conference on Software Product Lines" + Then the conference list contains "IV Conference on Software Product Lines" Scenario: Order conference web by title Given I am at the conference page When I click on the column "title" at the conference list table - then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order + Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order Scenario: Order conference web by conference data Given I am at the conference page When I click on the column "Date" at the conference list table - then a list of conferences stored by the system is displayed at the conference page by publication ascending date order + Then a list of conferences stored by the system is displayed at the conference page by publication ascending date order Scenario: Order conference web by research line Given I am at the conference page When I click on the column "Research Line" at the conference list table - then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order - -Scenario: Go to search page - Given I am at the conference page - When I select the Search Conference option - Then I am at the search conference page + Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order Scenario: Search for conference Given the system has conference entitled "IV Conference on Software Product Lines" When I search for the conferencia entitled "IV Conference on Software Product Lines" Then theres no change in the data stored by the system. -Scenario: Search for conference web by date - Given I am at the Seach Conference page - And the system has conference dated "2007" +Scenario: Search for conference web + Given I am at the conference page + And the system has conference dated "2007" When I write "2007" at the date field - And I select the option Serach for Conference at the conference page - then a list of all conferences containing that date will be presented in the conference screen \ No newline at end of file + And I select the option Search for Conference at the conference page + Then a list of all conferences containing the date "2007" will be presented in the conference screen diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index f11e0542..65c30685 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -15,6 +15,86 @@ Given(~'^the system has no conferencia entitled "([^"]*)"$') { String title -> conferencia = Conferencia.findByTitle(title) assert conferencia == null } +//#if(ConferenciaFeature) +Given(~'^the system has conference entitled "([^"]*)" with a file name "([^"]*)"$') { String title -> + conferencia = Conferencia.findByTitle(title) + assert conferencia != null +} +//#end + +//#if(ConferenciaFeature) + When(~'^I change the conference file from "([^"]*)" to "([^"]*)"$') { String filename -> + ConferenciaTestDataAndOperations.editConferencia(filename) +} +//#end + +//#if(ConferenciaFeature) + And(~'^I change the conferencia file to "([^"]*)"$') { String newarchive -> + page.select('a', 'edit') + at ConferenceEditPage + def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator + page.edit(path + newarchive) +} +//#end + +//#if(ConferenciaFeature) + Given(~'^I am at the conference page$') {-> + at ConferenciaPage +} +//#end + +//#if(ConferenciaFeature) +And(~'^the conferencia entitled "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> + ConferenciaTestDataAndOperations.createConferencia(title, filename) + conferencia = Conferencia.findByTitle(title) + assert conferencia != null +} +//#end + +//#if(ConferenciaFeature) +When(~'^I select to view the conference "([^"]*)" in resulting list$') { String title -> + page.selectViewConference(title) + at ConferenceShowPage +} +//#end + +//#if(ConferenciaFeature) +And(~'^I change the conference file to "([^"]*)"$') { String newfile -> + // page.select('a', 'edit') + // at ArticleEditPage + def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator + page.edit(path + newfile) +} +//#end + +//#if(ConferenciaFeature) +And(~'^I select the "Alterar" option in Conference Registration Page$') { String newfile -> + page.select('a', 'edit') + at ConferenciaEditPage +} +//#end + +//#if(ConferenciaFeature) +Given(~'^I am at the conference registration page$') { + at ConferenciaEditPage +} +//#end + +//#if(ConferenciaFeature) +Then(~'^the conference is not stored by the system because it is invalid$') { + finalSize = Conferencia.findAll().size() + assert initialSize == finalSize +} +//#end + +//#if(ConferenciaFeature) +When(~'^I create the conference with some field blank$') { + at ConferenciaCreatePage + page.fillConferenciaDetailsPartially() + assert page.isSomeConferenciaFildsBlank() +} +//#end + When(~'^I create the conferencia "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> ConferenciaTestDataAndOperations.createConferencia(title, filename) @@ -144,4 +224,80 @@ And(~'^the conferencias are not stored by the system$') {-> at ConferenciaPage page.checkIfConferenciaListIsEmpty() -} \ No newline at end of file +} + +//#if(ConferenciaFeature) +When(~'^I click on the column "Date" at the conferencia list table$') {-> + at ConferenciaPage + page.selectColumn("Date") +} +//#end + +//#if(ConferenciaFeature) +Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {-> + at ConferenciaPage + page.listConferencia() + page.orderListConferencia("Date") +} +//#end + +//#if(ConferenciaFeature) +When(~'^I click on the column "Research Line" at the conferencia list table$') {-> + at ConferenciaPage + page.selectColumn("Research Line") +} +//#end + +//#if(ConferenciaFeature) +Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending alphabetic order$') {-> + at ConferenciaPage + page.listConferencia() + page.orderListConferencia("Research Line") +} +//#end + +//#if(ConferenciaFeature) +When(~'^I select the search conferencia option at the conferencia page$') {-> + at ConferenciaPage + page.selectSearchConferencia() +} +//#end + +//#if(ConferenciaFeature) +When(~'^I search for the conferencia "([^"]*)"$') { String title -> + ConferenciaTestDataAndOperations.searchConferencia(title) +} +//#end + +//#if(ConferenciaFeature) +Then(~'^there is no change in the data stored by the system$') { + +} +//#end + +//#if(ConferenciaFeature) +And(~'^The system has conference dated "([^"]*)"$') {String date-> + conferencia = Conferencia.findByDate(date) +} +//#end + +//#if(ConferenciaFeature) +When(~'^I write "([^"]*)" at the date field$') {String date-> + at ConferenciaPage + page.fillDateField(date) +} +//#end + +//#if(ConferenciaFeature) +When(~'^I select the option Search for Conference at the conference page$') {-> + at at ConferenciaPage + page.selectSearchConferencia() +} +//#end + +//#if(ConferenciaFeature) +Then(~'^a list of all conferences containing the date "([^"]*)" will be presented in the conference screen$') { String date-> + at ConferenciaPage + page.FindByDate(date) +} +//#end \ No newline at end of file From 49b67f75808a29ce08858e231be441660dcda0c3 Mon Sep 17 00:00:00 2001 From: Samuel Romeiro Date: Tue, 8 Jul 2014 19:48:23 -0300 Subject: [PATCH 03/12] =?UTF-8?q?Altera=C3=A7=C3=B5es=20no=20arquivo=20con?= =?UTF-8?q?ferencia.feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 93 ++++++++++++++++--------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index 997445d0..22cc4558 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -78,54 +78,55 @@ Feature: conferencia Then I'm still on conferencia page And the conferencias are not stored by the system - Scenario: edit existing conference + Scenario: edit existing conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I change the conference file from "SPLC.pdf" to "SPLC2.pdf" - Then the conference "IV Conference on Software Product Lines" is properly updated by the system - -Scenario: edit existing conference web - Given I am at the conference page - And the conference entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" - When I select to view the conference "IV Conference on Software Product Lines" in resulting list - And I change the conference file to "SPLC2.pdf" - And I select the "Alterar" option in Conference Registration Page + When I change the conferencia file from "SPLC.pdf" to "SPLC2.pdf" + Then the conferencia "IV Conference on Software Product Lines" is properly updated by the system + +Scenario: edit existing conferencia web + Given I am at the conferencia page + And the conferencia entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" + When I select to view the conferencia "IV Conference on Software Product Lines" in resulting list + And I change the conferencia file to "SPLC2.pdf" + And I select the "Alterar" option in Conferencia Registration Page And A success message is displayed - Then I am at Conference page - -Scenario: new invalid conference web (fields blank) - Given I am at the conference registration page - When I create the conference with some field blank - Then the conference is not stored by the system because it is invalid - And an error menssage is displayed - -Scenario: list existing conference - Given the system has conference entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I view the conference list - Then the conference list contains "IV Conference on Software Product Lines" - -Scenario: Order conference web by title - Given I am at the conference page - When I click on the column "title" at the conference list table - Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order - -Scenario: Order conference web by conference data - Given I am at the conference page - When I click on the column "Date" at the conference list table - Then a list of conferences stored by the system is displayed at the conference page by publication ascending date order - -Scenario: Order conference web by research line - Given I am at the conference page - When I click on the column "Research Line" at the conference list table - Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order - -Scenario: Search for conference - Given the system has conference entitled "IV Conference on Software Product Lines" + Then I am at Conferencia page + +Scenario: new invalid conferencia web (fields blank) + Given I am at the conferencia registration page + When I create the conferencia with some field blank + Then the conferencia is not stored by the system because it is invalid + And an error message is displayed + +Scenario: list existing conferencia + Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" + When I view the conferencia list + Then the conferencia list contains "IV Conference on Software Product Lines" + +Scenario: Order conferencia web by title + Given I am at the conferencia page + When I click on the column "title" at the conferencia list table + Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order + +Scenario: Order conferencia web by conferencia data + Given I am at the conferencia page + When I click on the column "Date" at the conferencia list table + Then a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order + +Scenario: Order conferencia web by research line + Given I am at the conferencia page + When I click on the column "Research Line" at the conferencia list table + Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order + +Scenario: Search for conferencia + Given the system has conferencia entitled "IV Conference on Software Product Lines" + Given the system has conferencia entitled "IV Conference on Software Product Lines" When I search for the conferencia entitled "IV Conference on Software Product Lines" - Then theres no change in the data stored by the system. + Then theres no change in the data stored by the system -Scenario: Search for conference web - Given I am at the conference page - And the system has conference dated "2007" +Scenario: Search for conferencia web + Given I am at the conferencia page + And the system has conferencia dated "2007" When I write "2007" at the date field - And I select the option Search for Conference at the conference page - Then a list of all conferences containing the date "2007" will be presented in the conference screen + And I select the option Search for conferencia at the conferencia page + Then a list of all conferencias containing the date "2007" will be presented in the conferencia screen From 8346b53d9fe8b0f316ff6722f3f7f5c5c68f8e25 Mon Sep 17 00:00:00 2001 From: Micael Date: Sat, 12 Jul 2014 07:38:21 -0300 Subject: [PATCH 04/12] =?UTF-8?q?corre=C3=A7=C3=B5es=20efetuadas=20Revis?= =?UTF-8?q?=C3=A3o=20dos=20cen=C3=A1rios=20e=20passos=20das=20features=20i?= =?UTF-8?q?mplementa=C3=A7=C3=B5es=20de=20testes=20e=20p=C3=A1ginas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 18 ++-- test/cucumber/steps/ConferenciaSteps.groovy | 88 +++++++++++-------- .../Conferencia/ConferenciaCreatePage.groovy | 22 ++++- .../Conferencia/ConferenciaEditPage.groovy | 35 ++++++++ .../pages/Conferencia/ConferenciaPage.groovy | 17 ++++ .../ConferenciaTestDataAndOperations.groovy | 20 +++++ 6 files changed, 150 insertions(+), 50 deletions(-) create mode 100644 test/functional/pages/Conferencia/ConferenciaEditPage.groovy diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index 22cc4558..340f903e 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -30,7 +30,7 @@ Feature: conferencia Scenario: list conferencia web Given I am at the publications menu When I select the conferencia option at the publications menu - Then a list of conferencias stored by the system is displayed at the conferencia page by alphabetic order + Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order #if ($contextualInformation) @@ -80,14 +80,14 @@ Feature: conferencia Scenario: edit existing conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I change the conferencia file from "SPLC.pdf" to "SPLC2.pdf" - Then the conferencia "IV Conference on Software Product Lines" is properly updated by the system + When I change the conferencia title from "IV Conference on Software Product Lines" to "IV Conference on Software Product Lines REVIEWED" + Then the conferencia "IV Conference on Software Product Lines" is properly stored by the system Scenario: edit existing conferencia web Given I am at the conferencia page And the conferencia entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" When I select to view the conferencia "IV Conference on Software Product Lines" in resulting list - And I change the conferencia file to "SPLC2.pdf" + And I change the conferencia title to "IV Conference on Software Product Lines REVIEWED" And I select the "Alterar" option in Conferencia Registration Page And A success message is displayed Then I am at Conferencia page @@ -105,21 +105,15 @@ Scenario: list existing conferencia Scenario: Order conferencia web by title Given I am at the conferencia page - When I click on the column "title" at the conferencia list table + When I click on the column title at the conferencia list table Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order Scenario: Order conferencia web by conferencia data Given I am at the conferencia page - When I click on the column "Date" at the conferencia list table + When I click on the column date at the conferencia list table Then a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order -Scenario: Order conferencia web by research line - Given I am at the conferencia page - When I click on the column "Research Line" at the conferencia list table - Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order - Scenario: Search for conferencia - Given the system has conferencia entitled "IV Conference on Software Product Lines" Given the system has conferencia entitled "IV Conference on Software Product Lines" When I search for the conferencia entitled "IV Conference on Software Product Lines" Then theres no change in the data stored by the system diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 869a8bda..53c16fec 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -16,29 +16,29 @@ Given(~'^the system has no conferencia entitled "([^"]*)"$') { String title -> assert conferencia == null } //#if(ConferenciaFeature) -Given(~'^the system has conference entitled "([^"]*)" with a file name "([^"]*)"$') { String title -> +Given(~'^the system has conferencia entitled "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> + ConferenciaTestDataAndOperations.createConferencia(title, filename) conferencia = Conferencia.findByTitle(title) - assert conferencia != null + assert ConferenciaTestDataAndOperations.conferenciaCompatibleTo(conferencia, title) } //#end //#if(ConferenciaFeature) - When(~'^I change the conference file from "([^"]*)" to "([^"]*)"$') { String filename -> - ConferenciaTestDataAndOperations.editConferencia(filename) + When(~'^I change the conferencia title from "([^"]*)" to "([^"]*)"$') { String title -> + ConferenciaTestDataAndOperations.editConferencia(title) } //#end //#if(ConferenciaFeature) - And(~'^I change the conferencia file to "([^"]*)"$') { String newarchive -> + And(~'^I change the conferencia title to "([^"]*)"$') { String newtitle -> page.select('a', 'edit') at ConferenceEditPage - def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator - page.edit(path + newarchive) + page.edit(path + newtitle) } //#end //#if(ConferenciaFeature) - Given(~'^I am at the conference page$') {-> + Given(~'^I am at the conferencia page$') {-> at ConferenciaPage } //#end @@ -52,52 +52,46 @@ And(~'^the conferencia entitled "([^"]*)" is stored in the system with file name //#end //#if(ConferenciaFeature) -When(~'^I select to view the conference "([^"]*)" in resulting list$') { String title -> +When(~'^I select to view the conferencia "([^"]*)" in resulting list$') { String title -> page.selectViewConference(title) at ConferenceShowPage } //#end -//#if(ConferenciaFeature) -And(~'^I change the conference file to "([^"]*)"$') { String newfile -> - // page.select('a', 'edit') - // at ArticleEditPage - def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator - page.edit(path + newfile) -} -//#end //#if(ConferenciaFeature) -And(~'^I select the "Alterar" option in Conference Registration Page$') { String newfile -> +And(~'^I select the edit option in Conferencia Registration Page$') { String newfile -> page.select('a', 'edit') at ConferenciaEditPage } //#end //#if(ConferenciaFeature) -Given(~'^I am at the conference registration page$') { +Given(~'^I am at the conferencia registration page$') { at ConferenciaEditPage } //#end //#if(ConferenciaFeature) -Then(~'^the conference is not stored by the system because it is invalid$') { +Then(~'^the conferencia is not stored by the system because it is invalid$') { finalSize = Conferencia.findAll().size() assert initialSize == finalSize } //#end //#if(ConferenciaFeature) -When(~'^I create the conference with some field blank$') { +When(~'^I create the conferencia with some field blank$') { at ConferenciaCreatePage page.fillConferenciaDetailsPartially() - assert page.isSomeConferenciaFildsBlank() + assert page.isSomeConferenciaFildsBlank() == true } //#end When(~'^I create the conferencia "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> - ConferenciaTestDataAndOperations.createConferencia(title, filename) + ConferenciaTestDataAndOperations.createConferencia(title, filename) + conferencia = Conferencia.findByTitle(title) + assert conferencia != null } Then(~'^the conferencia "([^"]*)" is properly stored by the system$') { String title -> @@ -117,7 +111,11 @@ Then(~'^the conferencia "([^"]*)" is not stored twice$') { String title -> } When(~'^I remove the conferencia "([^"]*)"$') { String title -> + conferencia = Conferencia.findByTitle(title) + assert conferencia != null ConferenciaTestDataAndOperations.removeConferencia(title) + testRemoveConferencia = Conferencia.findByTitle(title) + assert testRemoveConferencia == null } Then(~'^the conferencia "([^"]*)" is properly removed by the system$') { String title -> @@ -227,7 +225,7 @@ And(~'^the conferencias are not stored by the system$') {-> } //#if(ConferenciaFeature) -When(~'^I click on the column "Date" at the conferencia list table$') {-> +When(~'^I click on the column date at the conferencia list table$') {-> at ConferenciaPage page.selectColumn("Date") } @@ -237,22 +235,29 @@ When(~'^I click on the column "Date" at the conferencia list table$') {-> Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {-> at ConferenciaPage page.listConferencia() - page.orderListConferencia("Date") + def conferencias = Conferencia.findAll() + conferencias.sort(it.date) } //#end +Given(~'^the system has conferencia entitled "([^"]*)"$') { String title -> + def conferencia = Conferencia.findByTitle(title) + assert conferencia != null +} + //#if(ConferenciaFeature) -When(~'^I click on the column "Research Line" at the conferencia list table$') {-> +When(~'^I click on the column title at the conferencia list table$') {-> at ConferenciaPage - page.selectColumn("Research Line") + page.selectColumn("Title") } //#end //#if(ConferenciaFeature) -Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending alphabetic order$') {-> +Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order$') {-> at ConferenciaPage page.listConferencia() - page.orderListConferencia("Research Line") + def conferencias = Conferencia.findAll() + conferencias.sort(it.title) } //#end @@ -264,20 +269,21 @@ When(~'^I select the search conferencia option at the conferencia page$') {-> //#end //#if(ConferenciaFeature) -When(~'^I search for the conferencia "([^"]*)"$') { String title -> - ConferenciaTestDataAndOperations.searchConferencia(title) +When(~'^I search for the conferencia entitled "([^"]*)"$') { String title -> + assert ConferenciaTestDataAndOperations.searchConferencia(title) } //#end //#if(ConferenciaFeature) -Then(~'^there is no change in the data stored by the system$') { +Then(~'^theres no change in the data stored by the system$') { } //#end //#if(ConferenciaFeature) -And(~'^The system has conference dated "([^"]*)"$') {String date-> +And(~'^the system has conferencia dated "([^"]*)"$') {String date-> conferencia = Conferencia.findByDate(date) + assert conferencia !=null } //#end @@ -289,15 +295,25 @@ When(~'^I write "([^"]*)" at the date field$') {String date-> //#end //#if(ConferenciaFeature) -When(~'^I select the option Search for Conference at the conference page$') {-> - at at ConferenciaPage +When(~'^I select the option Search for conferencia at the conferencia page$') {-> + at ConferenciaPage page.selectSearchConferencia() } //#end //#if(ConferenciaFeature) -Then(~'^a list of all conferences containing the date "([^"]*)" will be presented in the conference screen$') { String date-> +Then(~'^a list of all conferencias containing the date "([^"]*)" will be presented in the conferencia screen$') { String date-> at ConferenciaPage page.FindByDate(date) } //#end + +When(~'^I view the conferencia list$') {-> + def conferencias = Conferencia.findAll() + assert conferencias !=null +} + +Then(~'^the conferencia list contains "([^"]*)"$') {String title-> + def conferencia = Conferencia.findByTitle(title) + assert conferencia !=null +} diff --git a/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy b/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy index 613a2f05..ea706442 100644 --- a/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy +++ b/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy @@ -31,8 +31,26 @@ class ConferenciaCreatePage extends FormPage { $("form").title = "A theory of Software Product Line Refinement" $("form").create().click() } - - + + def fillConferenciaDetailsPartially(){ + $("form").title = null + $("form").booktitle = "Theoretical Computer Science" + $("form").pages = null + $("form").create().click() + } + + def boolean isSomeConferenciaFildsBlank(){ + def resp = false + if($("form").title == null || $("form").booktitle ==null || + $("form").pages == null){ + resp = true + } + return resp + } + + def selectedMembers() { + $("form").members + } def selectHome() { $('a.home').click() } diff --git a/test/functional/pages/Conferencia/ConferenciaEditPage.groovy b/test/functional/pages/Conferencia/ConferenciaEditPage.groovy new file mode 100644 index 00000000..6f1df60d --- /dev/null +++ b/test/functional/pages/Conferencia/ConferenciaEditPage.groovy @@ -0,0 +1,35 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package pages.Conferencia + +import geb.Page +import pages.GetPageTitle + +/** + * + * @author Micael + */ +class ConferenciaEditPage extends Page{ + + static at = { + GetPageTitle gp = new GetPageTitle() + def currentPeriodico = gp.msg("default.conferencia.label") + def currentTitle = gp.msg("default.edit.label", [currentPeriodico]) + + title ==~ currentTitle + } + + def edit(String newtitle) { + $("form").title = newtitle + assert $("form").name == new_name + } + + def select(String s) { + $("form").find("input", value: s).click() + } +} + diff --git a/test/functional/pages/Conferencia/ConferenciaPage.groovy b/test/functional/pages/Conferencia/ConferenciaPage.groovy index 5ed8c9d4..dffc470c 100644 --- a/test/functional/pages/Conferencia/ConferenciaPage.groovy +++ b/test/functional/pages/Conferencia/ConferenciaPage.groovy @@ -22,6 +22,23 @@ class ConferenciaPage extends Page{ $('a.list').click() } + def select(String s) { + $('div', id: 'status').find('a', text: s).click() + } + + //verificar pag da tabela + def selectColumn(String s) { + $('div', id: 'column').find('a', text: s).click() + } + + def fillDateField(String date){ + $("form").date = date + } + + def selectSearchConferencia(){ + $('a.search').click() + } + def selectHome() { $('a.home').click() } diff --git a/test/functional/steps/ConferenciaTestDataAndOperations.groovy b/test/functional/steps/ConferenciaTestDataAndOperations.groovy index 39c4009e..ea00c078 100644 --- a/test/functional/steps/ConferenciaTestDataAndOperations.groovy +++ b/test/functional/steps/ConferenciaTestDataAndOperations.groovy @@ -60,7 +60,27 @@ class ConferenciaTestDataAndOperations { conferencia.title == title } } + + static public Conferencia editConferencia(oldtitle, newtitle) { + def conferencia = Conferencia.findByTitle(oldtitle) + conferencia.setTitle(newtitle) + def cont = new ConferenciaController() + cont.params << conferencia.properties + cont.update() + + def updatedconferencia = Conferencia.findByTitle(newtitle) + return updatedconferencia + } + static public Conferencia searchConferencia(String title){ + def conferencia = Conferencia.findByTitle(title) + return conferencia + } + static public boolean containsUser(members){ + def userData = User.findByUsername('admin')?.author?.id.toString() + return members.contains(userData) + } + static public void uploadConferencias(filename) { def cont = new XMLController() def xml = new File(filename); From 387637355d48b8c94746536b44adae5b0f59869c Mon Sep 17 00:00:00 2001 From: Micael Date: Sat, 12 Jul 2014 07:45:06 -0300 Subject: [PATCH 05/12] =?UTF-8?q?remo=C3=A7=C3=A3o=20das=20marca=C3=A7?= =?UTF-8?q?=C3=B5es=20//#if?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/steps/ConferenciaSteps.groovy | 84 ++++++++++----------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 53c16fec..338f48ed 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -15,77 +15,77 @@ Given(~'^the system has no conferencia entitled "([^"]*)"$') { String title -> conferencia = Conferencia.findByTitle(title) assert conferencia == null } -//#if(ConferenciaFeature) + Given(~'^the system has conferencia entitled "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> ConferenciaTestDataAndOperations.createConferencia(title, filename) conferencia = Conferencia.findByTitle(title) assert ConferenciaTestDataAndOperations.conferenciaCompatibleTo(conferencia, title) } -//#end -//#if(ConferenciaFeature) + + When(~'^I change the conferencia title from "([^"]*)" to "([^"]*)"$') { String title -> ConferenciaTestDataAndOperations.editConferencia(title) } -//#end -//#if(ConferenciaFeature) + + And(~'^I change the conferencia title to "([^"]*)"$') { String newtitle -> page.select('a', 'edit') at ConferenceEditPage page.edit(path + newtitle) } -//#end -//#if(ConferenciaFeature) + + Given(~'^I am at the conferencia page$') {-> at ConferenciaPage } -//#end -//#if(ConferenciaFeature) + + And(~'^the conferencia entitled "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> ConferenciaTestDataAndOperations.createConferencia(title, filename) conferencia = Conferencia.findByTitle(title) assert conferencia != null } -//#end -//#if(ConferenciaFeature) + + When(~'^I select to view the conferencia "([^"]*)" in resulting list$') { String title -> page.selectViewConference(title) at ConferenceShowPage } -//#end -//#if(ConferenciaFeature) + + And(~'^I select the edit option in Conferencia Registration Page$') { String newfile -> page.select('a', 'edit') at ConferenciaEditPage } -//#end -//#if(ConferenciaFeature) + + Given(~'^I am at the conferencia registration page$') { at ConferenciaEditPage } -//#end -//#if(ConferenciaFeature) + + Then(~'^the conferencia is not stored by the system because it is invalid$') { finalSize = Conferencia.findAll().size() assert initialSize == finalSize } -//#end -//#if(ConferenciaFeature) + + When(~'^I create the conferencia with some field blank$') { at ConferenciaCreatePage page.fillConferenciaDetailsPartially() assert page.isSomeConferenciaFildsBlank() == true } -//#end + When(~'^I create the conferencia "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> @@ -224,89 +224,89 @@ And(~'^the conferencias are not stored by the system$') {-> } -//#if(ConferenciaFeature) + When(~'^I click on the column date at the conferencia list table$') {-> at ConferenciaPage page.selectColumn("Date") } -//#end -//#if(ConferenciaFeature) + + Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {-> at ConferenciaPage page.listConferencia() def conferencias = Conferencia.findAll() conferencias.sort(it.date) } -//#end + Given(~'^the system has conferencia entitled "([^"]*)"$') { String title -> def conferencia = Conferencia.findByTitle(title) assert conferencia != null } -//#if(ConferenciaFeature) + When(~'^I click on the column title at the conferencia list table$') {-> at ConferenciaPage page.selectColumn("Title") } -//#end -//#if(ConferenciaFeature) + + Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order$') {-> at ConferenciaPage page.listConferencia() def conferencias = Conferencia.findAll() conferencias.sort(it.title) } -//#end -//#if(ConferenciaFeature) + + When(~'^I select the search conferencia option at the conferencia page$') {-> at ConferenciaPage page.selectSearchConferencia() } -//#end -//#if(ConferenciaFeature) + + When(~'^I search for the conferencia entitled "([^"]*)"$') { String title -> assert ConferenciaTestDataAndOperations.searchConferencia(title) } -//#end -//#if(ConferenciaFeature) + + Then(~'^theres no change in the data stored by the system$') { } -//#end -//#if(ConferenciaFeature) + + And(~'^the system has conferencia dated "([^"]*)"$') {String date-> conferencia = Conferencia.findByDate(date) assert conferencia !=null } -//#end -//#if(ConferenciaFeature) + + When(~'^I write "([^"]*)" at the date field$') {String date-> at ConferenciaPage page.fillDateField(date) } -//#end -//#if(ConferenciaFeature) + + When(~'^I select the option Search for conferencia at the conferencia page$') {-> at ConferenciaPage page.selectSearchConferencia() } -//#end -//#if(ConferenciaFeature) + + Then(~'^a list of all conferencias containing the date "([^"]*)" will be presented in the conferencia screen$') { String date-> at ConferenciaPage page.FindByDate(date) } -//#end + When(~'^I view the conferencia list$') {-> def conferencias = Conferencia.findAll() From 6c75b7ccfeaf4d7e17176fff16e98a53d11bdae5 Mon Sep 17 00:00:00 2001 From: Samuel Romeiro Date: Mon, 28 Jul 2014 00:00:37 -0300 Subject: [PATCH 06/12] =?UTF-8?q?Corre=C3=A7oes=20da=20atividade=2005?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 6 +++--- test/cucumber/steps/ConferenciaSteps.groovy | 18 +++++------------- web-app/uploads/boletim 2013.pdf | Bin 3 files changed, 8 insertions(+), 16 deletions(-) create mode 100644 web-app/uploads/boletim 2013.pdf diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index 340f903e..c7e7bf9b 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -51,8 +51,8 @@ Feature: conferencia Scenario: remove conferencia that does not exist Given the system has no conferencia entitled "IV Conference on Software Product Lines" - When I try to remove the conferencia "IV Conference on Software Product Lines" - Then nothing happens + When I remove the conferencia "IV Conference on Software Product Lines" + Then there's no change in the data stored by the system Scenario: remove and create the same conferencia Given the conferencia "V Conference on Software Product Lines" is stored in the system with file name "IICSE-10.pdf" @@ -100,7 +100,7 @@ Scenario: new invalid conferencia web (fields blank) Scenario: list existing conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I view the conferencia list + When I view the conferencia list Then the conferencia list contains "IV Conference on Software Product Lines" Scenario: Order conferencia web by title diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 338f48ed..02b9c7ec 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -186,15 +186,13 @@ Then(~'^I am back at the publications and conferencias menu$') {-> at PublicationsPage } -When(~'^I try to remove the conferencia "([^"]*)"$') { String title -> - assert Conferencia.findByTitle(title) == null -} - -Then(~'^nothing happens$') {-> +Then(~'^theres no change in the data stored by the system$') {-> + } Given(~'^the system has some conferencias stored$') {-> + assert conferencia != null initialSize = Conferencia.findAll().size() } When(~'^I upload the conferencias of "([^"]*)"$') { filename -> @@ -225,9 +223,9 @@ And(~'^the conferencias are not stored by the system$') {-> } -When(~'^I click on the column date at the conferencia list table$') {-> +When(~'^I click on the column "([^"]*)" at the conferencia list table$') {String columnName -> at ConferenciaPage - page.selectColumn("Date") + page.selectColumn(columnName) } @@ -246,12 +244,6 @@ Given(~'^the system has conferencia entitled "([^"]*)"$') { String title -> } -When(~'^I click on the column title at the conferencia list table$') {-> - at ConferenciaPage - page.selectColumn("Title") -} - - Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order$') {-> at ConferenciaPage diff --git a/web-app/uploads/boletim 2013.pdf b/web-app/uploads/boletim 2013.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 From 74c8c6b076d91fc38399eeea114a3370178c6d60 Mon Sep 17 00:00:00 2001 From: Samuel Romeiro Date: Wed, 30 Jul 2014 17:22:20 -0300 Subject: [PATCH 07/12] =?UTF-8?q?Refatora=C3=A7=C3=A3o=20de=20c=C3=B3digo?= =?UTF-8?q?=20-=20Renomea=C3=A7=C3=A3o=20e=20otimiza=C3=A7=C3=A3o=20de=20m?= =?UTF-8?q?=C3=A9todos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rgms/publication/ConferenciaController.groovy | 10 +++++----- target/test-classes/test-classes.iml | 12 ++++++++++++ test/cucumber/cucumber.iml | 13 +++++++++++++ test/cucumber/steps/ConferenciaSteps.groovy | 6 ------ test/test.iml | 13 +++++++++++++ web-app/uploads/boletim 2013.pdf | Bin 6 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 target/test-classes/test-classes.iml create mode 100644 test/cucumber/cucumber.iml create mode 100644 test/test.iml delete mode 100644 web-app/uploads/boletim 2013.pdf diff --git a/grails-app/controllers/rgms/publication/ConferenciaController.groovy b/grails-app/controllers/rgms/publication/ConferenciaController.groovy index f0d9fb40..f9052bd8 100644 --- a/grails-app/controllers/rgms/publication/ConferenciaController.groovy +++ b/grails-app/controllers/rgms/publication/ConferenciaController.groovy @@ -43,7 +43,7 @@ class ConferenciaController { alertMessage('created',conferenciaInstance) } - private returnConferenciaInstance(){ + private getConferenciaInstance(){ def conferenciaInstance = Conferencia.get(params.id) boolean isReturned = aux.check(params.id, conferenciaInstance, 'conferencia.label', 'Conferencia'); if(!isReturned){ @@ -52,7 +52,7 @@ class ConferenciaController { } - private returnConferenciaActualVersion() + private getConferenciaActualVersion() { def conferenciaInstance = Conferencia.get(params.id) boolean isReturned = aux.check(params.id, conferenciaInstance, 'conferencia.label', 'Conferencia'); @@ -76,15 +76,15 @@ class ConferenciaController { } def show() { - returnConferenciaInstance() + getConferenciaInstance() } def edit() { - returnConferenciaInstance() + getConferenciaInstance() } def update() { - returnConferenciaActualVersion(); + getConferenciaActualVersion(); } def delete() { diff --git a/target/test-classes/test-classes.iml b/target/test-classes/test-classes.iml new file mode 100644 index 00000000..356d3318 --- /dev/null +++ b/target/test-classes/test-classes.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test/cucumber/cucumber.iml b/test/cucumber/cucumber.iml new file mode 100644 index 00000000..6cb194f7 --- /dev/null +++ b/test/cucumber/cucumber.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 02b9c7ec..e4298fd5 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -267,12 +267,6 @@ When(~'^I search for the conferencia entitled "([^"]*)"$') { String title -> -Then(~'^theres no change in the data stored by the system$') { - -} - - - And(~'^the system has conferencia dated "([^"]*)"$') {String date-> conferencia = Conferencia.findByDate(date) assert conferencia !=null diff --git a/test/test.iml b/test/test.iml new file mode 100644 index 00000000..c7c9e024 --- /dev/null +++ b/test/test.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/web-app/uploads/boletim 2013.pdf b/web-app/uploads/boletim 2013.pdf deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 From dbcc9906efef8d376b55e1c6d639a1ea60e3a66a Mon Sep 17 00:00:00 2001 From: Samuel Romeiro Date: Wed, 30 Jul 2014 17:24:45 -0300 Subject: [PATCH 08/12] =?UTF-8?q?Refatora=C3=A7=C3=A3o=20de=20c=C3=B3digo?= =?UTF-8?q?=20-=20Otimiza=C3=A7=C3=A3o=20de=20m=C3=A9todos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Conferencia/ConferenciaCreatePage.groovy | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy b/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy index ea706442..cb5eed42 100644 --- a/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy +++ b/test/functional/pages/Conferencia/ConferenciaCreatePage.groovy @@ -40,12 +40,9 @@ class ConferenciaCreatePage extends FormPage { } def boolean isSomeConferenciaFildsBlank(){ - def resp = false - if($("form").title == null || $("form").booktitle ==null || - $("form").pages == null){ - resp = true - } - return resp + + return ($("form").title == null || $("form").booktitle ==null || + $("form").pages == null) } def selectedMembers() { From d6567510834b9f390e01fc851776770f1ab9997c Mon Sep 17 00:00:00 2001 From: Micael Date: Wed, 30 Jul 2014 17:40:52 -0300 Subject: [PATCH 09/12] =?UTF-8?q?corre=C3=A7=C3=B5es=20de=20erro=20em=20Co?= =?UTF-8?q?nferenciasteps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/steps/ConferenciaSteps.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 02b9c7ec..bd69a0df 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -67,7 +67,7 @@ And(~'^I select the edit option in Conferencia Registration Page$') { String new -Given(~'^I am at the conferencia registration page$') { +Given(~'^I am at the conferencia registration page$') {-> at ConferenciaEditPage } @@ -111,7 +111,7 @@ Then(~'^the conferencia "([^"]*)" is not stored twice$') { String title -> } When(~'^I remove the conferencia "([^"]*)"$') { String title -> - conferencia = Conferencia.findByTitle(title) + def conferencia = Conferencia.findByTitle(title) assert conferencia != null ConferenciaTestDataAndOperations.removeConferencia(title) testRemoveConferencia = Conferencia.findByTitle(title) @@ -187,8 +187,8 @@ Then(~'^I am back at the publications and conferencias menu$') {-> } -Then(~'^theres no change in the data stored by the system$') {-> - +Then(~'^the conferencia entitled "([^"]*)" is found$') {-> + assert ConferenciaTestDataAndOperations.searchConferencia(title) } Given(~'^the system has some conferencias stored$') {-> @@ -267,8 +267,8 @@ When(~'^I search for the conferencia entitled "([^"]*)"$') { String title -> -Then(~'^theres no change in the data stored by the system$') { - +Then(~'^the conferencia entitled "([^"]*)" is not found$') { String title -> + assert Conferencia.findByTitle(title) == null } From 099b46af05e7c687e67661983d540ebea1576dfb Mon Sep 17 00:00:00 2001 From: Micael Date: Wed, 30 Jul 2014 17:41:27 -0300 Subject: [PATCH 10/12] =?UTF-8?q?corre=C3=A7=C3=B5es=20de=20erro=20em=20Co?= =?UTF-8?q?nferenciaFeature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index c7e7bf9b..ba7713ec 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -52,7 +52,7 @@ Feature: conferencia Scenario: remove conferencia that does not exist Given the system has no conferencia entitled "IV Conference on Software Product Lines" When I remove the conferencia "IV Conference on Software Product Lines" - Then there's no change in the data stored by the system + Then the conferencia entitled "IV Conference on Software Product Lines" is not found Scenario: remove and create the same conferencia Given the conferencia "V Conference on Software Product Lines" is stored in the system with file name "IICSE-10.pdf" @@ -88,19 +88,17 @@ Scenario: edit existing conferencia web And the conferencia entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf" When I select to view the conferencia "IV Conference on Software Product Lines" in resulting list And I change the conferencia title to "IV Conference on Software Product Lines REVIEWED" - And I select the "Alterar" option in Conferencia Registration Page - And A success message is displayed - Then I am at Conferencia page + And I select the edit option in Conferencia Registration Page + Then I am at the conferencia page Scenario: new invalid conferencia web (fields blank) Given I am at the conferencia registration page When I create the conferencia with some field blank Then the conferencia is not stored by the system because it is invalid - And an error message is displayed Scenario: list existing conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I view the conferencia list + When I view the conferencia list Then the conferencia list contains "IV Conference on Software Product Lines" Scenario: Order conferencia web by title @@ -116,7 +114,7 @@ Scenario: Order conferencia web by conferencia data Scenario: Search for conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" When I search for the conferencia entitled "IV Conference on Software Product Lines" - Then theres no change in the data stored by the system + Then the conferencia entitled "IV Conference on Software Product Lines" is found Scenario: Search for conferencia web Given I am at the conferencia page From 6d4724135bda2ddec37d3c6b258837a528227fac Mon Sep 17 00:00:00 2001 From: Micael Date: Thu, 31 Jul 2014 00:50:47 -0300 Subject: [PATCH 11/12] =?UTF-8?q?corre=C3=A7=C3=B5es=20de=20erros=20no=20a?= =?UTF-8?q?rquivos=20features=20e=20steps=20implementa=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20m=C3=A9todos=20em=20conferenciaPage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Conferencia.feature | 2 +- test/cucumber/steps/ConferenciaSteps.groovy | 10 ++--- .../pages/Conferencia/ConferenciaPage.groovy | 38 +++++++++++++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index ba7713ec..f51031a0 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -98,7 +98,7 @@ Scenario: new invalid conferencia web (fields blank) Scenario: list existing conferencia Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf" - When I view the conferencia list + When I check the conferencia list Then the conferencia list contains "IV Conference on Software Product Lines" Scenario: Order conferencia web by title diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index bd69a0df..22d63282 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -232,9 +232,7 @@ When(~'^I click on the column "([^"]*)" at the conferencia list table$') {String Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {-> at ConferenciaPage - page.listConferencia() - def conferencias = Conferencia.findAll() - conferencias.sort(it.date) + page.checkIfConferenciaListIsOrderedByDate() } @@ -247,9 +245,7 @@ Given(~'^the system has conferencia entitled "([^"]*)"$') { String title -> Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order$') {-> at ConferenciaPage - page.listConferencia() - def conferencias = Conferencia.findAll() - conferencias.sort(it.title) + page.checkIfConferenciaListIsOrderedByTitle() } @@ -300,7 +296,7 @@ Then(~'^a list of all conferencias containing the date "([^"]*)" will be present } -When(~'^I view the conferencia list$') {-> +When(~'^I check the conferencia list$') {-> def conferencias = Conferencia.findAll() assert conferencias !=null } diff --git a/test/functional/pages/Conferencia/ConferenciaPage.groovy b/test/functional/pages/Conferencia/ConferenciaPage.groovy index dffc470c..09e39c1e 100644 --- a/test/functional/pages/Conferencia/ConferenciaPage.groovy +++ b/test/functional/pages/Conferencia/ConferenciaPage.groovy @@ -55,4 +55,42 @@ class ConferenciaPage extends Page{ assert conferenciaColumns.size() == 0 } + + def checkIfConferenciaListIsOrderedByTitle(){ + def listDiv = $('div', id: 'list-conferencia') + def conferenciaTable = (listDiv.find('table'))[0] + def conferenciaRows = conferenciaTable.find('tbody').find('tr') + + def list = [] + def y = conferenciaRows.size() + def x = 0 + + while(y-- > 0){ + def conferenciaColumns = conferenciaRows[x].find('td') + list.add(articleColumns[0].text()) + x++ + } + def list2 = list.clone() + list2.sort(it.title) + assert list == list2 + } + + def checkIfConferenciaListIsOrderedByDate(){ + def listDiv = $('div', id: 'list-conferencia') + def conferenciaTable = (listDiv.find('table'))[0] + def conferenciaRows = conferenciaTable.find('tbody').find('tr') + + def list = [] + def y = conferenciaRows.size() + def x = 0 + + while(y-- > 0){ + def conferenciaColumns = conferenciaRows[x].find('td') + list.add(articleColumns[1].text()) + x++ + } + def list2 = list.clone() + list2.sort(it.date) + assert list == list2 + } } \ No newline at end of file From 01cd52c3bd34fafe99d01d07d64e210c03a3ca64 Mon Sep 17 00:00:00 2001 From: Micael Date: Mon, 4 Aug 2014 23:46:16 -0300 Subject: [PATCH 12/12] =?UTF-8?q?corre=C3=A7=C3=A3o=20de=20erro=20no=20arq?= =?UTF-8?q?uivo=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit correções de erros em cenários que faziam referência a steps que não existiam (De) I am at the publications menu (para)-> I am at the publications (De) I select the "Conferencia" option at the program menu (para)-> I select the conferencia option at the publications menu --- test/cucumber/Conferencia.feature | 14 +++++++------- test/cucumber/steps/ConferenciaSteps.groovy | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/cucumber/Conferencia.feature b/test/cucumber/Conferencia.feature index f51031a0..3fc8c4bb 100644 --- a/test/cucumber/Conferencia.feature +++ b/test/cucumber/Conferencia.feature @@ -28,7 +28,7 @@ Feature: conferencia Then I can fill the conferencia details Scenario: list conferencia web - Given I am at the publications menu + Given I am at the publications When I select the conferencia option at the publications menu Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order @@ -61,7 +61,7 @@ Feature: conferencia Then the conferencia "V Conference on Software Product Lines" is properly stored by the system Scenario: remove conferencia web - Given I am at the publications menu + Given I am at the publications When I select the conferencia option at the publications menu And a list of conferencias stored by the system is displayed at the conferencia page Then I can remove one conferencia @@ -72,8 +72,8 @@ Feature: conferencia Then the system has all the conferencias of the xml file Scenario: upload conferencias without a file - Given I am at the publications menu - When I select the "Conferencia" option at the program menu + Given I am at the publications + When I select the conferencia option at the publications menu And I select the upload button at the conferencia page Then I'm still on conferencia page And the conferencias are not stored by the system @@ -92,7 +92,7 @@ Scenario: edit existing conferencia web Then I am at the conferencia page Scenario: new invalid conferencia web (fields blank) - Given I am at the conferencia registration page + Given I am at the conferencia create page When I create the conferencia with some field blank Then the conferencia is not stored by the system because it is invalid @@ -103,12 +103,12 @@ Scenario: list existing conferencia Scenario: Order conferencia web by title Given I am at the conferencia page - When I click on the column title at the conferencia list table + When I click on the column "title" at the conferencia list table Then a list of conferencias stored by the system is displayed at the conferencia page by ascending alphabetic order Scenario: Order conferencia web by conferencia data Given I am at the conferencia page - When I click on the column date at the conferencia list table + When I click on the column "date" at the conferencia list table Then a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order Scenario: Search for conferencia diff --git a/test/cucumber/steps/ConferenciaSteps.groovy b/test/cucumber/steps/ConferenciaSteps.groovy index 22d63282..a44aa01e 100644 --- a/test/cucumber/steps/ConferenciaSteps.groovy +++ b/test/cucumber/steps/ConferenciaSteps.groovy @@ -67,8 +67,8 @@ And(~'^I select the edit option in Conferencia Registration Page$') { String new -Given(~'^I am at the conferencia registration page$') {-> - at ConferenciaEditPage +Given(~'^I am at the conferencia create page$') {-> + at ConferenciaCreatePage }