Skip to content

Commit

Permalink
[#95303030][#95302992][#95303018][#95303000] Modificações nos cenário…
Browse files Browse the repository at this point in the history
…s da feature reports
  • Loading branch information
PauloLuna committed May 28, 2015
1 parent 276a906 commit 6f26836
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 1,651 deletions.
20 changes: 10 additions & 10 deletions grails-app/views/membership/_form.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@



<div class="fieldcontain ${hasErrors(bean: membershipInstance, field: 'dateLeft', 'error')} ">
<label for="dateLeft">
<g:message code="membership.dateLeft.label" default="Date Left" />

</label>
<g:datePicker name="dateLeft" precision="day" value="${membershipInstance?.dateLeft}" default="none" noSelection="['': '']" />
</div>

<div class="fieldcontain ${hasErrors(bean: membershipInstance, field: 'dateJoined', 'error')} required">
<label for="dateJoined">
<g:message code="membership.dateJoined.label" default="Date Joined" />
Expand All @@ -10,27 +18,19 @@
<g:datePicker name="dateJoined" precision="day" value="${membershipInstance?.dateJoined}" />
</div>

<div class="fieldcontain ${hasErrors(bean: membershipInstance, field: 'dateLeft', 'error')} required">
<label for="dateLeft">
<g:message code="membership.dateLeft.label" default="Date Left" />
<span class="required-indicator">*</span>
</label>
<g:datePicker name="dateLeft" precision="day" value="${membershipInstance?.dateLeft}" />
</div>

<div class="fieldcontain ${hasErrors(bean: membershipInstance, field: 'member', 'error')} required">
<label for="member">
<g:message code="membership.member.label" default="Member" />
<span class="required-indicator">*</span>
</label>
<g:select id="member" name="member.id" from="${rgms.Member.list()}" optionKey="id" required="" value="${membershipInstance?.member?.id}" class="many-to-one"/>
<g:select id="member" name="member.id" from="${rgms.member.Member.list()}" optionKey="id" required="" value="${membershipInstance?.member?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: membershipInstance, field: 'researchGroup', 'error')} required">
<label for="researchGroup">
<g:message code="membership.researchGroup.label" default="Research Group" />
<span class="required-indicator">*</span>
</label>
<g:select id="researchGroup" name="researchGroup.id" from="${rgms.ResearchGroup.list()}" optionKey="id" required="" value="${membershipInstance?.researchGroup?.id}" class="many-to-one"/>
<g:select id="researchGroup" name="researchGroup.id" from="${rgms.member.ResearchGroup.list()}" optionKey="id" required="" value="${membershipInstance?.researchGroup?.id}" class="many-to-one"/>
</div>

8 changes: 4 additions & 4 deletions grails-app/views/membership/list.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<thead>
<tr>

<g:sortableColumn property="dateJoined" title="${message(code: 'membership.dateJoined.label', default: 'Date Joined')}" />

<g:sortableColumn property="dateLeft" title="${message(code: 'membership.dateLeft.label', default: 'Date Left')}" />

<g:sortableColumn property="dateJoined" title="${message(code: 'membership.dateJoined.label', default: 'Date Joined')}" />

<th><g:message code="membership.member.label" default="Member" /></th>

<th><g:message code="membership.researchGroup.label" default="Research Group" /></th>
Expand All @@ -38,9 +38,9 @@
<g:each in="${membershipInstanceList}" status="i" var="membershipInstance">
<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

<td><g:link action="show" id="${membershipInstance.id}">${fieldValue(bean: membershipInstance, field: "dateJoined")}</g:link></td>
<td><g:link action="show" id="${membershipInstance.id}">${fieldValue(bean: membershipInstance, field: "dateLeft")}</g:link></td>

<td><g:formatDate date="${membershipInstance.dateLeft}" /></td>
<td><g:formatDate date="${membershipInstance.dateJoined}" /></td>

<td>${fieldValue(bean: membershipInstance, field: "member")}</td>

Expand Down
12 changes: 6 additions & 6 deletions grails-app/views/membership/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
</g:if>
<ol class="property-list membership">

<g:if test="${membershipInstance?.dateJoined}">
<g:if test="${membershipInstance?.dateLeft}">
<li class="fieldcontain">
<span id="dateJoined-label" class="property-label"><g:message code="membership.dateJoined.label" default="Date Joined" /></span>
<span id="dateLeft-label" class="property-label"><g:message code="membership.dateLeft.label" default="Date Left" /></span>

<span class="property-value" aria-labelledby="dateJoined-label"><g:formatDate date="${membershipInstance?.dateJoined}" /></span>
<span class="property-value" aria-labelledby="dateLeft-label"><g:formatDate date="${membershipInstance?.dateLeft}" /></span>

</li>
</g:if>

<g:if test="${membershipInstance?.dateLeft}">
<g:if test="${membershipInstance?.dateJoined}">
<li class="fieldcontain">
<span id="dateLeft-label" class="property-label"><g:message code="membership.dateLeft.label" default="Date Left" /></span>
<span id="dateJoined-label" class="property-label"><g:message code="membership.dateJoined.label" default="Date Joined" /></span>

<span class="property-value" aria-labelledby="dateLeft-label"><g:formatDate date="${membershipInstance?.dateLeft}" /></span>
<span class="property-value" aria-labelledby="dateJoined-label"><g:formatDate date="${membershipInstance?.dateJoined}" /></span>

</li>
</g:if>
Expand Down
8 changes: 4 additions & 4 deletions grails-app/views/researchGroup/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@

<!-- #if($XML) -->
<div class="my_div"><g:jasperReport jasper="report" format="XML" name="export" style="display: block">
<input type="hidden" name="researchGroup_id" value="${researchGroupInstance?.id}"/>
<input type="hidden" name="research_group_id " value="${researchGroupInstance?.id}"/>
</g:jasperReport>
</div>
<!-- #end -->

<!-- #if($HTML) -->
<div class="my_div"><g:jasperReport jasper="report" format="HTML" name="export" style="display: block">
<input type="hidden" name="researchGroup_id" value="${researchGroupInstance?.id}"/>
<div class="my_div"><g:jasperReport jasper="researchGroup" format="HTML" name="export" style="display: block">
<input type="hidden" name="research_group_id" value="${researchGroupInstance?.id}"/>
</g:jasperReport>
</div>
<!-- #end -->

<!-- #if($PDF) -->
<div class="my_div"><g:jasperReport jasper="report" format="PDF" name="export" style="display: block">
<input type="hidden" name="researchGroup_id" value="${researchGroupInstance?.id}"/>
<input type="hidden" name="research_group_id" value="${researchGroupInstance?.id}"/>
</g:jasperReport>
</div>
<!-- #end -->
Expand Down
45 changes: 31 additions & 14 deletions test/cucumber/Reports.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
Feature: Reports
I want to generate PDF, HTML or XML report files of Members, Research Groups and News

Scenario: export existent member report to html
Given I am at the Member list page
When I select the "1" option at the Member list
And I can select the option Export to HTML at the Member show
Then I can generate a HTML report about Member "1"
And I can see a photography of the Member
And I can see a description about the member
And I can see a list of Menber publications


Scenario: export existent member report to xml
Given I am at the Member list page
Expand Down Expand Up @@ -171,11 +164,7 @@ Feature: Reports
Then The system generate a HTML report with the news "The first news" in it
#end

Scenario: export a existent research group report to html
Given I am in research group list page
When I select "RGMSGroup" option at the research group list
And I select the option "export to html" at the research group show
Then I export a html report about resourch group "RGMSGroup"


Scenario: export a existent news report to html
Given I am in News list page
Expand Down Expand Up @@ -219,4 +208,32 @@ Feature: Reports
And there is not member created
When I select the "Member" option
Then I view that the member list is empty
And I can not select the option "Export to html"
And I can not select the option "Export to html"


#iniciado aqui

Scenario: export research group report to HTML
Given I have a ResearchGroup registered in the system
And I am at ResearchGroupShowPage
When I select HTML Export option
Then I go to ResearchGroupReportHTMLPage


Scenario: export research group report to XML
Given I have a ResearchGroup registered in the system
And I am at ResearchGroupShowPage
When I select XML Export option
Then I receive a download link to XML Report

Scenario: export research group report to PDF
Given I have a ResearchGroup registered in the system
And I am at ResearchGroupShowPage
When I select PDF Export option
Then I receive a download link to PDF Report

Scenario: Include basic ResearchGroup information in ResearchGroup Report
Given I have a ResearchGroup registered in the system
When I go to ResearchGroupReportHTMLPage
Then I can see the ResearchGroup basic information on page

20 changes: 20 additions & 0 deletions test/cucumber/steps/ReportsSteps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,26 @@ Then(~'^I can see a error message$'){ ->
assert (page.readFlashMessage() != null)
}*/
//-----------------------------------------------------------------------------------------------------------------------------------------------
//jp start here

Given(~'^I have a ResearchGroup registered in the system$') { ->
researchGroup = ResearchGroup.getAll()
assert researchGroup.size() == 1
}

And(~'^I am at ResearchGroupShowPage$') { ->
at ResearchGroupShowPage
}

When(~'^I select XML Export option$') { ->
page.clickXML()
}

Then(~'^I receive a download link to XML Report$') { ->

}




//-------------------------------------------------------------------------
Expand Down
17 changes: 14 additions & 3 deletions test/functional/pages/ResearchGroup/ResearchGroupShowPage.groovy
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package pages.ResearchGroup

import geb.Page
import pages.GetPageTitle

class ResearchGroupShowPage extends Page {
static url = "researchGroup/show/1"

static at = {

title ==~ /Ver Grupo de Pesquisa/

GetPageTitle gp = new GetPageTitle()
def memberLabel = gp.msg("researchGroup.label")
def createLabel = gp.msg("default.create.label", [researchGroupLabel])
title ==~ createLabel
}

static content = {
Expand All @@ -32,6 +34,15 @@ class ResearchGroupShowPage extends Page {
assert html != null
}

def clickHtml() {
def html = $('form').find([title: "HTML"]).click()
}

def clickXML() {
def html = $('form').find([title: "XML"]).click()
}


def checkXml() {
def xml = $('form').find([title: "XML"])
assert xml != null
Expand Down
Loading

0 comments on commit 6f26836

Please sign in to comment.