From ddbe8333f0d86a38ec4b900935f79a2f6365a2b6 Mon Sep 17 00:00:00 2001 From: cb16 Date: Sun, 26 Oct 2014 23:28:49 -0300 Subject: [PATCH 01/43] New and modified scenarios in Funder and Member features New necessary scenarios in Funder ("list existing funder", "duplicate funder web") and Member ("login with nonexisting username", "new member with facebook account", "register member with invalid email") and modified scenarios in Member ("register user with invalid info", "new member with invalid phone", "register user with long username"). --- test/cucumber/Funder.feature | 15 +++++++++ test/cucumber/Member.feature | 65 +++++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/test/cucumber/Funder.feature b/test/cucumber/Funder.feature index be8c4fe8..d2e83244 100644 --- a/test/cucumber/Funder.feature +++ b/test/cucumber/Funder.feature @@ -17,8 +17,23 @@ Feature: Funder Given the system has funder with code "12345" When I create a funder with code "12345" Then there is only one funder with code "12345" in the system + + #if($listFunders) + Scenario: list existing funder + Given the system has a funder with code "12345" + When I view the funder list + Then my list funders contains funder "12345" + #end Scenario: new funder web Given I am at the create funder page When I fill the funder code with "12345" Then the funder with code "12345" is properly stored by the system + +#if($duplicateFunderWeb) + Scenario: duplicate funder web + Given I am at the create funder page + When I fill the funder code with "12345" + Then the funder with code "12345" is not stored + And I am still at the create funder page +#end diff --git a/test/cucumber/Member.feature b/test/cucumber/Member.feature index 239da9ff..4e1d7491 100644 --- a/test/cucumber/Member.feature +++ b/test/cucumber/Member.feature @@ -32,7 +32,14 @@ Feature: member Given I am at the login page When I fill username and password with "admin" and "incorrectpassword" Then I am still on the login page with an error message - + +#if($nonexisting) + Scenario: login with nonexisting username + Given I am at the login page + When I fill username and password with "nonexistingusername" and "password" + Then I am still on the login page with an error message +#end + Scenario: user registration Given I am at the register page When I fill the user details with a name, username, passoword1, password2, email, university, status "jose" "josesilva" "123456" "123456" "jose@ufpe.br" "UFPE" "Graduate Student" @@ -51,22 +58,39 @@ Feature: member When I fill some user details with "jose" "josesilva" "jose@ufpe.br" "UFPE" Then I am still on the create member page with the error message - Scenario: register user with invalid data +#if($longUsername) + Scenario: register user with long username Given I am at the create member page - When I fill the user details with "jose" "josesilva" "jose@com" "UFPE" - Then I am still on the create member page with the error message - - -#Scenario: register member invalid aditional info -# Given I am at the create member page -# When I fill many user details with "berg" "bergU" "jus@cin.ufpe.br" "UFPE" "ajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajsdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -# Then I am still on the create member page with the error message - -#Scenario: new member with invalid phone -# Given the system has no member with username "userwithinvalidphone" -# When I create a member with username "userwithinvalidphone" -# Then I am still on the create member page with the error message + When I fill the username with "josedmskejfjsdifejfje" + Then I am still on the create member page + And a long username error message is displayed +#end +#if($invalidEmail) + Scenario: register member with invalid email + Given I am at the create member page + When I fill the email with "lalala.la" + Then I am still on the create member page + And a invalid email error message is displayed +#end + +#if($invalid info) +Scenario: register member invalid info + Given I am at the create member page + When I fill city with "321" + And I fill country with "123" + Then I am still on the create member page + And a "no numbers in city and country allowed" error message is displayed +#end + +#if($invalidPhone) +Scenario: new member with invalid phone + Given I am at the create member page + When I fill the phone with "camilasouto" + Then I am still on the create member page + And a invalid phone message is displayed +#end + #if ($contextualInformation) Scenario: new member filled with default data Given I am at the create member page @@ -75,4 +99,13 @@ Feature: member Scenario: user registration with default data Given I am at the register page Then I see default data filled on register form -#end \ No newline at end of file +#end + +#if($loginfacebook) + Scenario: new member with facebook account + Given I am at the create member page + And I am logged on "Camila Souto" facebook + When I click on "register with facebook" + Then the member "Camila Souto" is properly stored by the system +#end + \ No newline at end of file From 6a6859571c04cd8ad903c803974114d411ac6e2d Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 27 Oct 2014 18:47:12 -0300 Subject: [PATCH 02/43] Create Publication.feature --- test/cucumber/Publication.feature | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/cucumber/Publication.feature diff --git a/test/cucumber/Publication.feature b/test/cucumber/Publication.feature new file mode 100644 index 00000000..ea22e0a8 --- /dev/null +++ b/test/cucumber/Publication.feature @@ -0,0 +1,33 @@ +Feature: Publication + As a member of a research group + I want to add, remove and modify where my publications were published + +-- (gml) + +Scenario: new publication spot in magazine + Given I have an article published in a magazine +When I am at Article Page +Then I can add this information in it + +Scenario: new publication spot in magazine +Given my article was published in the magazine ‘Psicologia: Teoria e Prática’ +And publication number ‘21’ +And publication page ‘43-59’ +And publication place ‘São Paulo’ +And publication date ‘Jul/2013’ +When I click on New Publication Spot +Then I am on Article Page with the new information added as at the section ‘This article was published in:’ ‘Psicologia: Teoria e Prática, São Paulo, n. 2, p. 43-59, jul/2000.’ + +Scenario: edit publication spot in magazine + Given I have an information of an article published in a magazine +And I want to correct any of the fields +When I am at Article Page +Then I can edit this information +And I return to the Article Page + +Scenario: edit publication spot in magazine + Given I have an information of an article published in a magazine +And I want to correct any of the fields +When I am at Article Page +And I click on edit on the section ‘This article was published in:’ +Then I have all the fields filled in and I can edit anything From 10b724f1195d8195de1853119887902ecbad22ee Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 27 Oct 2014 19:02:55 -0300 Subject: [PATCH 03/43] Update and rename Publication.feature to Publicacao.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contém informações sobre onde o artigo ou periódico foram publicados. --- test/cucumber/{Publication.feature => Publicacao.feature} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/cucumber/{Publication.feature => Publicacao.feature} (98%) diff --git a/test/cucumber/Publication.feature b/test/cucumber/Publicacao.feature similarity index 98% rename from test/cucumber/Publication.feature rename to test/cucumber/Publicacao.feature index ea22e0a8..59124bde 100644 --- a/test/cucumber/Publication.feature +++ b/test/cucumber/Publicacao.feature @@ -1,4 +1,4 @@ -Feature: Publication +Feature: "Publicacao" As a member of a research group I want to add, remove and modify where my publications were published From 612936fa30dcc1cdc1282df21cce46b63e383d8b Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 27 Oct 2014 19:29:14 -0300 Subject: [PATCH 04/43] Update Article.feature --- test/cucumber/Article.feature | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 01606f0d..d4d31561 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -25,11 +25,14 @@ Feature: journal article And I create the article "A theory of software product line refinement" with file name "TCS-3" Then the article "A theory of software product line refinement" is not stored twice - Scenario: new article web +#if ($publicationInformation) +Scenario: new article web Given I am at the publications menu When I select the "Periodico" option at the publications menu And I select the new article option at the article page Then I can fill the article details + And It includes the "publicacao" information +#end Scenario: remove existing article Given the system has article entitled "A theory of software product line refinement" with file name "TCS-44.pdf" From b913d7d23cb4f51f70e996063f5215c920bb239b Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 27 Oct 2014 19:32:06 -0300 Subject: [PATCH 05/43] Update Article.feature --- test/cucumber/Article.feature | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index d4d31561..3edc68c3 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -25,6 +25,14 @@ Feature: journal article And I create the article "A theory of software product line refinement" with file name "TCS-3" Then the article "A theory of software product line refinement" is not stored twice +#if ($publicationInformationController) +Scenario: new article web + Given I am at the publications menu + And I want to add a new article + Then I can fill the article details + And It includes the "publicacao" information +#end + #if ($publicationInformation) Scenario: new article web Given I am at the publications menu From 92de7d4274bb7f748e5cf595d8f2dfdf5ffac50b Mon Sep 17 00:00:00 2001 From: brilacerda Date: Tue, 28 Oct 2014 11:03:14 -0300 Subject: [PATCH 06/43] Update Article.feature Gabriela Mota (gml) --- test/cucumber/Article.feature | 46 ++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 3edc68c3..2b8aa62d 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -25,22 +25,33 @@ Feature: journal article And I create the article "A theory of software product line refinement" with file name "TCS-3" Then the article "A theory of software product line refinement" is not stored twice -#if ($publicationInformationController) -Scenario: new article web - Given I am at the publications menu + Scenario: new article web + Given I am at the publications menu + And I want to add a new article + Then I can fill the article details + + Scenario: new article web + Given I am at the publications menu + When I select the "Periodico" option at the publications menu + And I select the new article option at the article page + Then I can fill the article details + + #if ($publicationInformationController) + Scenario: new article web with publication + Given I am at the publications menu And I want to add a new article Then I can fill the article details And It includes the "publicacao" information -#end + #end -#if ($publicationInformation) -Scenario: new article web + #if ($publicationInformation) + Scenario: new article web with publication Given I am at the publications menu When I select the "Periodico" option at the publications menu And I select the new article option at the article page Then I can fill the article details - And It includes the "publicacao" information -#end + And It includes the option of "publicacao" information + #end Scenario: remove existing article Given the system has article entitled "A theory of software product line refinement" with file name "TCS-44.pdf" @@ -112,7 +123,24 @@ Scenario: new article web When I share the article entitled "A theory of software product line refinement" on facebook Then A facebook message was posted - Scenario: Post an existing article on facebook web +#if ($postPublicationInformation) + Scenario: Post an existing article publication on facebook web + Given I am at the articles page and the article "A theory of software product line refinement 3" is stored in the system with file name "TCS-04.pdf" + When I select to view "A theory of software product line refinement 3" in resulting list + And I choose to share the "Publicacao" of this article on Facebook + And I click on 'Share publicacao' on Facebook + Then A facebook message is posted + #end + +#if ($postPublicationInformationController) + Scenario: Post an existing article publication on facebook web + Given I am at the articles page and the article "A theory of software product line refinement 3" is stored in the system with file name "TCS-04.pdf" + When I choose to share the "Publicacao" of this article on Facebook + And I go to this section in the page and click on share + Then A facebook message is posted + #end + + Scenario: Post an existing article on facebook web Given I am at the articles page and the article "A theory of software product line refinement 3" is stored in the system with file name "TCS-04.pdf" When I select to view "A theory of software product line refinement 3" in resulting list And I click on Share on Facebook From 0cf5a3fcca325ab9d1125ed8bbdae79c4fac5ab3 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Tue, 28 Oct 2014 21:13:22 -0300 Subject: [PATCH 07/43] Book GUI scenarios added --- test/cucumber/Book.feature | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 3624ed38..f38875f4 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -34,4 +34,18 @@ Feature: Book And the system has no book entitled "Next Generation Software Product Line Engineering" When I go to new book page And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - Then the book "Next Generation Software Product Line Engineering" was stored by the system \ No newline at end of file + Then the book "Next Generation Software Product Line Engineering" was stored by the system + + Scenario: remove existing book web + Given I am at the book page + And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + When I choose to view "Next Generation Software Product Line Engineering" in book list + And I press to remove at the book show page + Then the book "Next Generation Software Product Line Engineering" is removed from the system + + Scenario: list existing book web + Given I am at the book page + And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + Then the book list contains "Next Generation Software Product Line Engineering" + + From 4f0160a76aa1810bb78fcc68b9243bcda4f199cd Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Tue, 28 Oct 2014 22:11:52 -0300 Subject: [PATCH 08/43] Articles Features modified --- test/cucumber/Article.feature | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 01606f0d..9f8bdb15 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -47,13 +47,15 @@ Feature: journal article Then the article "A theory of software product line refinement" is properly updated by the system Scenario: remove existing article web - Given I am at the articles page and the article "A theory of software product line refinement" is stored in the system with file name "TCS-77.pdf" + Given I am at the articles page + And the article "A theory of software product line refinement" is stored in the system with file name "TCS-77.pdf" When I select to view "A theory of software product line refinement" in resulting list And I select the option to remove in show page Then the article "A theory of software product line refinement" is properly removed by the system Scenario: list existing article web - Given I am at the articles page and the article "A theory of software product line refinement" is stored in the system with file name "TCS-88.pdf" + Given I am at the articles page + And the article "A theory of software product line refinement" is stored in the system with file name "TCS-88.pdf" Then my resulting articles list contains "A theory of software product line refinement" Scenario: edit existing article web From 0440dffb3635d8b0b9aa7fe6db18ef3fa8d455b2 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Tue, 28 Oct 2014 23:05:33 -0300 Subject: [PATCH 09/43] Dissertation GUI scenarios modified --- test/cucumber/Dissertacao.feature | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/cucumber/Dissertacao.feature b/test/cucumber/Dissertacao.feature index 98a20dd2..a5973bcb 100644 --- a/test/cucumber/Dissertacao.feature +++ b/test/cucumber/Dissertacao.feature @@ -58,18 +58,16 @@ Feature: Dissertation Tests Then the dissertation "Edit dissertation" is properly updated by the system Scenario: delete dissertation - Given the dissertation "Delete dissertation" is stored in the system with file name "Deletedissertation.txt" - Given I am at the publications menu - When I select the "Dissertacao" option at the program menu - And I select "Delete dissertation" at the dissertation page - And I delete "Delete dissertation" - Then the system has no dissertation entitled "Delete dissertation" + Given I am at the dissertation page + And the dissertation named "Dissertation One" is stored in the system + When I select "Dissertation One" at the dissertation list + And I press to remove "Delete dissertation" at the dissertation show page + Then the system has no dissertation entitled "Dissertation One" Scenario: upload dissertation without a file - Given I am at the publications menu - When I select the "Dissertacao" option at the program menu - And I select the upload button at the dissertation page - Then I'm still on dissertation page + Given I am at the dissertation page + And I select the upload button with no file selected + Then I stay on dissertation page with an error message Scenario: upload dissertation with a file Given the system has some dissertation stored From 4c84b909f029cc6e3d40417c4a292da34460ebf5 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Tue, 28 Oct 2014 23:15:04 -0300 Subject: [PATCH 10/43] Dissertation Controller scenarios modified --- test/cucumber/Article.feature | 6 ++---- test/cucumber/Dissertacao.feature | 9 ++------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 9f8bdb15..01606f0d 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -47,15 +47,13 @@ Feature: journal article Then the article "A theory of software product line refinement" is properly updated by the system Scenario: remove existing article web - Given I am at the articles page - And the article "A theory of software product line refinement" is stored in the system with file name "TCS-77.pdf" + Given I am at the articles page and the article "A theory of software product line refinement" is stored in the system with file name "TCS-77.pdf" When I select to view "A theory of software product line refinement" in resulting list And I select the option to remove in show page Then the article "A theory of software product line refinement" is properly removed by the system Scenario: list existing article web - Given I am at the articles page - And the article "A theory of software product line refinement" is stored in the system with file name "TCS-88.pdf" + Given I am at the articles page and the article "A theory of software product line refinement" is stored in the system with file name "TCS-88.pdf" Then my resulting articles list contains "A theory of software product line refinement" Scenario: edit existing article web diff --git a/test/cucumber/Dissertacao.feature b/test/cucumber/Dissertacao.feature index a5973bcb..fdee037b 100644 --- a/test/cucumber/Dissertacao.feature +++ b/test/cucumber/Dissertacao.feature @@ -29,7 +29,7 @@ Feature: Dissertation Tests Scenario: new dissertation duplicated Given the dissertation "Dissertation duplicated" is stored in the system with file name "Dissertationduplicated.txt" - When I create the dissertation "Dissertation duplicated" with file name "Dissertationduplicated2.txt" and school "UFPE" + When I create the dissertation "Dissertation duplicated" with file name "Dissertationduplicated2.txt" Then the dissertation "Dissertation duplicated" is not stored twice Scenario: new dissertation without file @@ -39,12 +39,7 @@ Feature: Dissertation Tests And I cant add the dissertation without a file Then the system has no dissertation entitled "Dissertacao sem arquivo" - Scenario: upload a dissertation and system has no dissertation stored - Given the system has no dissertation entitled "New dissertation" - When I upload a new dissertation "curriculo4.xml" with title "New dissertation" - Then the system has more dissertations now - - Scenario: new dissertation with file + Scenario: new dissertation with file Given I am at the publications menu When I select the "Dissertacao" option at the program menu And I select the new dissertation option at the dissertation page From 129ffeb192af1728d096e1dba27d6ce400e4810f Mon Sep 17 00:00:00 2001 From: brilacerda Date: Wed, 29 Oct 2014 10:50:52 -0300 Subject: [PATCH 11/43] Update Publicacao.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correções e comentários da nova classe Publication.feature --- test/cucumber/Publicacao.feature | 53 ++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/test/cucumber/Publicacao.feature b/test/cucumber/Publicacao.feature index 59124bde..c8f6d647 100644 --- a/test/cucumber/Publicacao.feature +++ b/test/cucumber/Publicacao.feature @@ -1,33 +1,40 @@ Feature: "Publicacao" As a member of a research group I want to add, remove and modify where my publications were published - --- (gml) Scenario: new publication spot in magazine - Given I have an article published in a magazine -When I am at Article Page -Then I can add this information in it + Given I want to add informations of an article that had beed published in a magazine + When I try to name a publication in a magazine as ‘Psicologia: Teoria e Prática’ + And publication number ‘21’ + And publication page ‘43-59’ + And publication place ‘São Paulo’ + And publication date ‘Jul/2013’ + Then this publication is stored Scenario: new publication spot in magazine -Given my article was published in the magazine ‘Psicologia: Teoria e Prática’ -And publication number ‘21’ -And publication page ‘43-59’ -And publication place ‘São Paulo’ -And publication date ‘Jul/2013’ -When I click on New Publication Spot -Then I am on Article Page with the new information added as at the section ‘This article was published in:’ ‘Psicologia: Teoria e Prática, São Paulo, n. 2, p. 43-59, jul/2000.’ + Given my article was published in the magazine + And its name is ‘Psicologia: Teoria e Prática’ + And publication number ‘21’ + And publication page ‘43-59’ + And publication place ‘São Paulo’ + And publication date ‘Jul/2013’ + When I click on New Publication Spot + Then I am on Article Page with the new information added as at the section as ‘Psicologia: Teoria e Prática, São Paulo, n. 2, p. 43-59, jul/2000.’ +#dado que a publicação na revista tem um formato, foi especificado nessa última linha +#Nesses dois próximos cenários é garantindo que existe um JavaScript que ajuda Scenario: edit publication spot in magazine - Given I have an information of an article published in a magazine -And I want to correct any of the fields -When I am at Article Page -Then I can edit this information -And I return to the Article Page - + Given I have all the information of an article published in a magazine + And I want to correct any of the fields + When I am at Article Page + Then I can edit any information + And I store it + Scenario: edit publication spot in magazine - Given I have an information of an article published in a magazine -And I want to correct any of the fields -When I am at Article Page -And I click on edit on the section ‘This article was published in:’ -Then I have all the fields filled in and I can edit anything + Given I am at Article Page + I have all the information of an article published in a magazine + And I want to correct any of the fields + When I click on edit on the section ‘This article was published in:’ + Then I have all the fields filled in + And I can edit anything + And I store it From 85ace63cfc7d5efbb3bec11ddfb7745d3c7ce9e2 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Wed, 29 Oct 2014 11:04:43 -0300 Subject: [PATCH 12/43] Update Article.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pequenas correções na classe dada as discussões da aula de hoje --- test/cucumber/Article.feature | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 2b8aa62d..b1fc1660 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -36,22 +36,22 @@ Feature: journal article And I select the new article option at the article page Then I can fill the article details - #if ($publicationInformationController) +#if ($publicationInformationController) Scenario: new article web with publication - Given I am at the publications menu + Given I am at the article page And I want to add a new article Then I can fill the article details - And It includes the "publicacao" information - #end + And It may include the "publication" information +#end - #if ($publicationInformation) +#if ($publicationInformation) Scenario: new article web with publication - Given I am at the publications menu - When I select the "Periodico" option at the publications menu - And I select the new article option at the article page + Given I am at the article page + When I select the "Periodico" option + And I select the 'new article' option Then I can fill the article details - And It includes the option of "publicacao" information - #end + And It may include the option "publication" information +#end Scenario: remove existing article Given the system has article entitled "A theory of software product line refinement" with file name "TCS-44.pdf" From e42a2eff5843a73dcfd9d1a060da13e2f598bdf6 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 17:02:47 -0300 Subject: [PATCH 13/43] Update Dissertacao.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adição do nome do orientador no cadastro da dissertação --- test/cucumber/Dissertacao.feature | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/cucumber/Dissertacao.feature b/test/cucumber/Dissertacao.feature index 98a20dd2..addaafbc 100644 --- a/test/cucumber/Dissertacao.feature +++ b/test/cucumber/Dissertacao.feature @@ -90,4 +90,15 @@ Feature: Dissertation Tests And I select the new dissertation option at the dissertation page Then I see my user listed as an author member of dissertation by default And I see my school name as school of dissertation by default -#end \ No newline at end of file +#end + +#if($addDisertacao) + + Scenario: add "Dissertacao"'s Supervisor + Given I am at the "Dissetação" page + And the system has no dissertation entitled "New dissertation" + When I create the dissertation "New dissertation" with file name "Newdissertation.txt" + And school "UFPE" + And the supervisor "Silvio Melo" + Then the dissertation "New dissertation" is properly stored by the system +#end From fae0c0c67f8ac81097370c0791bc11da4ab7d73d Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 17:04:16 -0300 Subject: [PATCH 14/43] Update Thesis.feature Adicionando o nome do orientador no cadastro de uma nova Tese --- test/cucumber/Thesis.feature | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/cucumber/Thesis.feature b/test/cucumber/Thesis.feature index e664276f..54e3c655 100644 --- a/test/cucumber/Thesis.feature +++ b/test/cucumber/Thesis.feature @@ -106,3 +106,15 @@ Feature: Thesis Tests # o arquivo depois, address deveria ser opcional, deveria ter universidade e # centro/departamento, deveria ter apenas um autor e a possibilidade de um # orientador e co-orientador + +#if($addDisertacao) + + Scenario: add "Dissertacao"'s Supervisor + Given I am at the "Dissetação" page + And the system has no dissertation entitled "New dissertation" + When I create the dissertation "New dissertation" with file name "Newdissertation.txt" + And school "UFPE" + And the supervisor's name + Then the dissertation "New dissertation" is properly stored by the system + +#end From cbc72e8e89e73986136c23d098e3074f7db2c8b6 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 17:13:33 -0300 Subject: [PATCH 15/43] Update Thesis.feature --- test/cucumber/Thesis.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cucumber/Thesis.feature b/test/cucumber/Thesis.feature index 54e3c655..874299eb 100644 --- a/test/cucumber/Thesis.feature +++ b/test/cucumber/Thesis.feature @@ -107,14 +107,14 @@ Feature: Thesis Tests # centro/departamento, deveria ter apenas um autor e a possibilidade de um # orientador e co-orientador -#if($addDisertacao) +#if($addThesis) - Scenario: add "Dissertacao"'s Supervisor - Given I am at the "Dissetação" page - And the system has no dissertation entitled "New dissertation" - When I create the dissertation "New dissertation" with file name "Newdissertation.txt" + Scenario: add Thesis' Supervisor + Given I am at the "Thesis" page + And the system has no dissertation entitled "New thesis" + When I create the dissertation "New thesis" with file name "Newthesis.txt" And school "UFPE" And the supervisor's name - Then the dissertation "New dissertation" is properly stored by the system + Then the dissertation "New thesis" is properly stored by the system #end From f03cf2ff92bc1858e42164b5526c19fbc0b7e90d Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 17:21:31 -0300 Subject: [PATCH 16/43] Update Thesis.feature --- test/cucumber/Thesis.feature | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/test/cucumber/Thesis.feature b/test/cucumber/Thesis.feature index 874299eb..afdb44b5 100644 --- a/test/cucumber/Thesis.feature +++ b/test/cucumber/Thesis.feature @@ -12,7 +12,27 @@ Feature: Thesis Tests Given The system has no thesis entitled "New thesis" When I create the thesis "New thesis" with file name "Newthesis.txt" and school "UFPE" Then The thesis "New thesis" is properly stored by the system + +#if($addThesisWithSupervisor) + Scenario: add Thesis with Supervisor + Given I am at the "Thesis" page + And the system has no dissertation entitled "New thesis" + When I create the dissertation by clicking on "New thesis" + And fill in the file name with "Newthesis.txt" + And school "UFPE" + And the supervisor's "Silvio Meira" + Then the dissertation "New thesis" is properly stored by the system +#end +#if($addThesisWithSupervisor) + Scenario: add Thesis with Supervisor + Given I want to add a "New thesis" + When I create the dissertation "New thesis" with file "Newthesis.txt" + And school "UFPE" + And the supervisor's "Silvio Meira" + Then the dissertation "New thesis" is properly stored by the system +#end + Scenario: remove existing thesis Given the system has thesis entitled "New thesis2" When I delete the thesis "New thesis2" @@ -107,14 +127,3 @@ Feature: Thesis Tests # centro/departamento, deveria ter apenas um autor e a possibilidade de um # orientador e co-orientador -#if($addThesis) - - Scenario: add Thesis' Supervisor - Given I am at the "Thesis" page - And the system has no dissertation entitled "New thesis" - When I create the dissertation "New thesis" with file name "Newthesis.txt" - And school "UFPE" - And the supervisor's name - Then the dissertation "New thesis" is properly stored by the system - -#end From 2245fb9a2725063919a6e0f48ee30e6aa06d8ef1 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 17:52:42 -0300 Subject: [PATCH 17/43] Update Publicacao.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adicionando o cenário de executar um upload de arquivo .PDF na feature de publicação. --- test/cucumber/Publicacao.feature | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/cucumber/Publicacao.feature b/test/cucumber/Publicacao.feature index c8f6d647..6505b210 100644 --- a/test/cucumber/Publicacao.feature +++ b/test/cucumber/Publicacao.feature @@ -25,7 +25,7 @@ Scenario: new publication spot in magazine #Nesses dois próximos cenários é garantindo que existe um JavaScript que ajuda Scenario: edit publication spot in magazine Given I have all the information of an article published in a magazine - And I want to correct any of the fields + And I want to correct any of the fields When I am at Article Page Then I can edit any information And I store it @@ -38,3 +38,20 @@ Scenario: edit publication spot in magazine Then I have all the fields filled in And I can edit anything And I store it + +####vml##### + +#if($uploadPublicacao) +Scenario: make the upload of the PDF presentation in "Publicacao" + Given I am at Article Page + And I want to upload the "Publicacao.pdf" file + When I choose the file by browsing it + Then I click on the "upload" button +#end + +#if($uploadPublicacao) +Scenario: make the upload of the PDF presentation in "Publicacao" + Given I want to upload the PDF presentation "Publicacao.pdf" + When I choose "Publicacao.pdf" file + Then I see it on the list +#end From 162921f2561e341efd6bb7fa3e7396aeecb3d014 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Wed, 29 Oct 2014 18:17:02 -0300 Subject: [PATCH 18/43] Update Dissertacao.feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue relatada sobre o uso de diferentes linguagens na criação do formulário --- test/cucumber/Dissertacao.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/cucumber/Dissertacao.feature b/test/cucumber/Dissertacao.feature index addaafbc..e00213ab 100644 --- a/test/cucumber/Dissertacao.feature +++ b/test/cucumber/Dissertacao.feature @@ -102,3 +102,7 @@ Feature: Dissertation Tests And the supervisor "Silvio Melo" Then the dissertation "New dissertation" is properly stored by the system #end + +#Issue - vml +#A unificação da linguagem do formulário é bastante útil +#pois padroniza o uso do software e evita possíveis ambiguidades e erros From 843ad9323771e615c2a0c61c4b0ed640ca0e74aa Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 10 Nov 2014 21:16:08 -0300 Subject: [PATCH 19/43] =?UTF-8?q?Introdu=C3=A7=C3=A3o=20da=20classe=20maga?= =?UTF-8?q?zine=20publication,=20testes=20no=20site=20n=C3=A3o=20est=C3=A3?= =?UTF-8?q?o=20sendo=20poss=C3=ADveis,=20n=C3=A3o=20sei=20a=20origem=20do?= =?UTF-8?q?=20problema,=20abre=20o=20login,=20as=20op=C3=A7=C3=B5es=20inic?= =?UTF-8?q?iais=20e=20nada=20mais.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grails-app/domain/rgms/publication/Publication.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/domain/rgms/publication/Publication.groovy b/grails-app/domain/rgms/publication/Publication.groovy index fd5ba019..ac90c18f 100644 --- a/grails-app/domain/rgms/publication/Publication.groovy +++ b/grails-app/domain/rgms/publication/Publication.groovy @@ -10,7 +10,7 @@ abstract class Publication { ResearchLine researchLine static belongsTo = Member - static hasMany = [members: Member, authors: String] + static hasMany = [members: Member, authors: String, magazinePublication: MagazinePublication] static constraints = { title nullable: false, blank: false, size: 1..200 From d5774f56a77dc1a09303b02aea11e56179c2c818 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Tue, 11 Nov 2014 22:21:01 -0300 Subject: [PATCH 20/43] Book GUI Test Steps added --- test/cucumber/steps/BookSteps.groovy | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 45aae835..94946ccd 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -103,6 +103,57 @@ Then(~'^the book "([^"]*)" was stored by the system$') { String title -> at BookPage } + +Given(~'^I am at the book page$') { -> + to LoginPage + at LoginPage + page.fillLoginData("admin", "adminadmin") + at PublicationsPage + to BookPage +} + +And(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> + BookTestDataAndOperations.createBook(title, filename) + book = Book.findByTitle(title) + assert BookTestDataAndOperations.bookCompatibleTo(book, title) +} + +When(~'^I choose to view "([^"]*)" in book list$') { String title -> + page.selectViewBook(title) + at BookShowPage +} + +And(~'^I press to remove at the book show page$') {-> + at BookShowPage + page.select('input', 'delete') +} + +Then(~'^the article "([^"]*)" is properly removed by the system$') { String title -> + assert checkIfExists(title) +} + + +Given(~'^I am at the book page$') { -> + to LoginPage + at LoginPage + page.fillLoginData("admin", "adminadmin") + at PublicationsPage + to BookPage +} + +And(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> + BookTestDataAndOperations.createBook(title, filename) + book = Book.findByTitle(title) + assert BookTestDataAndOperations.bookCompatibleTo(book, title) +} + +Then(~'^the book list contains" ([^"]*)"$') { String title -> + at BookPage + page.checkArticleAtList(title, 0) +} + + + def checkIfExists(String title) { book = Book.findByTitle(title) assert book == null From 9b419f420f90b6476231863a925cc4e5306fe82d Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Thu, 13 Nov 2014 15:42:04 -0300 Subject: [PATCH 21/43] Duplicate test removed --- test/cucumber/steps/BookSteps.groovy | 33 +--------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 94946ccd..0101e9f2 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -88,14 +88,12 @@ When(~'^I go to new book page$') { -> to BookPage page.selectNewBook() } - And(~'^I use the webpage to create the book "([^"]*)" with file name "([^"]*)"$') { String title, filename -> at BookCreatePage createAndCheckBookOnBrowser(title, filename) to BookPage at BookPage } - Then(~'^the book "([^"]*)" was stored by the system$') { String title -> book = Book.findByTitle(title) assert book != null @@ -104,48 +102,19 @@ Then(~'^the book "([^"]*)" was stored by the system$') { String title -> } -Given(~'^I am at the book page$') { -> - to LoginPage - at LoginPage - page.fillLoginData("admin", "adminadmin") - at PublicationsPage - to BookPage -} - -And(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> - BookTestDataAndOperations.createBook(title, filename) - book = Book.findByTitle(title) - assert BookTestDataAndOperations.bookCompatibleTo(book, title) -} - When(~'^I choose to view "([^"]*)" in book list$') { String title -> page.selectViewBook(title) at BookShowPage } - And(~'^I press to remove at the book show page$') {-> at BookShowPage page.select('input', 'delete') } - Then(~'^the article "([^"]*)" is properly removed by the system$') { String title -> assert checkIfExists(title) } -Given(~'^I am at the book page$') { -> - to LoginPage - at LoginPage - page.fillLoginData("admin", "adminadmin") - at PublicationsPage - to BookPage -} - -And(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> - BookTestDataAndOperations.createBook(title, filename) - book = Book.findByTitle(title) - assert BookTestDataAndOperations.bookCompatibleTo(book, title) -} Then(~'^the book list contains" ([^"]*)"$') { String title -> at BookPage @@ -164,4 +133,4 @@ def createAndCheckBookOnBrowser(String title, String filename) { page.clickSaveBook() book = Book.findByTitle(title) assert book != null -} \ No newline at end of file +} From 2b740e4f21e902d35fa90248628d8b6302da0cd4 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Thu, 13 Nov 2014 16:49:35 -0300 Subject: [PATCH 22/43] Update ThesisSteps.groovy --- test/cucumber/steps/ThesisSteps.groovy | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/cucumber/steps/ThesisSteps.groovy b/test/cucumber/steps/ThesisSteps.groovy index 90129b91..c4211957 100644 --- a/test/cucumber/steps/ThesisSteps.groovy +++ b/test/cucumber/steps/ThesisSteps.groovy @@ -23,9 +23,9 @@ Given(~'^The thesis "([^"]*)" is stored in the system with file name "([^"]*)"$' assert article != null } -When(~'^I create the thesis "([^"]*)" with file name "([^"]*)" and school "([^"]*)"$') { - String title, filename, school -> - ThesisTestDataAndOperations.createTese(title, filename, school) +When(~'^I create the thesis "([^"]*)" with file name "([^"]*)" and school "([^"]*)" and supervisor "([^"]*)"$') { + String title, filename, school, supervisor -> + ThesisTestDataAndOperations.createTese(title, filename, school, supervisor) } Then(~'^The thesis "([^"]*)" is not stored twice$') { String title -> @@ -269,6 +269,8 @@ And(~'^the system stores properly the thesis entitled "([^"]*)"$') { title -> } +Given (~'^I want to add a "New thesis"') { + //FUNÇÔES AUXILIARES def thesisDoNotExists(title) { tese = Tese.findByTitle(title) @@ -280,4 +282,4 @@ def Login() { to LoginPage at LoginPage page.fillLoginData("admin", "adminadmin") -} \ No newline at end of file +} From 8e13e05f70002c343c8aa83ca80bbcd884e41773 Mon Sep 17 00:00:00 2001 From: rjoSooares Date: Fri, 21 Nov 2014 19:56:03 -0300 Subject: [PATCH 23/43] =?UTF-8?q?Cria=C3=A7=C3=A3o=20e=20modifica=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20cen=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/BookChapter.feature | 14 +++++++++++++- test/cucumber/Orientation.feature | 26 +++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/test/cucumber/BookChapter.feature b/test/cucumber/BookChapter.feature index 9f21361b..97141923 100644 --- a/test/cucumber/BookChapter.feature +++ b/test/cucumber/BookChapter.feature @@ -6,7 +6,7 @@ Feature: BookChapter Scenario: new book chapter Given the system has no book chapter entitled "SPL Development" - When I create the book chapter "SPL Development" with file name "HSPLE.pdf" + When I create the book chapter "SPL Development" with file name "HSPLE.pdf" and publication date "21/11/2014" Then the book chapter "SPL Development" is properly stored by the system Scenario: duplicate book chapter @@ -72,3 +72,15 @@ Feature: BookChapter And I select the upload button at the book chapter page Then I'm still on book chapter page And the book chapters are not stored by the system + + Scenario: filter existing book chapter by title + Given the system has some book chapter entitled by "Next Generation Software Product Line Engineering" + When the system filter the book chapter entitled by title "Next Generation Software Product Line Engineering" + Then the system book chapter list content is not modified + + Scenario: filter existing book chapter by title web + Given I am at the book chapter page + And I create some book chapter entitled by "Next Generation Software Product Line Engineering" + When I select to view the list of book chapters + And I select to filter the list of book chapter by title "Next Generation Software Product Line Engineering" + Then my book chapter list shows only the book chapters entitled by "Next Generation Software Product Line Engineering" diff --git a/test/cucumber/Orientation.feature b/test/cucumber/Orientation.feature index 6ca3f5e4..d8532e60 100644 --- a/test/cucumber/Orientation.feature +++ b/test/cucumber/Orientation.feature @@ -6,7 +6,7 @@ Feature: orientations Scenario: new orientation Given the system has no orientations entitled "The Book is on the table" - When I create a new orientation entitled "The Book is on the table" + When I create a new orientation entitled "The Book is on the table" and with type of "Mestrado" Then the orientation "The Book is on the table" is properly stored by the system Scenario: remove existing orientation @@ -78,3 +78,27 @@ Feature: orientations Then I'm still on orientations page And the orientations are not stored by the system #end + + Scenario: filter existing orientation by type + Given the system has some orientation with type "Mestrado" + When the system filter the orientation with type "Mestrado" + Then the system orientation list content is not modified + + Scenario: filter existing orientation by type web + Given I am at the orientation page + And I create some orientation with type "Mestrado" + When I select to view the list of orientation + And I select to filter the list of orientation by type "Mestrado" + Then my orientation list shows only the orientation type by "Mestrado" + + Scenario: filter existing articles by leader + Given the system has some articles supervised by "Rodolfo Jose" + When the system filter the articles supervised by leader "Rodolfo Jose" + Then the system article list content is not modified + + Scenario: filter existing orientation by leader web + Given I am at the orientation page + And I create some orientation supervised by "Rodolfo Jose" + When I select to view the list of orientation + And I select to filter the list of orientation by leader "Rodolfo Jose" + Then my orientation list shows only the orientation supervised by "Rodolfo Jose" \ No newline at end of file From c9cb68fa57fcb2bd9411c98f0f95167f9744fa97 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Sat, 22 Nov 2014 01:40:27 -0200 Subject: [PATCH 24/43] fixed scenario: upload dissertation without a file --- test/cucumber/steps/DissertacaoSteps.groovy | 25 +++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/test/cucumber/steps/DissertacaoSteps.groovy b/test/cucumber/steps/DissertacaoSteps.groovy index 03cd3324..27fadef4 100644 --- a/test/cucumber/steps/DissertacaoSteps.groovy +++ b/test/cucumber/steps/DissertacaoSteps.groovy @@ -101,13 +101,6 @@ Then(~'^the dissertation "([^"]*)" is properly updated by the system$') { String assert article == null } -When(~'^I select the upload button at the dissertation page$') {-> - at DissertationPage - page.uploadWithoutFile() -} -Then(~'^I\'m still on dissertation page$') {-> - at DissertationPage -} When(~'^I upload a new dissertation "([^"]*)"$') { filename -> String path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename @@ -157,3 +150,21 @@ Given(~'^the system has no dissertation stored$') {-> } +Given(~'^I am at the dissertation page$') { -> + to LoginPage + at LoginPage + page.fillLoginData("admin", "adminadmin") + at PublicationsPage + to DissertationPage +} +When(~'^I select the upload button with no file selected$') {-> + page.uploadWithoutFile() +} +Then(~'^I stay on dissertation page with an error message$') { -> + at DissertationPage + assert page.readFlashMessage() != null +} + + + + From 025d563b453e14959311e8978bc574771717d0bc Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Sat, 22 Nov 2014 01:57:47 -0200 Subject: [PATCH 25/43] Scenario test: Delete dissertation Modification and implementation done --- test/cucumber/steps/DissertacaoSteps.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cucumber/steps/DissertacaoSteps.groovy b/test/cucumber/steps/DissertacaoSteps.groovy index 27fadef4..73dceeb5 100644 --- a/test/cucumber/steps/DissertacaoSteps.groovy +++ b/test/cucumber/steps/DissertacaoSteps.groovy @@ -166,5 +166,7 @@ Then(~'^I stay on dissertation page with an error message$') { -> } - +When(~'^I press to remove "([^"]*)" at the dissertation show page$'){ String title-> + page.select('input', 'delete') +} From bb8dc8b7e5e59154e4a2c93dcb0be2d9dabe02b9 Mon Sep 17 00:00:00 2001 From: rjoSooares Date: Sat, 22 Nov 2014 11:16:53 -0300 Subject: [PATCH 26/43] =?UTF-8?q?Implementa=C3=A7=C3=A3o=20dos=20Testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/rgms/member/Orientation.groovy | 16 +++ test/cucumber/Orientation.feature | 10 +- test/cucumber/steps/BookChapterSteps.groovy | 59 +++++++++++ test/cucumber/steps/OrientationSteps.groovy | 98 +++++++++++++++++++ .../BookChapterTestDataAndOperations.groovy | 12 +++ .../OrientationTestDataAndOperations.groovy | 18 ++++ 6 files changed, 208 insertions(+), 5 deletions(-) diff --git a/grails-app/domain/rgms/member/Orientation.groovy b/grails-app/domain/rgms/member/Orientation.groovy index 800e5020..113bdb46 100644 --- a/grails-app/domain/rgms/member/Orientation.groovy +++ b/grails-app/domain/rgms/member/Orientation.groovy @@ -30,6 +30,22 @@ class Orientation { } + static public def isFiltered(orientations,typeof) { + for (orientation in orientations) { + if(!(orientation.tipo).contains(typeof)) + return false + } + return true + } + + static public def isFiltered(orientations,supervised, tipo) { + for (orientation in orientations) { + if(!(orientation.orientador).contains(supervised)) + return false + } + return true + } + String toString() { return "Titulo = " + this.tituloTese + "; Orientador = " + this.orientador + "; Orientando: " + this.orientando } diff --git a/test/cucumber/Orientation.feature b/test/cucumber/Orientation.feature index d8532e60..87a15cbe 100644 --- a/test/cucumber/Orientation.feature +++ b/test/cucumber/Orientation.feature @@ -86,13 +86,13 @@ Feature: orientations Scenario: filter existing orientation by type web Given I am at the orientation page - And I create some orientation with type "Mestrado" + And I create some orientation with type of "Mestrado" When I select to view the list of orientation - And I select to filter the list of orientation by type "Mestrado" - Then my orientation list shows only the orientation type by "Mestrado" + And I select to filter the list of orientation by type of "Mestrado" + Then my orientation list shows only the orientation type of by "Mestrado" - Scenario: filter existing articles by leader - Given the system has some articles supervised by "Rodolfo Jose" + Scenario: filter existing orientation by leader + Given the system has some orientation supervised by "Rodolfo Jose" When the system filter the articles supervised by leader "Rodolfo Jose" Then the system article list content is not modified diff --git a/test/cucumber/steps/BookChapterSteps.groovy b/test/cucumber/steps/BookChapterSteps.groovy index 1ef01632..fff0c284 100644 --- a/test/cucumber/steps/BookChapterSteps.groovy +++ b/test/cucumber/steps/BookChapterSteps.groovy @@ -5,6 +5,7 @@ import pages.PublicationsPage import pages.* import rgms.publication.BookChapter import steps.BookChapterTestDataAndOperations +import steps.OrientationTestDataAndOperations import steps.TestDataAndOperationsPublication import static cucumber.api.groovy.EN.* @@ -17,6 +18,10 @@ When(~'^I create the book chapter "([^"]*)" with file name "([^"]*)"$') { String BookChapterTestDataAndOperations.createBookChapter(title, filename) } +When(~'^I create the book chapter "([^"]*)" with file name "([^"]*)" and publication date "([^"]*)"$') { String title, filename, date -> + BookChapterTestDataAndOperations.createBookChapter(title, filename) +} + Then(~'^the book chapter "([^"]*)" is properly stored by the system$') { String title -> bookChapter = BookChapter.findByTitle(title) assert BookChapterTestDataAndOperations.bookChapterCompatibleTo(bookChapter, title) @@ -55,6 +60,23 @@ Given(~'^I am at the book chapter page$') { -> at BookChapterPage } +And(~'^I create some book chapter entitled by "([^"]*)"$'){String title -> + at BookChapterPage + page.selectNewBookChapter() + at BookChapterCreatePage + page.fillArticleDetails(BookChapterTestDataAndOperations.path() + 'A.pdf', title) + page.selectCreateBookChapter() + assert !bookChapterNoExist(title) + to BookChapterPage + page.selectNewBookChapter() + at BookChapterCreatePage + page.fillArticleDetails(BookChapterTestDataAndOperations.path() + 'A.pdf', 'Refinement of Concurrent Object Oriented Programs') + page.selectCreateBookChapter() + assert !bookChapterNoExist('Refinement of Concurrent Object Oriented Programs') + to BookChapterPage +} + + And(~'^I fill only the title field with the value "([^"]*)"$') { String title -> at BookChapterCreatePage page.fillTitle(title) @@ -176,6 +198,43 @@ When(~'I select the Book Chapter option at the program menu'){ -> page.select("Book Chapter") } +Given(~'^the system has some book chapter entitled by "([^"]*)"$'){ String title -> + BookChapterTestDataAndOperations.createBookChapter(title, "A.pdf") + BookChapterTestDataAndOperations.createBookChapter('Refinement of Concurrent Object Oriented Programs', "B.pdf") + + assert (!bookChapterNoExist(title) && !bookChapterNoExist('Refinement of Concurrent Object Oriented Programs')) +} + +When(~'^the system filter the book chapter entitled by title "([^"]*)"$') { String title -> + bookChapterFilter = BookChapterTestDataAndOperations.findBookChapterByTitle(title) + BookChapterTestDataAndOperations.isFiltered(bookChapterFilter, title) +} + +Then(~'^the system book chapter list content is not modified$'){-> + assert BookChapter.findAll().size() == 2 + assert !bookChapterNoExist('Next Generation Software Product Line Engineering') + assert !bookChapterNoExist('Refinement of Concurrent Object Oriented Programs') +} + +When(~'^I select to view the list of book chapters$'){-> + at BookChapterPage + page.selectViewBookChapter() +} + +And(~'^I select to filter the list of book chapter by title "([^"]*)"$'){ String title -> + at BookChapterPage + page.fillAndSelectFilter(title) +} + +Then(~'^my book chapter list shows only the book chapters entitled by "([^"]*)"$') { String title -> + at BookChapterPage + assert page.checkFilteredBy(title) +} + +def bookChapterNoExist(String title){ + return BookChapterTestDataAndOperations.findBookChapterByTitle(title) == null +} + def createAndCheckBookOnBrowser(String title, String filename) { page.fillBookChapterDetails(title, filename) diff --git a/test/cucumber/steps/OrientationSteps.groovy b/test/cucumber/steps/OrientationSteps.groovy index 3bec0229..0d551188 100644 --- a/test/cucumber/steps/OrientationSteps.groovy +++ b/test/cucumber/steps/OrientationSteps.groovy @@ -26,6 +26,11 @@ When(~'^I create a new orientation entitled "([^"]*)"$') { String tituloTese -> OrientationTestDataAndOperations.createOrientation(tituloTese) } +When(~'^I create a new orientation entitled "([^"]*)" and with type of "([^"]*)"$') { String tituloTese, String tipo-> + // Express the Regexp above with the code you wish you had + OrientationTestDataAndOperations.createOrientation(tituloTese, tipo) +} + Then(~'^the orientation "([^"]*)" is properly stored by the system$') { String title -> checkIfOrientationExists(title) } @@ -219,6 +224,99 @@ When(~'^I select the option remove at the orientation show page$') { -> } +def orientationNoExist(String title){ + return OrientationTestDataAndOperations.findOrientationByTitle(title) == null +} + +//filter +Given(~'^the system has some orientation with type "([^"]*)"$'){ String tipo -> + OrientationTestDataAndOperations.createOrientation('A theory of software product line refinement', tipo) + OrientationTestDataAndOperations.createOrientation('Modularity analysis of use case implementations') + + assert (!orientationNoExist('A theory of software product line refinement') && !orientationNoExist('Modularity analysis of use case implementations')) +} + +When(~'^the system filter the orientation with type "([^"]*)"$'){ String tipo -> + orientationFiltered = Orientation.findByTipo(tipo) + assert Orientation.isFiltered(orientationFiltered, tipo) +} + +Then(~'^the system orientation list content is not modified$'){ + assert Orientation.findAll().size() == 2 + assert !orientationNoExist('Modularity analysis of use case implementations') + assert !orientationNoExist('A theory of software product line refinement') +} + +And(~'^I create some orientation with type of "([^"]*)"$') {String tipo-> + at OrientationsPage + page.selectNewOrientation() + at OrientationCreatePage + fillOrientationWithTitleAndCreateThen('Modularity analysis of use case implementations') + page.selectCreateOrientation() + assert !orientationNoExist('Modularity analysis of use case implementations') + to OrientationsPage + page.selectNewOrientation() + at OrientationCreatePage + fillOrientationWithTitleAndCreateThen('A theory of software product line refinement') + page.selectCreateOrientation() + assert !orientationNoExist('A theory of software product line refinement') + to OrientationsPage +} + +When(~'^I select to view the list of orientation$') {-> + at OrientationsPage + page.selectViewOrientation() +} + +And(~'^I select to filter the list of orientation by type of "([^"]*)"$') {String tipo-> + at OrientationsPage + page.fillAndSelectFilter(tipo) +} + +Then(~'^my orientation list shows only the orientation type of by "([^"]*)"$') {String tipo-> + at OrientationsPage + assert page.checkFilteredBy(tipo); +} + + +Given(~'^the system has some orientation supervised by "([^"]*)"$'){ String leader -> + OrientationTestDataAndOperations.createOrientation('The Book is on the table', leader) + OrientationTestDataAndOperations.createOrientation('The Book is on the table') + + assert (!orientationNoExist('A theory of software product line refinement') && !orientationNoExist('Modularity analysis of use case implementations')) +} + +When(~'^the system filter the articles supervised by leader "([^"]*)"$'){ String leader -> + orientationFiltered = Orientation.findByOrientador(leader) + assert Orientation.isFiltered(orientationFiltered, leader, null) +} + +And(~'^I create some orientation supervised by "([^"]*)"$') {String leader-> + at OrientationsPage + page.selectNewOrientation() + at OrientationCreatePage + fillOrientationWithTitleAndCreateThen('Modularity analysis of use case implementations', leader) + page.selectCreateOrientation() + assert !orientationNoExist('Modularity analysis of use case implementations') + to OrientationsPage + page.selectNewOrientation() + at OrientationCreatePage + fillOrientationWithTitleAndCreateThen('A theory of software product line refinement') + page.selectCreateOrientation() + assert !orientationNoExist('A theory of software product line refinement') + to OrientationsPage +} + +And(~'^I select to filter the list of orientation by leader "([^"]*)"$') {String leader-> + at OrientationsPage + page.fillAndSelectFilter(leader) +} + +Then(~'^my orientation list shows only the orientation supervised by "([^"]*)"$') {String leader-> + at OrientationsPage + assert page.checkFilteredBy(leader); +} + //FUNCOES AUXILIARES private void goToOrientationCreatePage() { diff --git a/test/functional/steps/BookChapterTestDataAndOperations.groovy b/test/functional/steps/BookChapterTestDataAndOperations.groovy index f4a0a0c7..5e354d95 100644 --- a/test/functional/steps/BookChapterTestDataAndOperations.groovy +++ b/test/functional/steps/BookChapterTestDataAndOperations.groovy @@ -61,6 +61,18 @@ class BookChapterTestDataAndOperations { cont.response.reset() } + static public def path(){ + return new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator + } + + static public def isFiltered(bookChapters,title) { + for (bookChapter in bookChapters) { + if(!(bookChapter.title).contains(title)) + return false + } + return true + } + static public void removeBookChapter(String title) { def testBookChapter = BookChapter.findByTitle(title) def cont = new BookChapterController() diff --git a/test/functional/steps/OrientationTestDataAndOperations.groovy b/test/functional/steps/OrientationTestDataAndOperations.groovy index b1f88aed..75b3bd7c 100644 --- a/test/functional/steps/OrientationTestDataAndOperations.groovy +++ b/test/functional/steps/OrientationTestDataAndOperations.groovy @@ -37,6 +37,24 @@ class OrientationTestDataAndOperations { createOrientationAux(cont, tituloTese, member) } + static public void createOrientation(String tituloTese, String tipo) { + + def cont = new OrientationController() + def memberCreater = new Member(members[0]) + memberCreater.create() + memberCreater.save() + def member = Member.findByName(memberCreater.name) + createOrientationAux(cont, tituloTese, member, tipo) + } + + private static void createOrientationAux(OrientationController cont, String tituloTese, Member member, String tipo) { + cont.params << [tipo: tipo, orientando: "Tomaz", tituloTese: tituloTese, anoPublicacao: 2013, instituicao: "UFPE", orientador: member] + cont.request.setContent(new byte[1000]) // Could also vary the request content. + cont.create() + cont.save() + cont.response.reset() + } + private static void createOrientationAux(OrientationController cont, String tituloTese, Member member) { cont.params << [tipo: "Mestrado", orientando: "Tomaz", tituloTese: tituloTese, anoPublicacao: 2013, instituicao: "UFPE", orientador: member] cont.request.setContent(new byte[1000]) // Could also vary the request content. From f8c7a33aa1b040a13429714520fe33691bfbff92 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Sat, 22 Nov 2014 17:25:47 -0300 Subject: [PATCH 27/43] Update DissertacaoSteps.groovy adicionando mudancas para "supervisor" no cadastro de dissetacoes --- test/cucumber/steps/DissertacaoSteps.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cucumber/steps/DissertacaoSteps.groovy b/test/cucumber/steps/DissertacaoSteps.groovy index 03cd3324..ce6ddfd1 100644 --- a/test/cucumber/steps/DissertacaoSteps.groovy +++ b/test/cucumber/steps/DissertacaoSteps.groovy @@ -67,8 +67,8 @@ Given(~'^the dissertation "([^"]*)" is stored in the system with file name "([^" } -When(~'^I create the dissertation "([^"]*)" with file name "([^"]*)" and school "([^"]*)"$') { String title, filename, school -> - TestDataDissertacao.createDissertacao(title, filename, school) +When(~'^I create the dissertation "([^"]*)" with file name "([^"]*)", school "([^"]*)" and supervisor "([^"]*)"$') { String title, filename, school, supervisor -> + TestDataDissertacao.createDissertacao(title, filename, school, supervisor) } From 03da0d5ba47acfc257bc57e16480035b1fc72548 Mon Sep 17 00:00:00 2001 From: Vinicius Lira Date: Sat, 22 Nov 2014 17:26:19 -0300 Subject: [PATCH 28/43] Update ThesisSteps.groovy adicionando o supervisor no cadastro de teses --- test/cucumber/steps/ThesisSteps.groovy | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/cucumber/steps/ThesisSteps.groovy b/test/cucumber/steps/ThesisSteps.groovy index c4211957..3144972a 100644 --- a/test/cucumber/steps/ThesisSteps.groovy +++ b/test/cucumber/steps/ThesisSteps.groovy @@ -46,16 +46,16 @@ Given(~'^I am at the create thesis page$') { -> at ThesisCreatePage } -When(~'^I fill the thesis details with "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)" and "([^"]*)"$') { - title, pub_day, pub_month, pub_year, school, address -> +When(~'^I fill the thesis details with "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)" and "([^"]*)"$') { + title, pub_day, pub_month, pub_year, school, address, supervisor -> def absolutePath = ServletContextHolder.servletContext.getRealPath("/test/functional/steps/NewthesisGUI.txt") absolutePath = absolutePath.replace("\\", "/").replaceAll("/web-app", "") - page.fillThesisDetails(title, pub_day, pub_month, pub_year, school, address, absolutePath) + page.fillThesisDetails(title, pub_day, pub_month, pub_year, school, address, supervisor, absolutePath) } -When(~'^I fill some thesis details with "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)" and "([^"]*)"$') { - title, pub_day, pub_month, pub_year, school, address -> - page.fillSomeThesisDetails(title, pub_day, pub_month, pub_year, school, address) +When(~'^I fill some thesis details with "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)" and "([^"]*)"$') { + title, pub_day, pub_month, pub_year, school, address, supervisor -> + page.fillSomeThesisDetails(title, pub_day, pub_month, pub_year, school, address, supervisor) } Then(~'^I am on the thesis show page$') { -> @@ -170,7 +170,7 @@ Then(~'^the returned thesis list has the same items but it is sorted by date$') } //Scenario: search an existing thesis -Given(~'^the system has one thesis entitled "([^"]*)" with author name "([^"]*)", year of publication "([^"]*)" and university "([^"]*)"$') { title, author, year, university -> +Given(~'^the system has one thesis entitled "([^"]*)" with author name "([^"]*)", year of publication "([^"]*)", university "([^"]*)" and supervisor "([^"]*)"$') { title, author, year, university, supervisor -> } @@ -193,7 +193,7 @@ Then(~'^the thesis "([^"]*)" by "([^"]*)" appears in the thesis view page$') { t //Scenario: create thesis web without a file -When(~'^I fill the thesis fields with "([^"]*)", "([^"]*)", "([^"]*)","([^"]*)", "([^"]*)","([^"]*)"$') { title, date, university, address, author, advisor -> +When(~'^I fill the thesis fields with "([^"]*)", "([^"]*)", "([^"]*)","([^"]*)", "([^"]*)","([^"]*)", "([^"]*)"$') { title, date, university, address, author, advisor, supervisor -> } From 8f586efd0259880088238a86b3cc034b48b5e76d Mon Sep 17 00:00:00 2001 From: brilacerda Date: Sun, 23 Nov 2014 00:18:59 -0300 Subject: [PATCH 29/43] =?UTF-8?q?Introdu=C3=A7=C3=A3o=20da=20classe=20maga?= =?UTF-8?q?zine=20publication=20com=20as=20classes=20outras=20necess=C3=A1?= =?UTF-8?q?rias=20para=20testes,=20e=20as=20altera=C3=A7=C3=B5es=20que=20e?= =?UTF-8?q?u=20julguei=20importantes,=20baseada=20em=20outras=20classes.?= =?UTF-8?q?=20Ainda=20sim=20muitas=20d=C3=BAvidas=20permeiam.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application.properties | 2 +- .../publication/MagazinePublication.groovy | 24 +++++++ .../domain/rgms/publication/Periodico.groovy | 2 + .../rgms/publication/Publication.groovy | 4 +- grails-app/i18n/messages.properties | 3 + grails-app/i18n/messages_pt_BR.properties | 5 ++ test/cucumber/MagazinePublication.feature | 57 +++++++++++++++++ test/cucumber/Publicacao.feature | 57 ----------------- .../steps/MagazinePublicationSteps.groovy | 55 ++++++++++++++++ .../steps/ArticleTestDataAndOperations.groovy | 1 - ...inePublicationTestDataAndOperations.groovy | 63 +++++++++++++++++++ 11 files changed, 213 insertions(+), 60 deletions(-) create mode 100644 grails-app/domain/rgms/publication/MagazinePublication.groovy create mode 100644 test/cucumber/MagazinePublication.feature delete mode 100644 test/cucumber/Publicacao.feature create mode 100644 test/cucumber/steps/MagazinePublicationSteps.groovy create mode 100644 test/functional/steps/MagazinePublicationTestDataAndOperations.groovy diff --git a/application.properties b/application.properties index e6246333..129a61b3 100644 --- a/application.properties +++ b/application.properties @@ -1,5 +1,5 @@ #Grails Metadata file -#Thu Jun 06 10:16:12 GMT-03:00 2013 +#Mon Oct 27 15:36:21 GMT-03:00 2014 app.grails.version=2.1.0 app.name=rgms app.servlet.version=2.5 diff --git a/grails-app/domain/rgms/publication/MagazinePublication.groovy b/grails-app/domain/rgms/publication/MagazinePublication.groovy new file mode 100644 index 00000000..5602e507 --- /dev/null +++ b/grails-app/domain/rgms/publication/MagazinePublication.groovy @@ -0,0 +1,24 @@ +package rgms.publication + + +/** + * Created by Gabriela on 10-Nov-14. + */ +class MagazinePublication{ + String name + int number + String page + String place + String month + int year + + static belongsTo = Periodico + + static constraints = {name nullable: false, blank: false, size: 1..50 + number blank: true, size: 1..3 + page nullable: true + place nullable: false + month nullable: true + year nullable: false + } +} diff --git a/grails-app/domain/rgms/publication/Periodico.groovy b/grails-app/domain/rgms/publication/Periodico.groovy index 71704757..46eb9a6b 100644 --- a/grails-app/domain/rgms/publication/Periodico.groovy +++ b/grails-app/domain/rgms/publication/Periodico.groovy @@ -7,12 +7,14 @@ class Periodico extends Publication { int volume int number String pages + MagazinePublication magPublication static constraints = { journal nullable: false, blank: false volume nullable: false, blank: false, min: 1 number nullable: false, blank: false, min: 1 pages nullable: false, blank: false + magPublication nullable: true, blank: true } //#if($Bibtex) diff --git a/grails-app/domain/rgms/publication/Publication.groovy b/grails-app/domain/rgms/publication/Publication.groovy index ac90c18f..e7d7f8f4 100644 --- a/grails-app/domain/rgms/publication/Publication.groovy +++ b/grails-app/domain/rgms/publication/Publication.groovy @@ -8,9 +8,10 @@ abstract class Publication { Date publicationDate String file ResearchLine researchLine + MagazinePublication magPublication static belongsTo = Member - static hasMany = [members: Member, authors: String, magazinePublication: MagazinePublication] + static hasMany = [members: Member, authors: String] static constraints = { title nullable: false, blank: false, size: 1..200 @@ -18,6 +19,7 @@ abstract class Publication { file maxSize: 100000, nullable: true, blank: true researchLine nullable: true, blank: true authors nullable: true, blank: true + magPublication nullable: true, blank: true } //#if($Bibtex) diff --git a/grails-app/i18n/messages.properties b/grails-app/i18n/messages.properties index 05c696f1..d69565b1 100644 --- a/grails-app/i18n/messages.properties +++ b/grails-app/i18n/messages.properties @@ -229,3 +229,6 @@ default.researchproject.import.flashmessage.success = "The non existent Research #if($researchLine) default.researchline.import.flashmessage.success = "The non existent Research Line were successfully imported" #end + +#if($magazinePublication) +magazinePublication.label = "Magazine Publication" \ No newline at end of file diff --git a/grails-app/i18n/messages_pt_BR.properties b/grails-app/i18n/messages_pt_BR.properties index 6d3cc59d..7be43c93 100644 --- a/grails-app/i18n/messages_pt_BR.properties +++ b/grails-app/i18n/messages_pt_BR.properties @@ -223,4 +223,9 @@ default.researchproject.import.flashmessage.success = "Os Projetos de Pesquisa n #if($researchLine) default.researchline.import.flashmessage.success = "As linhas de pesquisa que não existiam foram importadas com sucesso" +#end + +#if($MagazinePublication) +magazinePublication.label = "Publicação em revista" + #end \ No newline at end of file diff --git a/test/cucumber/MagazinePublication.feature b/test/cucumber/MagazinePublication.feature new file mode 100644 index 00000000..f0f55ff2 --- /dev/null +++ b/test/cucumber/MagazinePublication.feature @@ -0,0 +1,57 @@ +@i9n +Feature: "MagazinePublication" + As a member of a research group + I want to add, remove and modify where my publications were published + +Scenario: new magazine publication + Given The article has no magazine with title "Theoretical Computer Science" + When I try to create a magazine publication as "Theoretical Computer Science" + And publication number "21" + And publication place "São Paulo" + And publication year "2013" + Then the "Theoretical Computer Science" is properly stored by the system + +Scenario: new magazine publication web + Given my article was published in the magazine + And I am at Article Page + And its name is "Theoretical Computer Science" + And publication number "21" + And publication page "43-59" + And publication place "São Paulo" + And publication month "Julho" + And publication year "2013" + When I click on New Publication Spot + Then the magazine publication is properly stored by the system + #Format content to "Theoretical Computer Science, São Paulo, n. 2, p. 43-59, jul/2000.’ + #dado que a publicação na revista tem um formato, foi especificado nessa última linha + + Scenario: edit magazine publication page + Given I have a magazine publication entitled "Theoretical Computer Science" + When I want to add or correct the page field + Then I can edit and save the information + +Scenario: edit magazine publication page web + Given I am at Article Page + And I have a magazine publication entitled "Theoretical Computer Science" + And I want to correct the page field + When I click on 'edit' on the section ‘This article was published in:’ + Then I have all the fields filled in + And I can edit the page or any of the fields + And I store it + +####vml##### + +#if($uploadPublicacao) +Scenario: make the upload of the PDF presentation in "Publicacao" + Given I am at Article Page + And I want to upload the "Publicacao.pdf" file + When I choose the file by browsing it + Then The file is properly stored +#end + +#if($uploadPublicacao) +Scenario: make the upload of the PDF presentation in "Publicacao" web + Given I want to upload the PDF presentation "Publicacao.pdf" + When I choose "Publicacao.pdf" file + Then I see it on the list +#end diff --git a/test/cucumber/Publicacao.feature b/test/cucumber/Publicacao.feature deleted file mode 100644 index 6505b210..00000000 --- a/test/cucumber/Publicacao.feature +++ /dev/null @@ -1,57 +0,0 @@ -Feature: "Publicacao" - As a member of a research group - I want to add, remove and modify where my publications were published - -Scenario: new publication spot in magazine - Given I want to add informations of an article that had beed published in a magazine - When I try to name a publication in a magazine as ‘Psicologia: Teoria e Prática’ - And publication number ‘21’ - And publication page ‘43-59’ - And publication place ‘São Paulo’ - And publication date ‘Jul/2013’ - Then this publication is stored - -Scenario: new publication spot in magazine - Given my article was published in the magazine - And its name is ‘Psicologia: Teoria e Prática’ - And publication number ‘21’ - And publication page ‘43-59’ - And publication place ‘São Paulo’ - And publication date ‘Jul/2013’ - When I click on New Publication Spot - Then I am on Article Page with the new information added as at the section as ‘Psicologia: Teoria e Prática, São Paulo, n. 2, p. 43-59, jul/2000.’ -#dado que a publicação na revista tem um formato, foi especificado nessa última linha - -#Nesses dois próximos cenários é garantindo que existe um JavaScript que ajuda -Scenario: edit publication spot in magazine - Given I have all the information of an article published in a magazine - And I want to correct any of the fields - When I am at Article Page - Then I can edit any information - And I store it - -Scenario: edit publication spot in magazine - Given I am at Article Page - I have all the information of an article published in a magazine - And I want to correct any of the fields - When I click on edit on the section ‘This article was published in:’ - Then I have all the fields filled in - And I can edit anything - And I store it - -####vml##### - -#if($uploadPublicacao) -Scenario: make the upload of the PDF presentation in "Publicacao" - Given I am at Article Page - And I want to upload the "Publicacao.pdf" file - When I choose the file by browsing it - Then I click on the "upload" button -#end - -#if($uploadPublicacao) -Scenario: make the upload of the PDF presentation in "Publicacao" - Given I want to upload the PDF presentation "Publicacao.pdf" - When I choose "Publicacao.pdf" file - Then I see it on the list -#end diff --git a/test/cucumber/steps/MagazinePublicationSteps.groovy b/test/cucumber/steps/MagazinePublicationSteps.groovy new file mode 100644 index 00000000..e04bf571 --- /dev/null +++ b/test/cucumber/steps/MagazinePublicationSteps.groovy @@ -0,0 +1,55 @@ +import pages.LoginPage +import pages.ArticlePages.ArticleShowPage +import rgms.publication.MagazinePublication +import steps.MagazinePublicationTestDataAndOperations + +import static cucumber.api.groovy.EN.* + +/** + * Created by Gabriela on 10-Nov-14. + */ + +Given(~'^The article has no magazine with title "([^"]*)"$') {String name -> + magPublication = MagazinePublication.findByName(name) + assert magazine == null +} + +When(~'^I try to create a magazine publication as "([^"]*)" And publication number "([^"]*)" And publication place "([^"]*)" And publication year "([^"]*)"$') + {String name, int number, String place, int year -> + assert MagazinePublicationTestDataAndOperations.createMagPublication(name, number, "", place, "", year) + } + +Then(~'^the "([^"]*)" is properly stored by the system$') + {String title -> magazine = MagazinePublication.findByName(title) + assert MagazinePublicationTestDataAndOperations.compatibleTo(magazine, title) } + + +//Given (~'^I want to add a magazine publication $'){ -> +// Login() +// at ArticleShowPage +// to ArticleShowPage +// page.select("Magazine Publication") +// createNewMagazinePublication() +// to MagazinePage +// at MagazinePage +// } +When (~'^I try to add a magazine publication in the magazine"([^"]*)"$') { String name, int number, String page, String place, String month, String year + -> MagazinePublicationTestDataAndOperations.createMagPublication(name, number, page, place, month, year)} + +Then(~'^the magazine publication is properly stored by the system$'){-> + to ArticleShowPage + at ArticleShowPage +} + +def Login(){ + to LoginPage + at LoginPage + page.fillLoginData("admin", "adminadmin") +} + +def magPublicationCheckIfExists(String name, int number, String place, int year){ + mag = MagazinePublication.findByNameAndNumberAndPlaceAndYear(name, number, place, year); + assert mag == null +} + + diff --git a/test/functional/steps/ArticleTestDataAndOperations.groovy b/test/functional/steps/ArticleTestDataAndOperations.groovy index 390bd57f..a2d3c804 100644 --- a/test/functional/steps/ArticleTestDataAndOperations.groovy +++ b/test/functional/steps/ArticleTestDataAndOperations.groovy @@ -67,7 +67,6 @@ class ArticleTestDataAndOperations { } if(authorName!=null){ cont.params["authors"] = authorName - } cont.request.setContent(new byte[1000]) // Could also vary the request content. cont.create() diff --git a/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy b/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy new file mode 100644 index 00000000..dea0ce9b --- /dev/null +++ b/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy @@ -0,0 +1,63 @@ +package steps + +import rgms.publication.MagazinePublicationController + + +/** + * Created by Gabriela on 12-Nov-14. + */ +class MagazinePublicationTestDataAndOperations { + + static magPublication = [ + [name: "Theoretical Computer Science", number: 40, page: "2-3", + place: "Rio de Janeiro", month: "Junho", year: 2014], + [name: "Science of Computer Programming", number: 3, page: "6-9", + place: "Recife", month: "Janeiro", year: 2012], + [name: "Algebraic reasoning for object-oriented programming", + number: 20, place: "Paraíba", year: 2013], + [name: "Science of Computer Programming", number: 15, pages: "5-7", + year: 2012], + [name: "Cloud Computing", number: 18, place:"Amazônia", year: 2012] + ] + + /*String name + int number + String page nullable + String place + String month nullable + int year + */ + + static public def findMagazineByNotNullParams(String nome, int numero, String place, int year){ + magPublication.find{ magPublication -> + magPublication.name == nome + magPublication.number == numero + magPublication.place == place + magPublication.year == year + } + } + + static public void createMagPublication(String name, int number, String page, String place, String month, String year) { + createMagPub(name, number, page, place, month, year) + } + + static public void createMagPub(String name, int number, String page, String place, String month, String year){ + def control = new MagazinePublicationController(); + control.params << findMagazineByNotNullParams(name, number, page, place, month, year) + control.request.setContent(new byte[1000]) // Could also vary the request content. + control.create() + control.save() + control.response.reset() + } + + static public void editMagPub(String name, int number, String page, String place, String month, String year){ + def control = new MagazinePublicationController(); + control.params << MagazinePublicationTestDataAndOperations.findMagazineByNumber(name, number) + control.request.setContent(new byte[1000]) // Could also vary the request content. + control.create() + control.save() + control.response.reset() + } + + def Login +} From 95ad3b08f0c995fe2129324a90efa1df1621afb3 Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Sun, 23 Nov 2014 22:47:26 -0200 Subject: [PATCH 30/43] Book marks added --- test/cucumber/Book.feature | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index f38875f4..0e4473ef 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -35,7 +35,7 @@ Feature: Book When I go to new book page And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" Then the book "Next Generation Software Product Line Engineering" was stored by the system - +#if($bookOperations) Scenario: remove existing book web Given I am at the book page And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" @@ -47,5 +47,4 @@ Feature: Book Given I am at the book page And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" Then the book list contains "Next Generation Software Product Line Engineering" - - +#end From ef71fee96cfd15e46a0f0e266d11e11672577409 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Wed, 3 Dec 2014 09:32:25 -0300 Subject: [PATCH 31/43] Scenario 1 redefinido - Gabriela MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uma redefinição dos scenarios foi necessária. Estou abandonando MagazinePublication --- test/cucumber/Book.feature | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 3624ed38..bf2125f8 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -23,6 +23,23 @@ Feature: Book Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" When I edit the book title from "SPL Development" to "New Title" Then the book "New Title" is properly updated by the system + +#if($updateExistingBook) + Scenario: update existing book + Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" + When I upload the file in the system with name "newHSPLE.pdf" + Then the archive file "newHSPLE.pdf" is properly updated by the system +#end + +#if($updateExistingBookWeb) + Scenario: update existing book web + Given I am at the book page + And the system has a book entitled "SPL Development" and file name "HSPLE.pdf" + When I click on "Edit book" //eu teria que ser redirecionado pra outra página uma de edição, como eu sei que essa ja existe? + And I click on "Upload file" + And I choose "newHSPLE.pdf" + Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system +#end Scenario: upload book with a file Given the system has no books stored @@ -34,4 +51,4 @@ Feature: Book And the system has no book entitled "Next Generation Software Product Line Engineering" When I go to new book page And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - Then the book "Next Generation Software Product Line Engineering" was stored by the system \ No newline at end of file + Then the book "Next Generation Software Product Line Engineering" was stored by the system From e0b080faae52e99b22d09de87b780b58993ddb29 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Wed, 3 Dec 2014 09:52:45 -0300 Subject: [PATCH 32/43] Scenario 2 redefinido - Gabriela MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scenarios adicionados: update existing book update existing book web Scenario: new book without file Scenario: new book without file web Uma redefinição dos scenarios foi necessária. Estou abandonando MagazinePublication --- test/cucumber/Book.feature | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index bf2125f8..1ca7cb8d 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -41,6 +41,29 @@ Feature: Book Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end +#if($newBookWithoutFile) + Scenario: new book without file + Given the system has no book entitled "SPL Development" + When I try to create the book "SPL Development" without file + Then the book is not created by the system +#end + +#if($newBookWithoutFile) + Scenario: new book without file + Given the system has no book entitled "SPL Development" + When I try to create the book "SPL Development" without file + Then the book is not created by the system +#end + +#if($newBookWithoutFileWeb) + Scenario: new book without file web + Given I am at the book page + And the system has no book entitled "SPL Development" + When I go to new book page + And I try to create the book "SPL Development" without file + Then the system shows a warning message "Book without file, it is mandatory" +#end + Scenario: upload book with a file Given the system has no books stored When I upload the books of "curriculo.xml" From 6cbdf7fd54098a827e9c4f77e04c200767fdef25 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Thu, 11 Dec 2014 15:57:23 -0300 Subject: [PATCH 33/43] Update Book.feature Atualizada segundo os feedbacks de Paulo. --- test/cucumber/Book.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 1ca7cb8d..da1bcc39 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -28,7 +28,7 @@ Feature: Book Scenario: update existing book Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" When I upload the file in the system with name "newHSPLE.pdf" - Then the archive file "newHSPLE.pdf" is properly updated by the system + Then the book "SPL Development" has the archive file "newHSPLE.pdf" updated by the system #end #if($updateExistingBookWeb) @@ -52,14 +52,14 @@ Feature: Book Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then the book is not created by the system + Then this book is not stored by the system #end #if($newBookWithoutFileWeb) Scenario: new book without file web Given I am at the book page And the system has no book entitled "SPL Development" - When I go to new book page + When I select new book page And I try to create the book "SPL Development" without file Then the system shows a warning message "Book without file, it is mandatory" #end From 78d7a9327ca95cadff67c1f600139e044cfa399f Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 29 Dec 2014 13:18:36 -0300 Subject: [PATCH 34/43] =?UTF-8?q?O=20professor=20me=20passou=20que=20a=20c?= =?UTF-8?q?lasse=20magazine=20publication=20j=C3=A1=20estava=20implementad?= =?UTF-8?q?a=20no=20RGMS,=20logo=20troquei=20minhas=20features=20e=20apagu?= =?UTF-8?q?ei=20as=20apari=C3=A7=C3=B5es=20de=20MagazinePublication.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publication/MagazinePublication.groovy | 24 -------- .../domain/rgms/publication/Periodico.groovy | 2 - .../rgms/publication/Publication.groovy | 2 - test/cucumber/MagazinePublication.feature | 57 ------------------- .../steps/MagazinePublicationSteps.groovy | 55 ------------------ .../pages/ArticlePages/ArticleShowPage.groovy | 1 - .../pages/ArticlePages/ArticlesPage.groovy | 7 +++ 7 files changed, 7 insertions(+), 141 deletions(-) delete mode 100644 grails-app/domain/rgms/publication/MagazinePublication.groovy delete mode 100644 test/cucumber/MagazinePublication.feature delete mode 100644 test/cucumber/steps/MagazinePublicationSteps.groovy diff --git a/grails-app/domain/rgms/publication/MagazinePublication.groovy b/grails-app/domain/rgms/publication/MagazinePublication.groovy deleted file mode 100644 index 5602e507..00000000 --- a/grails-app/domain/rgms/publication/MagazinePublication.groovy +++ /dev/null @@ -1,24 +0,0 @@ -package rgms.publication - - -/** - * Created by Gabriela on 10-Nov-14. - */ -class MagazinePublication{ - String name - int number - String page - String place - String month - int year - - static belongsTo = Periodico - - static constraints = {name nullable: false, blank: false, size: 1..50 - number blank: true, size: 1..3 - page nullable: true - place nullable: false - month nullable: true - year nullable: false - } -} diff --git a/grails-app/domain/rgms/publication/Periodico.groovy b/grails-app/domain/rgms/publication/Periodico.groovy index 46eb9a6b..71704757 100644 --- a/grails-app/domain/rgms/publication/Periodico.groovy +++ b/grails-app/domain/rgms/publication/Periodico.groovy @@ -7,14 +7,12 @@ class Periodico extends Publication { int volume int number String pages - MagazinePublication magPublication static constraints = { journal nullable: false, blank: false volume nullable: false, blank: false, min: 1 number nullable: false, blank: false, min: 1 pages nullable: false, blank: false - magPublication nullable: true, blank: true } //#if($Bibtex) diff --git a/grails-app/domain/rgms/publication/Publication.groovy b/grails-app/domain/rgms/publication/Publication.groovy index e7d7f8f4..fd5ba019 100644 --- a/grails-app/domain/rgms/publication/Publication.groovy +++ b/grails-app/domain/rgms/publication/Publication.groovy @@ -8,7 +8,6 @@ abstract class Publication { Date publicationDate String file ResearchLine researchLine - MagazinePublication magPublication static belongsTo = Member static hasMany = [members: Member, authors: String] @@ -19,7 +18,6 @@ abstract class Publication { file maxSize: 100000, nullable: true, blank: true researchLine nullable: true, blank: true authors nullable: true, blank: true - magPublication nullable: true, blank: true } //#if($Bibtex) diff --git a/test/cucumber/MagazinePublication.feature b/test/cucumber/MagazinePublication.feature deleted file mode 100644 index f0f55ff2..00000000 --- a/test/cucumber/MagazinePublication.feature +++ /dev/null @@ -1,57 +0,0 @@ -@i9n -Feature: "MagazinePublication" - As a member of a research group - I want to add, remove and modify where my publications were published - -Scenario: new magazine publication - Given The article has no magazine with title "Theoretical Computer Science" - When I try to create a magazine publication as "Theoretical Computer Science" - And publication number "21" - And publication place "São Paulo" - And publication year "2013" - Then the "Theoretical Computer Science" is properly stored by the system - -Scenario: new magazine publication web - Given my article was published in the magazine - And I am at Article Page - And its name is "Theoretical Computer Science" - And publication number "21" - And publication page "43-59" - And publication place "São Paulo" - And publication month "Julho" - And publication year "2013" - When I click on New Publication Spot - Then the magazine publication is properly stored by the system - #Format content to "Theoretical Computer Science, São Paulo, n. 2, p. 43-59, jul/2000.’ - #dado que a publicação na revista tem um formato, foi especificado nessa última linha - - Scenario: edit magazine publication page - Given I have a magazine publication entitled "Theoretical Computer Science" - When I want to add or correct the page field - Then I can edit and save the information - -Scenario: edit magazine publication page web - Given I am at Article Page - And I have a magazine publication entitled "Theoretical Computer Science" - And I want to correct the page field - When I click on 'edit' on the section ‘This article was published in:’ - Then I have all the fields filled in - And I can edit the page or any of the fields - And I store it - -####vml##### - -#if($uploadPublicacao) -Scenario: make the upload of the PDF presentation in "Publicacao" - Given I am at Article Page - And I want to upload the "Publicacao.pdf" file - When I choose the file by browsing it - Then The file is properly stored -#end - -#if($uploadPublicacao) -Scenario: make the upload of the PDF presentation in "Publicacao" web - Given I want to upload the PDF presentation "Publicacao.pdf" - When I choose "Publicacao.pdf" file - Then I see it on the list -#end diff --git a/test/cucumber/steps/MagazinePublicationSteps.groovy b/test/cucumber/steps/MagazinePublicationSteps.groovy deleted file mode 100644 index e04bf571..00000000 --- a/test/cucumber/steps/MagazinePublicationSteps.groovy +++ /dev/null @@ -1,55 +0,0 @@ -import pages.LoginPage -import pages.ArticlePages.ArticleShowPage -import rgms.publication.MagazinePublication -import steps.MagazinePublicationTestDataAndOperations - -import static cucumber.api.groovy.EN.* - -/** - * Created by Gabriela on 10-Nov-14. - */ - -Given(~'^The article has no magazine with title "([^"]*)"$') {String name -> - magPublication = MagazinePublication.findByName(name) - assert magazine == null -} - -When(~'^I try to create a magazine publication as "([^"]*)" And publication number "([^"]*)" And publication place "([^"]*)" And publication year "([^"]*)"$') - {String name, int number, String place, int year -> - assert MagazinePublicationTestDataAndOperations.createMagPublication(name, number, "", place, "", year) - } - -Then(~'^the "([^"]*)" is properly stored by the system$') - {String title -> magazine = MagazinePublication.findByName(title) - assert MagazinePublicationTestDataAndOperations.compatibleTo(magazine, title) } - - -//Given (~'^I want to add a magazine publication $'){ -> -// Login() -// at ArticleShowPage -// to ArticleShowPage -// page.select("Magazine Publication") -// createNewMagazinePublication() -// to MagazinePage -// at MagazinePage -// } -When (~'^I try to add a magazine publication in the magazine"([^"]*)"$') { String name, int number, String page, String place, String month, String year - -> MagazinePublicationTestDataAndOperations.createMagPublication(name, number, page, place, month, year)} - -Then(~'^the magazine publication is properly stored by the system$'){-> - to ArticleShowPage - at ArticleShowPage -} - -def Login(){ - to LoginPage - at LoginPage - page.fillLoginData("admin", "adminadmin") -} - -def magPublicationCheckIfExists(String name, int number, String place, int year){ - mag = MagazinePublication.findByNameAndNumberAndPlaceAndYear(name, number, place, year); - assert mag == null -} - - diff --git a/test/functional/pages/ArticlePages/ArticleShowPage.groovy b/test/functional/pages/ArticlePages/ArticleShowPage.groovy index fa25e24c..938604cc 100644 --- a/test/functional/pages/ArticlePages/ArticleShowPage.groovy +++ b/test/functional/pages/ArticlePages/ArticleShowPage.groovy @@ -49,4 +49,3 @@ class ArticleShowPage extends Page { } //#end } -//#end diff --git a/test/functional/pages/ArticlePages/ArticlesPage.groovy b/test/functional/pages/ArticlePages/ArticlesPage.groovy index 43f4a3ef..8457c3da 100644 --- a/test/functional/pages/ArticlePages/ArticlesPage.groovy +++ b/test/functional/pages/ArticlePages/ArticlesPage.groovy @@ -131,4 +131,11 @@ class ArticlesPage extends Page { listcheckbox[0].click() listcheckbox[2].click() } + + //if($newMagazinePublication) + def newMagazinePublication(){ + + } + + //end } From e12521a633b81d412a5c39ed409215a9bc2ec4f9 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 29 Dec 2014 19:46:15 -0300 Subject: [PATCH 35/43] =?UTF-8?q?Implementa=C3=A7=C3=A3o=20de=20alguns=20s?= =?UTF-8?q?teps=20pra=20o=20funcionamento=20dos=20testes.=20Sem=20sucesso.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Book.feature | 22 ++++-------------- test/cucumber/steps/BookSteps.groovy | 31 +++++++++++++++++++++----- test/cucumber/steps/ThesisSteps.groovy | 2 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index ed89dfb5..34c89eed 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -34,8 +34,8 @@ Feature: Book #if($updateExistingBookWeb) Scenario: update existing book web Given I am at the book page - And the system has a book entitled "SPL Development" and file name "HSPLE.pdf" - When I click on "Edit book" //eu teria que ser redirecionado pra outra página uma de edição, como eu sei que essa ja existe? + And the book entitled "SPL Development" is stored in the system with file name "HSPLE.pdf" + When I click on "Edit book" And I click on "Upload file" And I choose "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system @@ -45,14 +45,14 @@ Feature: Book Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then the book is not created by the system + Then the book "SPL Development" is not created by the system #end #if($newBookWithoutFile) Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then this book is not stored by the system + Then this book "SPL Development" is not stored by the system #end #if($newBookWithoutFileWeb) @@ -75,17 +75,3 @@ Feature: Book When I go to new book page And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" Then the book "Next Generation Software Product Line Engineering" was stored by the system - - Scenario: remove existing book web - Given I am at the book page - And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - When I choose to view "Next Generation Software Product Line Engineering" in book list - And I press to remove at the book show page - Then the book "Next Generation Software Product Line Engineering" is removed from the system - - Scenario: list existing book web - Given I am at the book page - And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - Then the book list contains "Next Generation Software Product Line Engineering" - - diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 0101e9f2..cb70480d 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -24,7 +24,7 @@ When(~'^I create the book "([^"]*)" with file name "([^"]*)"$') { String title, } Then(~'^the book "([^"]*)" is properly stored by the system$') { String title -> - book = Book.findByTitle(title) + book = BookTestDataAndOperations.findBookByTitle(title) assert BookTestDataAndOperations.bookCompatibleTo(book, title) } @@ -110,10 +110,6 @@ And(~'^I press to remove at the book show page$') {-> at BookShowPage page.select('input', 'delete') } -Then(~'^the article "([^"]*)" is properly removed by the system$') { String title -> - assert checkIfExists(title) -} - Then(~'^the book list contains" ([^"]*)"$') { String title -> @@ -121,7 +117,32 @@ Then(~'^the book list contains" ([^"]*)"$') { String title -> page.checkArticleAtList(title, 0) } +And (~'^the book entitled "([^"]*)" is stored in the system with file name "([^"]*)"'){String title, String filename -> + checkIfExists(title) +} +When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> + BookTestDataAndOperations.uploadBook(fileName) +} + +Then(~'^the book "([^"]*)" has the archive file "([^"]*)" updated by the system$') { String title, String filename -> + checkIfExists(title) + book = Book.findBookByTitle(title) + assert BookTestDataAndOperations.bookCompatibleTo(book, title) +} + +Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on the system$') { String arg1, String arg2 -> + book = BookTestDataAndOperations.findBookByTitle(title) + assert BookTestDataAndOperations.bookCompatibleTo(book, title) +} + +When(~'^I try to create the book "([^"]*)" without file$') { String title -> + BookTestDataAndOperations.createBook(title, null) +} + +Then(~'^the book "([^"]*)" is not created by the system$') {String title -> + !checkIfExists(title) +} def checkIfExists(String title) { book = Book.findByTitle(title) diff --git a/test/cucumber/steps/ThesisSteps.groovy b/test/cucumber/steps/ThesisSteps.groovy index 3144972a..0c2a7427 100644 --- a/test/cucumber/steps/ThesisSteps.groovy +++ b/test/cucumber/steps/ThesisSteps.groovy @@ -269,7 +269,7 @@ And(~'^the system stores properly the thesis entitled "([^"]*)"$') { title -> } -Given (~'^I want to add a "New thesis"') { +Given (~'^I want to add a "New thesis"') { } //FUNÇÔES AUXILIARES def thesisDoNotExists(title) { From d6d40241af2497ecf2bbe68319ba5c3edf45641f Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 19 Jan 2015 11:01:08 -0300 Subject: [PATCH 36/43] $updateExistingBookWeb Aprimoramento no Scenario update existing book web --- test/cucumber/Book.feature | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 34c89eed..f244e7c3 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -35,9 +35,7 @@ Feature: Book Scenario: update existing book web Given I am at the book page And the book entitled "SPL Development" is stored in the system with file name "HSPLE.pdf" - When I click on "Edit book" - And I click on "Upload file" - And I choose "newHSPLE.pdf" + When I edit the book file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end From 9d540bff672afb4161d9f4945334d40532c4e861 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Mon, 19 Jan 2015 13:24:05 -0300 Subject: [PATCH 37/43] =?UTF-8?q?Corre=C3=A7=C3=A3o=20dos=20erros=20dos=20?= =?UTF-8?q?testes=20de=20BookSteps=20e=20adapta=C3=A7=C3=A3o=20de=20Book.f?= =?UTF-8?q?eature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/cucumber/Book.feature | 10 ++++------ test/cucumber/steps/BookSteps.groovy | 14 +++++++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 34c89eed..f15e6596 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -35,9 +35,7 @@ Feature: Book Scenario: update existing book web Given I am at the book page And the book entitled "SPL Development" is stored in the system with file name "HSPLE.pdf" - When I click on "Edit book" - And I click on "Upload file" - And I choose "newHSPLE.pdf" + When I edit the book file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end @@ -52,16 +50,16 @@ Feature: Book Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then this book "SPL Development" is not stored by the system + Then the book "SPL Development" is not created by the system #end #if($newBookWithoutFileWeb) Scenario: new book without file web Given I am at the book page And the system has no book entitled "SPL Development" - When I select new book page + When I go to new book page And I try to create the book "SPL Development" without file - Then the system shows a warning message "Book without file, it is mandatory" + Then I should see an error message containing "Book without file, it is mandatory" #end Scenario: upload book with a file diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index cb70480d..4285e072 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -94,6 +94,7 @@ And(~'^I use the webpage to create the book "([^"]*)" with file name "([^"]*)"$' to BookPage at BookPage } + Then(~'^the book "([^"]*)" was stored by the system$') { String title -> book = Book.findByTitle(title) assert book != null @@ -101,7 +102,6 @@ Then(~'^the book "([^"]*)" was stored by the system$') { String title -> at BookPage } - When(~'^I choose to view "([^"]*)" in book list$') { String title -> page.selectViewBook(title) at BookShowPage @@ -117,7 +117,7 @@ Then(~'^the book list contains" ([^"]*)"$') { String title -> page.checkArticleAtList(title, 0) } -And (~'^the book entitled "([^"]*)" is stored in the system with file name "([^"]*)"'){String title, String filename -> +And (~'^the book entitled "([^"]*)" is stored in the system with file name "([^"]*)$"'){String title, String filename -> checkIfExists(title) } @@ -137,13 +137,21 @@ Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on th } When(~'^I try to create the book "([^"]*)" without file$') { String title -> - BookTestDataAndOperations.createBook(title, null) + !checkIfExists(title) } Then(~'^the book "([^"]*)" is not created by the system$') {String title -> !checkIfExists(title) } +When (~'^I edit the book file name from "([^"]*)" to "([^"]*)$"') {String fileName -> + BookTestDataAndOperations.uploadBook(fileName) +} + +Then (~'I should see an error message containing "([^"]*)"$') { + assert !(page.readFlashMessage() == null) +} + def checkIfExists(String title) { book = Book.findByTitle(title) assert book == null From 13a112a5c3a626ccb79e0506012f9dbe69103a9b Mon Sep 17 00:00:00 2001 From: brilacerda Date: Tue, 20 Jan 2015 17:01:24 -0300 Subject: [PATCH 38/43] Todos os testes criados para Book.feature incluindo os criados por mim, Gabriela Mota, funcionando. --- test/cucumber/Book.feature | 15 ++--- test/cucumber/steps/BookSteps.groovy | 35 +++++------ .../steps/BookTestDataAndOperations.groovy | 18 ++++++ ...inePublicationTestDataAndOperations.groovy | 63 ------------------- 4 files changed, 38 insertions(+), 93 deletions(-) delete mode 100644 test/functional/steps/MagazinePublicationTestDataAndOperations.groovy diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index f15e6596..49b38a50 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -32,9 +32,9 @@ Feature: Book #end #if($updateExistingBookWeb) - Scenario: update existing book web - Given I am at the book page - And the book entitled "SPL Development" is stored in the system with file name "HSPLE.pdf" + Scenario: update existing book web + Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" + And I am at the book page When I edit the book file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end @@ -43,14 +43,7 @@ Feature: Book Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then the book "SPL Development" is not created by the system -#end - -#if($newBookWithoutFile) - Scenario: new book without file - Given the system has no book entitled "SPL Development" - When I try to create the book "SPL Development" without file - Then the book "SPL Development" is not created by the system + Then the book "SPL Development" is not stored by the system #end #if($newBookWithoutFileWeb) diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 4285e072..a50c37db 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -34,6 +34,17 @@ Given(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') assert BookTestDataAndOperations.bookCompatibleTo(book, title) } +When (~'^I edit the book file name from "([^"]*)" to "([^"]*)"$') { String oldFile, newFile -> + at BookPage + page.selectViewBook() + BookTestDataAndOperations.editFile(oldFile, newFile) + page.clickSaveBook() +} + +Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on the system$') { String title, String filename -> + book.getFile().equals(filename) +} + When(~'^I remove the book "([^"]*)"$') { String title -> BookTestDataAndOperations.removeBook(title) } @@ -106,48 +117,34 @@ When(~'^I choose to view "([^"]*)" in book list$') { String title -> page.selectViewBook(title) at BookShowPage } + And(~'^I press to remove at the book show page$') {-> at BookShowPage page.select('input', 'delete') } - Then(~'^the book list contains" ([^"]*)"$') { String title -> at BookPage page.checkArticleAtList(title, 0) } -And (~'^the book entitled "([^"]*)" is stored in the system with file name "([^"]*)$"'){String title, String filename -> - checkIfExists(title) -} - When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> - BookTestDataAndOperations.uploadBook(fileName) + book.setFile(fileName) + assert Book.findByFile(fileName) } Then(~'^the book "([^"]*)" has the archive file "([^"]*)" updated by the system$') { String title, String filename -> - checkIfExists(title) - book = Book.findBookByTitle(title) - assert BookTestDataAndOperations.bookCompatibleTo(book, title) -} - -Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on the system$') { String arg1, String arg2 -> - book = BookTestDataAndOperations.findBookByTitle(title) - assert BookTestDataAndOperations.bookCompatibleTo(book, title) + book.getFile().equals(filename) } When(~'^I try to create the book "([^"]*)" without file$') { String title -> !checkIfExists(title) } -Then(~'^the book "([^"]*)" is not created by the system$') {String title -> +Then(~'^the book "([^"]*)" is not stored by the system$') {String title -> !checkIfExists(title) } -When (~'^I edit the book file name from "([^"]*)" to "([^"]*)$"') {String fileName -> - BookTestDataAndOperations.uploadBook(fileName) -} - Then (~'I should see an error message containing "([^"]*)"$') { assert !(page.readFlashMessage() == null) } diff --git a/test/functional/steps/BookTestDataAndOperations.groovy b/test/functional/steps/BookTestDataAndOperations.groovy index a6a8f379..96122217 100644 --- a/test/functional/steps/BookTestDataAndOperations.groovy +++ b/test/functional/steps/BookTestDataAndOperations.groovy @@ -27,6 +27,12 @@ class BookTestDataAndOperations { } } + static public def findBookByFile(String file) { + books.find { book -> + book.file == file + } + } + static public void createBook(String title, String filename) { def cont = new BookController() cont.params << findBookByTitle(title) << [file: filename] @@ -54,6 +60,18 @@ class BookTestDataAndOperations { return updatedBook } + //created/modified by @gml + static public Book editFile(oldFile, newFile) { + def book = Book.findByFile(oldFile) + book.setFile(newFile) + def cont = new BookController() + cont.params << book.properties + cont.update() + + def updatedBook = Book.findByFile(newFile) + return updatedBook + } + static public void uploadBook(String filename) { def cont = new XMLController() String path = "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename diff --git a/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy b/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy deleted file mode 100644 index dea0ce9b..00000000 --- a/test/functional/steps/MagazinePublicationTestDataAndOperations.groovy +++ /dev/null @@ -1,63 +0,0 @@ -package steps - -import rgms.publication.MagazinePublicationController - - -/** - * Created by Gabriela on 12-Nov-14. - */ -class MagazinePublicationTestDataAndOperations { - - static magPublication = [ - [name: "Theoretical Computer Science", number: 40, page: "2-3", - place: "Rio de Janeiro", month: "Junho", year: 2014], - [name: "Science of Computer Programming", number: 3, page: "6-9", - place: "Recife", month: "Janeiro", year: 2012], - [name: "Algebraic reasoning for object-oriented programming", - number: 20, place: "Paraíba", year: 2013], - [name: "Science of Computer Programming", number: 15, pages: "5-7", - year: 2012], - [name: "Cloud Computing", number: 18, place:"Amazônia", year: 2012] - ] - - /*String name - int number - String page nullable - String place - String month nullable - int year - */ - - static public def findMagazineByNotNullParams(String nome, int numero, String place, int year){ - magPublication.find{ magPublication -> - magPublication.name == nome - magPublication.number == numero - magPublication.place == place - magPublication.year == year - } - } - - static public void createMagPublication(String name, int number, String page, String place, String month, String year) { - createMagPub(name, number, page, place, month, year) - } - - static public void createMagPub(String name, int number, String page, String place, String month, String year){ - def control = new MagazinePublicationController(); - control.params << findMagazineByNotNullParams(name, number, page, place, month, year) - control.request.setContent(new byte[1000]) // Could also vary the request content. - control.create() - control.save() - control.response.reset() - } - - static public void editMagPub(String name, int number, String page, String place, String month, String year){ - def control = new MagazinePublicationController(); - control.params << MagazinePublicationTestDataAndOperations.findMagazineByNumber(name, number) - control.request.setContent(new byte[1000]) // Could also vary the request content. - control.create() - control.save() - control.response.reset() - } - - def Login -} From d842158c52ae50a412935f6d941a552fc0a092ea Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Wed, 21 Jan 2015 00:34:20 -0300 Subject: [PATCH 39/43] new Books steps added new Dissertacao steps added new functions created on: BookShowPage DissertationShowPage DissertationPage BookPage --- test/cucumber/Book.feature | 10 +++--- test/cucumber/Dissertacao.feature | 2 +- test/cucumber/steps/BookSteps.groovy | 23 ++++++++++++-- test/cucumber/steps/DissertacaoSteps.groovy | 20 +++++++++++- test/functional/pages/BookPage.groovy | 8 +++++ test/functional/pages/BookShowPage.groovy | 31 +++++++++++++++++++ test/functional/pages/DissertationPage.groovy | 15 ++++++++- .../pages/DissertationShowPage.groovy | 16 ++++++++-- .../steps/TestDataDissertacao.groovy | 2 +- 9 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 test/functional/pages/BookShowPage.groovy diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index f38875f4..d29133b9 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -36,6 +36,11 @@ Feature: Book And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" Then the book "Next Generation Software Product Line Engineering" was stored by the system + Scenario: list existing book web + Given I am at the book page + And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + Then the book list contains "Next Generation Software Product Line Engineering" + Scenario: remove existing book web Given I am at the book page And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" @@ -43,9 +48,6 @@ Feature: Book And I press to remove at the book show page Then the book "Next Generation Software Product Line Engineering" is removed from the system - Scenario: list existing book web - Given I am at the book page - And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - Then the book list contains "Next Generation Software Product Line Engineering" + diff --git a/test/cucumber/Dissertacao.feature b/test/cucumber/Dissertacao.feature index fdee037b..5eb67b28 100644 --- a/test/cucumber/Dissertacao.feature +++ b/test/cucumber/Dissertacao.feature @@ -39,7 +39,7 @@ Feature: Dissertation Tests And I cant add the dissertation without a file Then the system has no dissertation entitled "Dissertacao sem arquivo" - Scenario: new dissertation with file + Scenario: new dissertation with file Given I am at the publications menu When I select the "Dissertacao" option at the program menu And I select the new dissertation option at the dissertation page diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 0101e9f2..eafa88e8 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -7,6 +7,7 @@ */ import pages.BookCreatePage +import pages.BookShowPage import pages.BookPage import pages.LoginPage import pages.PublicationsPage @@ -110,9 +111,7 @@ And(~'^I press to remove at the book show page$') {-> at BookShowPage page.select('input', 'delete') } -Then(~'^the article "([^"]*)" is properly removed by the system$') { String title -> - assert checkIfExists(title) -} + @@ -123,6 +122,8 @@ Then(~'^the book list contains" ([^"]*)"$') { String title -> + + def checkIfExists(String title) { book = Book.findByTitle(title) assert book == null @@ -134,3 +135,19 @@ def createAndCheckBookOnBrowser(String title, String filename) { book = Book.findByTitle(title) assert book != null } + + +Given(~'^the system has the book entitled "([^"]*)" with file name "([^"]*)"$') { String title, String file -> + book = Book.findByTitleAndFile(title, file) + assert book != null +} + +Then(~'^the book "([^"]*)" is removed from the system$') { String title -> + book = Book.findByTitle(title) + assert book == null +} + +Then(~'^the book list contains "([^"]*)"$') { String title -> + book = Book.findByTitle(title) + assert book != null +} diff --git a/test/cucumber/steps/DissertacaoSteps.groovy b/test/cucumber/steps/DissertacaoSteps.groovy index 73dceeb5..5cb6b3ea 100644 --- a/test/cucumber/steps/DissertacaoSteps.groovy +++ b/test/cucumber/steps/DissertacaoSteps.groovy @@ -6,7 +6,8 @@ import rgms.authentication.User import rgms.publication.Dissertacao import steps.TestDataDissertacao import steps.TestDataAndOperationsPublication - +import pages.LoginPage +import pages.PublicationsPage import static cucumber.api.groovy.EN.* @@ -167,6 +168,23 @@ Then(~'^I stay on dissertation page with an error message$') { -> When(~'^I press to remove "([^"]*)" at the dissertation show page$'){ String title-> + at DissertationShowPage page.select('input', 'delete') } +When(~'^I create the dissertation "([^"]*)" with file name "([^"]*)"$') { String title, String filename -> + TestDataDissertacao.createDissertacao(title, filename, "UFPE") + dissertation = Dissertacao.findByTitle(title) + assert dissertation != null +} + +Given(~'^the dissertation named "([^"]*)" is stored in the system$') { String title -> + TestDataDissertacao.createDissertacao(title, "testDissertation.pdf", "UFPE") + dissertation = Dissertacao.findByTitle(title) + assert dissertation != null +} + +When(~'^I select "([^"]*)" at the dissertation list$') { String title -> + page.selectDissertation(title) +} + diff --git a/test/functional/pages/BookPage.groovy b/test/functional/pages/BookPage.groovy index 2c658d49..c2fdcba0 100644 --- a/test/functional/pages/BookPage.groovy +++ b/test/functional/pages/BookPage.groovy @@ -26,6 +26,14 @@ class BookPage extends Page { } + def selectViewBook(title) { + def listDiv = $('div', id: 'list-book') + def bookTable = (listDiv.find('table'))[0] + def bookRow = bookTable.find('tbody').find('tr') + def showLink = bookRow.find('td').find([text: title]) + showLink.click() + } + def selectNewBook() { $('a.create').click() } diff --git a/test/functional/pages/BookShowPage.groovy b/test/functional/pages/BookShowPage.groovy new file mode 100644 index 00000000..46e923f9 --- /dev/null +++ b/test/functional/pages/BookShowPage.groovy @@ -0,0 +1,31 @@ +package pages + +import geb.Page + +/** + * Created by Casa on 20/01/2015. + */ +class BookShowPage extends Page { + + static url = "book/show" + + static at = { + GetPageTitle gp = new GetPageTitle() + def currentBook = gp.msg("default.book.label") + def currentTitle = gp.msg("default.show.label", [currentBook]) + + title ==~ currentTitle + } + + static content = { + } + + def select(String e, v) { + if (v == 'delete') { + assert withConfirm(true) { $("form").find(e, class: v).click() } + } else { + $("form").find(e, class: v).click() + } + } + +} diff --git a/test/functional/pages/DissertationPage.groovy b/test/functional/pages/DissertationPage.groovy index b510ee72..473f7455 100644 --- a/test/functional/pages/DissertationPage.groovy +++ b/test/functional/pages/DissertationPage.groovy @@ -6,7 +6,11 @@ class DissertationPage extends Page { static url = "dissertacao/list" static at = { - title ==~ /Dissertacao Listagem/ + GetPageTitle gp = new GetPageTitle() + def currentDissertation = gp.msg("default.periodico.label") + def currentTitle = gp.msg("default.list.label", [currentDissertation]) + + title ==~ currentTitle } static content = { @@ -23,6 +27,14 @@ class DissertationPage extends Page { $('input.save').click() } + def selectViewDissertation(title) { + def listDiv = $('div', id: 'list-dissertacao') + def dissertationTable = (listDiv.find('table'))[0] + def dissertationRow = dissertationTable.find('tbody').find('tr') + def showLink = dissertationRow.find('td').find([text: title]) + showLink.click() + } + def checkIfDissertationListIsEmpty(){ def listDiv = $('div', id: 'list-dissertacao') def dissertationTable = (listDiv.find('table'))[0] @@ -31,4 +43,5 @@ class DissertationPage extends Page { assert dissertationColumns.size() < 6 } + } diff --git a/test/functional/pages/DissertationShowPage.groovy b/test/functional/pages/DissertationShowPage.groovy index 30d667a3..eebd00d3 100644 --- a/test/functional/pages/DissertationShowPage.groovy +++ b/test/functional/pages/DissertationShowPage.groovy @@ -8,9 +8,13 @@ import geb.Page; class DissertationShowPage extends Page{ static url = "dissertacao/show" - + static at = { - title ==~ /Ver Dissertacao/ + GetPageTitle gp = new GetPageTitle() + def currentDissertation = gp.msg("default.dissertacao.label") + def currentTitle = gp.msg("default.show.label", [currentDissertation]) + + title ==~ currentTitle } static content = { @@ -26,4 +30,12 @@ class DissertationShowPage extends Page{ $('input.delete').click() } } + + def select(String e, v) { + if (v == 'delete') { + assert withConfirm(true) { $("form").find(e, class: v).click() } + } else { + $("form").find(e, class: v).click() + } + } } diff --git a/test/functional/steps/TestDataDissertacao.groovy b/test/functional/steps/TestDataDissertacao.groovy index a7e034fa..d0dcfb74 100644 --- a/test/functional/steps/TestDataDissertacao.groovy +++ b/test/functional/steps/TestDataDissertacao.groovy @@ -55,7 +55,7 @@ class TestDataDissertacao def testDissertation = Dissertacao.findByTitle(title) def cont = new DissertacaoController() def date = new Date() - cont.params << [id: testDissertation.id] + cont.params << [id: testDissertation?.id] cont.delete() } From dec7a3bbdc8ba841a3c922f29da26b5a827492d4 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Wed, 21 Jan 2015 08:22:25 -0300 Subject: [PATCH 40/43] Update Book.feature Resolvendo Conflito --- test/cucumber/Book.feature | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index f244e7c3..49b38a50 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -32,9 +32,9 @@ Feature: Book #end #if($updateExistingBookWeb) - Scenario: update existing book web - Given I am at the book page - And the book entitled "SPL Development" is stored in the system with file name "HSPLE.pdf" + Scenario: update existing book web + Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" + And I am at the book page When I edit the book file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end @@ -43,23 +43,16 @@ Feature: Book Scenario: new book without file Given the system has no book entitled "SPL Development" When I try to create the book "SPL Development" without file - Then the book "SPL Development" is not created by the system -#end - -#if($newBookWithoutFile) - Scenario: new book without file - Given the system has no book entitled "SPL Development" - When I try to create the book "SPL Development" without file - Then this book "SPL Development" is not stored by the system + Then the book "SPL Development" is not stored by the system #end #if($newBookWithoutFileWeb) Scenario: new book without file web Given I am at the book page And the system has no book entitled "SPL Development" - When I select new book page + When I go to new book page And I try to create the book "SPL Development" without file - Then the system shows a warning message "Book without file, it is mandatory" + Then I should see an error message containing "Book without file, it is mandatory" #end Scenario: upload book with a file From 24911d48481b6ac7ec7e6e0d6232358ce1a079ad Mon Sep 17 00:00:00 2001 From: Jonas Lins Date: Mon, 2 Feb 2015 17:36:34 -0300 Subject: [PATCH 41/43] Testing --- test/cucumber/Book.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index f38875f4..c103f01a 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -48,4 +48,4 @@ Feature: Book And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" Then the book list contains "Next Generation Software Product Line Engineering" - + Testing stuff From 676b179f9ccd2d3bdf4cc1867b12a7e04f16bc76 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Fri, 6 Feb 2015 02:51:44 -0300 Subject: [PATCH 42/43] =?UTF-8?q?Altera=C3=A7=C3=A3o=20em=20alguns=20cen?= =?UTF-8?q?=C3=A1rios=20&=20testes=20visando=20melhor=C3=A1-los=20e=20faz?= =?UTF-8?q?=C3=AA-los=20serem=20compat=C3=ADveis=20com=20a=20refatora?= =?UTF-8?q?=C3=A7=C3=A3o.=20Refatora=C3=A7=C3=A3o=20aplicada=20nas=20class?= =?UTF-8?q?es:=20BookSteps=20,=20BookTestDataAndOperations,=20BookControll?= =?UTF-8?q?ers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rgms/publication/BookController.groovy | 17 ++-- grails-app/views/book/_errors.gsp | 10 ++ test/cucumber/Book.feature | 36 +++---- test/cucumber/steps/BookSteps.groovy | 95 ++++++++++++------- .../pages/ArticlePages/ArticlesPage.groovy | 7 -- test/functional/pages/BookCreatePage.groovy | 7 +- test/functional/pages/BookEditPage.groovy | 40 ++++++++ test/functional/pages/BookPage.groovy | 9 ++ test/functional/pages/BookShowPage.groovy | 34 +++++++ .../steps/BookTestDataAndOperations.groovy | 13 +-- 10 files changed, 193 insertions(+), 75 deletions(-) create mode 100644 grails-app/views/book/_errors.gsp create mode 100644 test/functional/pages/BookEditPage.groovy create mode 100644 test/functional/pages/BookShowPage.groovy diff --git a/grails-app/controllers/rgms/publication/BookController.groovy b/grails-app/controllers/rgms/publication/BookController.groovy index eab9da7a..ac874446 100644 --- a/grails-app/controllers/rgms/publication/BookController.groovy +++ b/grails-app/controllers/rgms/publication/BookController.groovy @@ -28,14 +28,7 @@ class BookController { bookInstance = pb.extractAuthors(bookInstance) - - if (!bookInstance.save(flush: true)) { - render(view: "create", model: [bookInstance: bookInstance]) - return - } - - flash.message = message(code: 'default.created.message', args: [message(code: 'book.label', default: 'Book'), bookInstance.id]) - redirect(action: "show", id: bookInstance.id) + saveAndNotify(bookInstance, "create", 'default.created.message') } def show(Long id) { @@ -80,12 +73,16 @@ class BookController { bookInstance.properties = params + saveAndNotify(bookInstance, "edit", 'default.updated.message') + } + + private saveAndNotify(Book bookInstance, viewParameter, codeParameter ) { if (!bookInstance.save(flush: true)) { - render(view: "edit", model: [bookInstance: bookInstance]) + render(view: viewParameter, model: [bookInstance: bookInstance]) return } - flash.message = message(code: 'default.updated.message', args: [message(code: 'book.label', default: 'Book'), bookInstance.id]) + flash.message = message(code: codeParameter, args: [message(code: 'book.label', default: 'Book'), bookInstance.id]) redirect(action: "show", id: bookInstance.id) } diff --git a/grails-app/views/book/_errors.gsp b/grails-app/views/book/_errors.gsp new file mode 100644 index 00000000..a293139a --- /dev/null +++ b/grails-app/views/book/_errors.gsp @@ -0,0 +1,10 @@ + +
${flash.message}
+
+ + + diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 49b38a50..706d1212 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -23,7 +23,22 @@ Feature: Book Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" When I edit the book title from "SPL Development" to "New Title" Then the book "New Title" is properly updated by the system - + + Scenario: upload book with a file + Given the system has no books stored + When I upload the books of "curriculo.xml" + Then the system has all the books of the xml file + + + + Scenario: new book web + Given I am at the book page + And the system has no book entitled "Next Generation Software Product Line Engineering" + When I go to new book page + And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + Then the book "Next Generation Software Product Line Engineering" was stored by the system + + #if($updateExistingBook) Scenario: update existing book Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" @@ -31,11 +46,11 @@ Feature: Book Then the book "SPL Development" has the archive file "newHSPLE.pdf" updated by the system #end -#if($updateExistingBookWeb) + #if($updateExistingBookWeb) Scenario: update existing book web Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" And I am at the book page - When I edit the book file name from "HSPLE.pdf" to "newHSPLE.pdf" + When I edit the book "SPL Development" file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system #end @@ -49,20 +64,9 @@ Feature: Book #if($newBookWithoutFileWeb) Scenario: new book without file web Given I am at the book page - And the system has no book entitled "SPL Development" + And the system has no book entitled "Design de Interação" When I go to new book page - And I try to create the book "SPL Development" without file + And I use the webpage to create the book "Design de Interação" with file name "" Then I should see an error message containing "Book without file, it is mandatory" #end - Scenario: upload book with a file - Given the system has no books stored - When I upload the books of "curriculo.xml" - Then the system has all the books of the xml file - - Scenario: new book web - Given I am at the book page - And the system has no book entitled "Next Generation Software Product Line Engineering" - When I go to new book page - And I use the webpage to create the book "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" - Then the book "Next Generation Software Product Line Engineering" was stored by the system diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index a50c37db..ce403831 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -8,6 +8,8 @@ import pages.BookCreatePage import pages.BookPage +import pages.BookShowPage +import pages.BookEditPage import pages.LoginPage import pages.PublicationsPage import rgms.publication.Book @@ -28,23 +30,70 @@ Then(~'^the book "([^"]*)" is properly stored by the system$') { String title -> assert BookTestDataAndOperations.bookCompatibleTo(book, title) } +//beginning of @gml's $updateExistingBook steps + Given(~'^the book "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename -> BookTestDataAndOperations.createBook(title, filename) - book = Book.findByTitle(title) + book = Book.findByTitleAndFile(title, filename) assert BookTestDataAndOperations.bookCompatibleTo(book, title) } +Then(~'^the book "([^"]*)" has the archive file "([^"]*)" updated by the system$') { String title, String filename -> + assert book.file.equals(filename) +} + When (~'^I edit the book file name from "([^"]*)" to "([^"]*)"$') { String oldFile, newFile -> - at BookPage - page.selectViewBook() BookTestDataAndOperations.editFile(oldFile, newFile) +} + +When (~'^I edit the book "([^"]*)" file name from "([^"]*)" to "([^"]*)"$'){ String title, oldFilename, newFilename -> + to BookPage + page.selectNewBook() + at BookCreatePage + createAndCheckBookOnBrowser(title, oldFilename) + to BookPage + at BookPage + + page.selectViewBook(title) + //to BookShowPage + at BookShowPage + page.select('input', 'edit') + to BookEditPage + //book.setFile(newFilename) + page.editFilename(newFilename) + System.out.print("Edited to: " + book.file) page.clickSaveBook() } Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on the system$') { String title, String filename -> - book.getFile().equals(filename) + book = Book.findByTitle(title) + System.out.print(book.file) + assert book != null +} + + +When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> + book.setFile(fileName) + assert Book.findByFile(fileName) } +//@gml's $bookWithoutFile steps + +When (~'^I try to create the book "([^"]*)" without file$'){String title -> + !checkIfExists(title) +} + +Then(~'^the book "([^"]*)" is not stored by the system$') {String title -> + !checkIfExists(title) +} + +Then (~'I should see an error message containing "([^"]*)"$') { + assert book == null + assert (page.readFlashMessage() != null) + +} +//end of @gml tests + When(~'^I remove the book "([^"]*)"$') { String title -> BookTestDataAndOperations.removeBook(title) } @@ -80,11 +129,11 @@ When(~'^I upload the books of "([^"]*)"$') { filename -> } Then(~'^the system has all the books of the xml file$') { -> - assert Book.findByTitle("Proceedings of the IV Brazilian Symposium on Programming Languages") != null - assert Book.findByTitle("Testing Techniques in Software Engineering") != null - assert Book.findByTitle("Proceedings of the XXIII Brazilian Symposium on Software Engineering") != null - assert Book.findByTitle("Anais da IV Conferência Latina-Americana em Linguagens de Padrões para Programação (SugarLoafPLoP 2004)") != null - assert Book.findByTitle("AOSD 2011 Proceedings and Companion Material") != null + assert checkIfExists("Proceedings of the IV Brazilian Symposium on Programming Languages") + assert checkIfExists("Testing Techniques in Software Engineering") + assert checkIfExists("Proceedings of the XXIII Brazilian Symposium on Software Engineering") + assert checkIfExists("Anais da IV Conferência Latina-Americana em Linguagens de Padrões para Programação (SugarLoafPLoP 2004)") + assert checkIfExists("AOSD 2011 Proceedings and Companion Material") } Given(~'^I am at the book page$') { -> @@ -107,8 +156,7 @@ And(~'^I use the webpage to create the book "([^"]*)" with file name "([^"]*)"$' } Then(~'^the book "([^"]*)" was stored by the system$') { String title -> - book = Book.findByTitle(title) - assert book != null + checkIfExists(title) to BookPage at BookPage } @@ -128,35 +176,14 @@ Then(~'^the book list contains" ([^"]*)"$') { String title -> page.checkArticleAtList(title, 0) } -When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> - book.setFile(fileName) - assert Book.findByFile(fileName) -} - -Then(~'^the book "([^"]*)" has the archive file "([^"]*)" updated by the system$') { String title, String filename -> - book.getFile().equals(filename) -} - -When(~'^I try to create the book "([^"]*)" without file$') { String title -> - !checkIfExists(title) -} - -Then(~'^the book "([^"]*)" is not stored by the system$') {String title -> - !checkIfExists(title) -} - -Then (~'I should see an error message containing "([^"]*)"$') { - assert !(page.readFlashMessage() == null) -} def checkIfExists(String title) { book = Book.findByTitle(title) - assert book == null + return book != null } def createAndCheckBookOnBrowser(String title, String filename) { page.fillBookDetails(title, filename) page.clickSaveBook() - book = Book.findByTitle(title) - assert book != null + checkIfExists(title) } diff --git a/test/functional/pages/ArticlePages/ArticlesPage.groovy b/test/functional/pages/ArticlePages/ArticlesPage.groovy index 8457c3da..43f4a3ef 100644 --- a/test/functional/pages/ArticlePages/ArticlesPage.groovy +++ b/test/functional/pages/ArticlePages/ArticlesPage.groovy @@ -131,11 +131,4 @@ class ArticlesPage extends Page { listcheckbox[0].click() listcheckbox[2].click() } - - //if($newMagazinePublication) - def newMagazinePublication(){ - - } - - //end } diff --git a/test/functional/pages/BookCreatePage.groovy b/test/functional/pages/BookCreatePage.groovy index b4768335..bd1bd481 100644 --- a/test/functional/pages/BookCreatePage.groovy +++ b/test/functional/pages/BookCreatePage.groovy @@ -28,11 +28,14 @@ class BookCreatePage extends FormPage { } def fillBookDetails(title, filename) { - fillTitle(title) + $("form").title = title $("form").publisher = "Person" $("form").volume = 1 $("form").pages = "20" - $("form").file = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename + if(!filename.equals("")){ + $("form").file = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename + } + clickSaveBook() } def clickSaveBook() { diff --git a/test/functional/pages/BookEditPage.groovy b/test/functional/pages/BookEditPage.groovy new file mode 100644 index 00000000..961e50fa --- /dev/null +++ b/test/functional/pages/BookEditPage.groovy @@ -0,0 +1,40 @@ +package pages; + +import geb.Page +import rgms.publication.Book +import steps.BookTestDataAndOperations + +/** + * Created by Gabriela on 04-Feb-15. + */ +public class BookEditPage extends Page { + static url = "book/edit" + + static at = { + GetPageTitle gp = new GetPageTitle() + def currentBook = gp.msg("default.book.label") + def currentTitle = gp.msg("default.edit.label", [currentBook]) + + title ==~ currentTitle + } + + static content = { + publisher { + $("input", id: "publisher") + } + } + + def editFilename(String filename) { + $("form").file = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename + clickSaveBook() + } + + def select(String s) { + $("form").find("input", value: s).click() + } + + def clickSaveBook() { + $("form").save().click() + } +} + diff --git a/test/functional/pages/BookPage.groovy b/test/functional/pages/BookPage.groovy index 2c658d49..3a3788a4 100644 --- a/test/functional/pages/BookPage.groovy +++ b/test/functional/pages/BookPage.groovy @@ -29,4 +29,13 @@ class BookPage extends Page { def selectNewBook() { $('a.create').click() } + + def selectViewBook(title) { + def listDiv = $('div', id: 'list-book') + def articleTable = (listDiv.find('table'))[0] + def articleRow = articleTable.find('tbody').find('tr') + def showLink = articleRow.find('td').find([text: title]) + showLink.click() + } + } \ No newline at end of file diff --git a/test/functional/pages/BookShowPage.groovy b/test/functional/pages/BookShowPage.groovy new file mode 100644 index 00000000..0facb840 --- /dev/null +++ b/test/functional/pages/BookShowPage.groovy @@ -0,0 +1,34 @@ +package pages + +import geb.Page + +/** + * Created by Casa on 20/01/2015. + */ +class BookShowPage extends Page { + + static url = "book/show/1" + + static at = { + GetPageTitle gp = new GetPageTitle() + def currentBook = gp.msg("default.book.label") + def currentTitle = gp.msg("default.show.label", [currentBook]) + + title ==~ currentTitle + } + + static content = { + } + + def select(String e, v) { + if (v == 'delete') { + assert withConfirm(true) { $("form").find(e, class: v).click() } + } else { + $("form").find(e, class: v).click() + } + } + + def selectEdit(String s){ + $('e', text: s).click() + } +} \ No newline at end of file diff --git a/test/functional/steps/BookTestDataAndOperations.groovy b/test/functional/steps/BookTestDataAndOperations.groovy index 96122217..2d5de416 100644 --- a/test/functional/steps/BookTestDataAndOperations.groovy +++ b/test/functional/steps/BookTestDataAndOperations.groovy @@ -52,21 +52,22 @@ class BookTestDataAndOperations { static public Book editBook(oldtitle, newtitle) { def book = Book.findByTitle(oldtitle) book.setTitle(newtitle) + createEditedBookAndUpdate(book) + def updatedBook = Book.findByTitle(newtitle) + return updatedBook + } + + private static createEditedBookAndUpdate(Book book) { def cont = new BookController() cont.params << book.properties cont.update() - - def updatedBook = Book.findByTitle(newtitle) - return updatedBook } //created/modified by @gml static public Book editFile(oldFile, newFile) { def book = Book.findByFile(oldFile) book.setFile(newFile) - def cont = new BookController() - cont.params << book.properties - cont.update() + createEditedBookAndUpdate(book) def updatedBook = Book.findByFile(newFile) return updatedBook From 249491e40cdce11df08cb6c5117b473ec5f24ea8 Mon Sep 17 00:00:00 2001 From: brilacerda Date: Fri, 6 Feb 2015 15:38:47 -0300 Subject: [PATCH 43/43] Pequenos Ajustes em BookSteps, BookEditPage --- test/cucumber/Book.feature | 13 ++++++++- test/cucumber/steps/BookSteps.groovy | 33 +++++++++-------------- test/functional/pages/BookEditPage.groovy | 9 +++---- test/functional/pages/BookPage.groovy | 9 ------- test/functional/pages/BookShowPage.groovy | 5 ++++ 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 8a8ce6f0..08024465 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -46,7 +46,7 @@ Feature: Book #if($updateExistingBookWeb) Scenario: update existing book web - Given the book "SPL Development" is stored in the system with file name "HSPLE.pdf" + Given the system has the book entitled "SPL Development" with file name "HSPLE.pdf" And I am at the book page When I edit the book "SPL Development" file name from "HSPLE.pdf" to "newHSPLE.pdf" Then I have the book entitled "SPL Development" with file name "newHSPLE.pdf" stored on the system @@ -68,3 +68,14 @@ Feature: Book Then I should see an error message containing "Book without file, it is mandatory" #end + Scenario: list existing book web + Given I am at the book page + And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + Then the book list contains "Next Generation Software Product Line Engineering" + + Scenario: remove existing book web + Given I am at the book page + And the system has the book entitled "Next Generation Software Product Line Engineering" with file name "Ngs.pdf" + When I choose to view "Next Generation Software Product Line Engineering" in book list + And I press to remove at the book show page + Then the book "Next Generation Software Product Line Engineering" is removed from the system \ No newline at end of file diff --git a/test/cucumber/steps/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 18a83a42..44230891 100644 --- a/test/cucumber/steps/BookSteps.groovy +++ b/test/cucumber/steps/BookSteps.groovy @@ -47,31 +47,21 @@ When (~'^I edit the book file name from "([^"]*)" to "([^"]*)"$') { String oldFi } When (~'^I edit the book "([^"]*)" file name from "([^"]*)" to "([^"]*)"$'){ String title, oldFilename, newFilename -> - to BookPage - page.selectNewBook() - at BookCreatePage - createAndCheckBookOnBrowser(title, oldFilename) - to BookPage at BookPage - page.selectViewBook(title) - //to BookShowPage - at BookShowPage - page.select('input', 'edit') + to BookShowPage + //at BookShowPage + page.select("input", "edit") to BookEditPage - //book.setFile(newFilename) page.editFilename(newFilename) - System.out.print("Edited to: " + book.file) page.clickSaveBook() } Then(~'^I have the book entitled "([^"]*)" with file name "([^"]*)" stored on the system$') { String title, String filename -> - book = Book.findByTitle(title) - System.out.print(book.file) + book = Book.findByTitleAndFile(title, filename) assert book != null } - When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> book.setFile(fileName) assert Book.findByFile(fileName) @@ -171,10 +161,6 @@ And(~'^I press to remove at the book show page$') {-> page.select('input', 'delete') } -Then(~'^the article "([^"]*)" is properly removed by the system$') { String title -> - assert checkIfExists(title) -} - Then(~'^the book list contains" ([^"]*)"$') { String title -> at BookPage page.checkArticleAtList(title, 0) @@ -193,7 +179,13 @@ def createAndCheckBookOnBrowser(String title, String filename) { Given(~'^the system has the book entitled "([^"]*)" with file name "([^"]*)"$') { String title, String file -> book = Book.findByTitleAndFile(title, file) - assert book != null + if(book == null){ + to BookPage + page.selectNewBook() + at BookCreatePage + createAndCheckBookOnBrowser(title, file) + to BookPage + } } Then(~'^the book "([^"]*)" is removed from the system$') { String title -> @@ -202,6 +194,5 @@ Then(~'^the book "([^"]*)" is removed from the system$') { String title -> } Then(~'^the book list contains "([^"]*)"$') { String title -> - book = Book.findByTitle(title) - assert book != null + checkIfExists(title) } diff --git a/test/functional/pages/BookEditPage.groovy b/test/functional/pages/BookEditPage.groovy index 961e50fa..8d8f3e9e 100644 --- a/test/functional/pages/BookEditPage.groovy +++ b/test/functional/pages/BookEditPage.groovy @@ -8,7 +8,7 @@ import steps.BookTestDataAndOperations * Created by Gabriela on 04-Feb-15. */ public class BookEditPage extends Page { - static url = "book/edit" + static url = "book/edit/12" static at = { GetPageTitle gp = new GetPageTitle() @@ -24,9 +24,8 @@ public class BookEditPage extends Page { } } - def editFilename(String filename) { - $("form").file = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename - clickSaveBook() + def editFilename(String newFile) { + $("form").file = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + newFile } def select(String s) { @@ -34,7 +33,7 @@ public class BookEditPage extends Page { } def clickSaveBook() { - $("form").save().click() + $("form").find(class: "save").click() } } diff --git a/test/functional/pages/BookPage.groovy b/test/functional/pages/BookPage.groovy index 1dc94dcb..c2fdcba0 100644 --- a/test/functional/pages/BookPage.groovy +++ b/test/functional/pages/BookPage.groovy @@ -37,13 +37,4 @@ class BookPage extends Page { def selectNewBook() { $('a.create').click() } - - def selectViewBook(title) { - def listDiv = $('div', id: 'list-book') - def articleTable = (listDiv.find('table'))[0] - def articleRow = articleTable.find('tbody').find('tr') - def showLink = articleRow.find('td').find([text: title]) - showLink.click() - } - } \ No newline at end of file diff --git a/test/functional/pages/BookShowPage.groovy b/test/functional/pages/BookShowPage.groovy index 87d843dc..eb5bb4eb 100644 --- a/test/functional/pages/BookShowPage.groovy +++ b/test/functional/pages/BookShowPage.groovy @@ -17,11 +17,16 @@ class BookShowPage extends Page { } static content = { + book { + $('input', id: 'book') + } } def select(String e, v) { if (v == 'delete') { assert withConfirm(true) { $("form").find(e, class: v).click() } + } else if (v == "edit"){ + $("form").find(e, class: "edit").click() } else { $("form").find(e, class: v).click() }