-
+
- data-field-id="${error.field}">
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/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy index 42066943..26347d30 100644 --- a/grails-app/conf/BuildConfig.groovy +++ b/grails-app/conf/BuildConfig.groovy @@ -39,6 +39,7 @@ grails.project.dependency.resolution = { } dependencies { // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg. + compile 'commons-codec:commons-codec:1.6' test("org.codehaus.geb:geb-junit4:$gebVersion") test("org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion") test("org.seleniumhq.selenium:selenium-support:$seleniumVersion") 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/grails-app/i18n/META-INF/MANIFEST.MF b/grails-app/i18n/META-INF/MANIFEST.MF new file mode 100644 index 00000000..15007978 --- /dev/null +++ b/grails-app/i18n/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: rgms.ShiroDbRealm + 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..16d02e0a 100644 --- a/grails-app/i18n/messages_pt_BR.properties +++ b/grails-app/i18n/messages_pt_BR.properties @@ -223,4 +223,5 @@ 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 \ No newline at end of file +#end + diff --git a/grails-app/views/magazinePublication/_form.gsp b/grails-app/views/magazinePublication/_form.gsp new file mode 100644 index 00000000..447a25bd --- /dev/null +++ b/grails-app/views/magazinePublication/_form.gsp @@ -0,0 +1,52 @@ +<%@ page import="rgms.publication.MagazinePublication" %> + + + +
| ${fieldValue(bean: magazinePublicationInstance, field: "number")} | + +${fieldValue(bean: magazinePublicationInstance, field: "page")} | + +${fieldValue(bean: magazinePublicationInstance, field: "place")} | + +${fieldValue(bean: magazinePublicationInstance, field: "month")} | + +${fieldValue(bean: magazinePublicationInstance, field: "year")} | + +
Information gathered from the controller: ${randomString}
+ +| ID | +Name | +Age | +
|---|---|---|
| ${id} | +${name} | +${age} | +
| styled with css... | +||
+
+
+
+ Favorite food: ${pdf?.food}
+Favorite food: ${pdf?.food.toString()}
+Hometown: ${pdf?.hometown}
+ +${pdf}
+ +Images with relative URL's are automatically resolved by the the modified version of XHTMLrenderer included with the plugin
+
+
+ Images with absolute URI's also do just fine:
+
+
+ Hint: One way to style gsp's that you intend to make into pdf's is to have two seperate style sheets one for media="print" and one for media="screen". The print style sheet will be used to style the PDF, and if PDF generation fails you will get a styled HTML view that isn't all weird because of fonts sized in pt and such.
+ + diff --git a/grails-app/views/pdf/demo.gsp b/grails-app/views/pdf/demo.gsp new file mode 100644 index 00000000..2abd5023 --- /dev/null +++ b/grails-app/views/pdf/demo.gsp @@ -0,0 +1,342 @@ + + + + +| Description | +Sample Source/HTML output | +In Action | +
|---|---|---|
| URL method examples: | ||
| Simple Usage: | +
+ <g:pdfLink url="/pdf/demo2">PDF View</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?url=%2Fpdf%2Fdemo2">
+ |
+ ||
| Simple Usage w/ Get data: | +
+ <g:pdfLink url="/pdf/demo2/5?name=bob&age=22">PDF View</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?url=%2Fpdf%2Fdemo2%2F5%3Fname%3Dbob%26age%3D22">
+ |
+ ||
| Custom filename | +
+ <g:pdfLink url="/pdf/demo2.gsp" filename="sample.pdf">sample.pdf</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?url=%2Fpdf%2Fdemo2.gsp&filename=sample.pdf">
+ |
+ ||
| Bundled icon | +
+ <g:pdfLink url="/pdf/demo2.gsp" filename="sample.pdf" icon="true"/>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?url=%2Fpdf%2Fdemo2.gsp&filename=sample.pdf">
+ |
+ ||
| Bundled icon w/ link content | +
+ <g:pdfLink url="/pdf/demo2.gsp" filename="sample.pdf" icon="true" class="myPdfLink">Custom link</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="myPdfLink" title="pdf" href="/pdf/pdf/pdfLink?url=%2Fpdf%2Fdemo2.gsp&filename=sample.pdf">
+ |
+ ||
| String method examples: | ||
| Simple Template Usage: | +
+ <g:pdfLink template="demo2">template as PDF</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?template=demo2&filename=document.pdf">
+ |
+ ||
| Simple Controller Action Usage (action and id are optional): | +
+ <g:pdfLink pdfController="pdf" pdfAction="demo2">GSP as PDF</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?&pdfController=pdf&pdfAction=demo2">
+ |
+ ||
| Simple Controller Action + Id Usage: | +
+ <g:pdfLink pdfController="pdf" pdfAction="demo2" pdfId="65432">GSP as PDF</g:pdfLink>
+ |
+
+ |
+
+
+ <a class="pdf" title="pdf" href="/pdf/pdf/pdfLink?&pdfController=pdf&pdfAction=demo2&pdfId=65432">
+ |
+ ||
| Description | +Sample Source/HTML output | +In Action | +
|---|---|---|
| GET method examples: | ||
| Simple Usage: | +
+ <g:pdfForm url="/pdf/demo2">...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="get" action="/pdf/pdf/pdfForm" name="simplePdfForm">
+ |
+ ||
| w/ Id and Filename: | +
+ <g:pdfForm url="/pdf/demo2/1968" filename="sample.pdf">...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="get" action="/pdf/pdf/pdfForm" name="simplePdfForm">
+ |
+ ||
| POST method examples: | ||
| Controller and Action: | +
+ <g:pdfForm controller="pdf" action="demo3" method="post">...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="post" action="/pdf/pdf/pdfForm" name="simplePdfForm">
+ |
+ ||
| Controller, Action, Id and Filename: | +
+ <g:pdfForm controller="pdf" action="demo3" method="post">...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="post" action="/pdf/pdf/pdfForm" name="simplePdfForm">
+ |
+ ||
| Template: | +
+ <g:pdfForm template="demo2" >...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="post" action="/pdf/pdf/pdfForm2" name="simplePdfForm">
+ |
+ ||
| Template and Filename: | +
+ <g:pdfForm template="demo2" filename="sample.pdf">...</g:pdfForm>
+ |
+
+ + |
+
+
+ <form id="simplePdfForm" method="post" action="/pdf/pdf/pdfForm2" name="simplePdfForm">
+ |
+ ||
Information gathered from the controller: ${randomString}
+ +| ID | +Name | +Age | +
|---|---|---|
| ${id} | +${name} | +${age} | +
| styled with css... | +||
+
+
+
+
+ Images with relative URL's are automatically resolved by the the modified version of XHTMLrenderer included with the plugin
+
+
+ Images with absolute URI's also do just fine:
+
+
+ Hint: One way to style gsp's that you intend to make into pdf's is to have two seperate style sheets one for media="print" and one for media="screen". The print style sheet will be used to style the PDF, and if PDF generation fails you will get a styled HTML view that isn't all weird because of fonts sized in pt and such.
+ + diff --git a/grails-app/views/pdf/demo3.gsp b/grails-app/views/pdf/demo3.gsp new file mode 100644 index 00000000..7d7140c9 --- /dev/null +++ b/grails-app/views/pdf/demo3.gsp @@ -0,0 +1,73 @@ + + + + +Information gathered from the controller: ${randomString}
+ +| ID | +Name | +Age | +
|---|---|---|
| ${id} | +${name} | +${age} | +
| styled with css... | +||
Favorite food: ${pdf?.food}
+Favorite food: ${pdf?.food.toString()}
+Hometown: ${pdf?.hometown}
+ +${pdf}
+ +Images with relative URL's are automatically resolved by the the modified version of XHTMLrenderer included with the plugin
+
+
+ Images with absolute URI's also do just fine:
+
+
+ Hint: One way to style gsp's that you intend to make into pdf's is to have two seperate style sheets one for media="print" and one for media="screen". The print style sheet will be used to style the PDF, and if PDF generation fails you will get a styled HTML view that isn't all weird because of fonts sized in pt and such.
+ +Varialbles passed into gsp that the plugin will render as PDF need to start with pdf. so for example the form field name was hometown and to reference that varialbe here we needed {pdf.hometown}
+
+ ${content}
+
+
+
diff --git a/grails-app/views/pdf/sampleInclude.gsp b/grails-app/views/pdf/sampleInclude.gsp
new file mode 100644
index 00000000..2938d1c8
--- /dev/null
+++ b/grails-app/views/pdf/sampleInclude.gsp
@@ -0,0 +1,10 @@
+
+
+
+
+ ${bar}
+${today}
+${tomorrow}
+ + diff --git a/test/cucumber/Article.feature b/test/cucumber/Article.feature index 01606f0d..b1fc1660 100644 --- a/test/cucumber/Article.feature +++ b/test/cucumber/Article.feature @@ -27,10 +27,32 @@ Feature: journal article 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 article page + And I want to add a new article + Then I can fill the article details + And It may include the "publication" information +#end + +#if ($publicationInformation) + Scenario: new article web with publication + 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 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" When I delete the article "A theory of software product line refinement" @@ -101,7 +123,24 @@ Feature: journal article 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 diff --git a/test/cucumber/Book.feature b/test/cucumber/Book.feature index 3624ed38..a2b9cc9c 100644 --- a/test/cucumber/Book.feature +++ b/test/cucumber/Book.feature @@ -23,6 +23,37 @@ 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 book "SPL Development" has the archive file "newHSPLE.pdf" updated by the system +#end + +#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" + 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 "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 go to new book page + And I try to create the book "SPL Development" without file + 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 @@ -34,4 +65,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: 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 + + 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/Dissertacao.feature b/test/cucumber/Dissertacao.feature index 98a20dd2..5afc8355 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,11 +39,6 @@ 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 Given I am at the publications menu When I select the "Dissertacao" option at the program menu @@ -58,18 +53,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 @@ -90,4 +83,19 @@ 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 + +#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 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 diff --git a/test/cucumber/Orientation.feature b/test/cucumber/Orientation.feature index 6ca3f5e4..87a15cbe 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 of "Mestrado" + When I select to view the list of orientation + 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 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 + + 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 diff --git a/test/cucumber/Thesis.feature b/test/cucumber/Thesis.feature index e664276f..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" @@ -106,3 +126,4 @@ 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 + 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/BookSteps.groovy b/test/cucumber/steps/BookSteps.groovy index 45aae835..f1bded3c 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 @@ -16,7 +17,7 @@ import steps.BookTestDataAndOperations import static cucumber.api.groovy.EN.* Given(~'^the system has no book entitled "([^"]*)"$') { String title -> - checkIfExists(title) + assert !checkIfExists(title) } When(~'^I create the book "([^"]*)" with file name "([^"]*)"$') { String title, filename -> @@ -34,12 +35,23 @@ 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) } Then(~'^the book "([^"]*)" is properly removed by the system$') { String title -> - checkIfExists(title) + assert !checkIfExists(title) } Then(~'^the book "([^"]*)" is not stored twice$') { String title -> @@ -88,7 +100,6 @@ 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) @@ -97,20 +108,69 @@ 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 + assert checkIfExists(title) to BookPage at BookPage } + +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) +} + +When(~'^I upload the file in the system with name "([^"]*)"$') { String fileName -> + book.setFile(fileName) + assert Book.findByFile(fileName) +} + +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 "([^"]*)" has the archive file "([^"]*)" updated by the system$') { String title, String filename -> + book.getFile().equals(filename) +} + +Then(~'^the book "([^"]*)" is removed from the system$') { String title -> + + assert !checkIfExists(title) +} + +Then(~'^the book list contains "([^"]*)"$') { String title -> + assert checkIfExists(title) +} + +When(~'^I try to create the book "([^"]*)" without file$') { String title -> + assert !checkIfExists(title) +} + +Then(~'^the book "([^"]*)" is not stored by the system$') { String title -> + assert !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 + book != null } def createAndCheckBookOnBrowser(String title, String filename) { page.fillBookDetails(title, filename) page.clickSaveBook() - book = Book.findByTitle(title) - assert book != null + assert checkIfExists(title) } \ No newline at end of file diff --git a/test/cucumber/steps/DissertacaoSteps.groovy b/test/cucumber/steps/DissertacaoSteps.groovy index 03cd3324..9647c0ba 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.* @@ -26,8 +27,7 @@ When(~'^I can add the dissertation with a file "([^"]*)"$'){ String filename-> page.fillDissertationDetailsWithFile(path) } Then((~'^the system has a dissertation entitled "([^"]*)"$')){ String title-> - article = Dissertacao.findByTitle(title) - assert article != null + assert checkIfExists(title) } @@ -62,19 +62,17 @@ Given(~'^the system has no dissertation entitled "([^"]*)"$') { String title -> Given(~'^the dissertation "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, filename -> TestDataDissertacao.createDissertacao(title, filename, "UFPE") - article = Dissertacao.findByTitle(title) - assert article != null + assert checkIfExists(title) } -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) } Then(~'^the dissertation "([^"]*)" is properly stored by the system$') { String title -> - dissertation = Dissertacao.findByTitle(title) - assert dissertation != null + assert checkIfExists(title) } Then(~'^the dissertation "([^"]*)" is not stored twice$') { String title -> @@ -101,20 +99,9 @@ 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 - inicialSize = Dissertacao.findAll().size() - TestDataDissertacao.uploadDissertacao(path) - finalSize = Dissertacao.findAll().size() - assert inicialSize < finalSize + uploadDissertationFile(filename) //para funcionar é necessario que tenha um FilePath válido // não consegui fazer de uma maneira que todos os passos sejam independentes } @@ -131,11 +118,7 @@ Given(~'^the system has some dissertation stored$'){-> When(~'^I upload a new dissertation "([^"]*)" with title "([^"]*)"$') { filename, String title -> - String path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "functional" + File.separator + "steps" + File.separator + filename - inicialSize = Dissertacao.findAll().size() - TestDataDissertacao.uploadDissertacao(path) - finalSize = Dissertacao.findAll().size() - assert inicialSize