Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equipe 4 - Atividade 6 #319

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Alteração e correções de cenários
criação de passos de testes em "conferenciaSteps"
  • Loading branch information
Micael authored and Micael committed Jun 17, 2014
commit e2bd130dcad13a163b093741870d4b97cdf03f90
29 changes: 12 additions & 17 deletions test/cucumber/Conferencia.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Feature: conferencia
And the conferencias are not stored by the system

Scenario: edit existing conference
Given the system has conference entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf"
Given the system has conferencia entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf"
When I change the conference file from "SPLC.pdf" to "SPLC2.pdf"
Then the conference "IV Conference on Software Product Lines" is properly updated by the system

Scenario: edit existing conference web
Given I am at the conference page
And the conference "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf"
When I select to view "IV Conference on Software Product Lines" in resulting list
And the conference entitled "IV Conference on Software Product Lines" is stored in the system with file name "SPLC.pdf"
When I select to view the conference "IV Conference on Software Product Lines" in resulting list
And I change the conference file to "SPLC2.pdf"
And I select the "Alterar" option in Conference Registration Page
And A success message is displayed
Expand All @@ -101,36 +101,31 @@ Scenario: new invalid conference web (fields blank)
Scenario: list existing conference
Given the system has conference entitled "IV Conference on Software Product Lines" with file name "SPLC.pdf"
When I view the conference list
Then my conference list contains "IV Conference on Software Product Lines"
Then the conference list contains "IV Conference on Software Product Lines"

Scenario: Order conference web by title
Given I am at the conference page
When I click on the column "title" at the conference list table
then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order
Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order

Scenario: Order conference web by conference data
Given I am at the conference page
When I click on the column "Date" at the conference list table
then a list of conferences stored by the system is displayed at the conference page by publication ascending date order
Then a list of conferences stored by the system is displayed at the conference page by publication ascending date order

Scenario: Order conference web by research line
Given I am at the conference page
When I click on the column "Research Line" at the conference list table
then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order

Scenario: Go to search page
Given I am at the conference page
When I select the Search Conference option
Then I am at the search conference page
Then a list of conferences stored by the system is displayed at the conference page by ascending alphabetic order

Scenario: Search for conference
Given the system has conference entitled "IV Conference on Software Product Lines"
When I search for the conferencia entitled "IV Conference on Software Product Lines"
Then theres no change in the data stored by the system.

Scenario: Search for conference web by date
Given I am at the Seach Conference page
And the system has conference dated "2007"
Scenario: Search for conference web
Given I am at the conference page
And the system has conference dated "2007"
When I write "2007" at the date field
And I select the option Serach for Conference at the conference page
then a list of all conferences containing that date will be presented in the conference screen
And I select the option Search for Conference at the conference page
Then a list of all conferences containing the date "2007" will be presented in the conference screen
158 changes: 157 additions & 1 deletion test/cucumber/steps/ConferenciaSteps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,86 @@ Given(~'^the system has no conferencia entitled "([^"]*)"$') { String title ->
conferencia = Conferencia.findByTitle(title)
assert conferencia == null
}
//#if(ConferenciaFeature)
Given(~'^the system has conference entitled "([^"]*)" with a file name "([^"]*)"$') { String title ->
conferencia = Conferencia.findByTitle(title)
assert conferencia != null
}
//#end

//#if(ConferenciaFeature)
When(~'^I change the conference file from "([^"]*)" to "([^"]*)"$') { String filename ->
ConferenciaTestDataAndOperations.editConferencia(filename)
}
//#end

//#if(ConferenciaFeature)
And(~'^I change the conferencia file to "([^"]*)"$') { String newarchive ->
page.select('a', 'edit')
at ConferenceEditPage
def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator
page.edit(path + newarchive)
}
//#end

//#if(ConferenciaFeature)
Given(~'^I am at the conference page$') {->
at ConferenciaPage
}
//#end

//#if(ConferenciaFeature)
And(~'^the conferencia entitled "([^"]*)" is stored in the system with file name "([^"]*)"$') { String title, String filename ->
ConferenciaTestDataAndOperations.createConferencia(title, filename)
conferencia = Conferencia.findByTitle(title)
assert conferencia != null
}
//#end

//#if(ConferenciaFeature)
When(~'^I select to view the conference "([^"]*)" in resulting list$') { String title ->
page.selectViewConference(title)
at ConferenceShowPage
}
//#end

//#if(ConferenciaFeature)
And(~'^I change the conference file to "([^"]*)"$') { String newfile ->
// page.select('a', 'edit')
// at ArticleEditPage
def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator
page.edit(path + newfile)
}
//#end

//#if(ConferenciaFeature)
And(~'^I select the "Alterar" option in Conference Registration Page$') { String newfile ->
page.select('a', 'edit')
at ConferenciaEditPage
}
//#end

//#if(ConferenciaFeature)
Given(~'^I am at the conference registration page$') {
at ConferenciaEditPage
}
//#end

//#if(ConferenciaFeature)
Then(~'^the conference is not stored by the system because it is invalid$') {
finalSize = Conferencia.findAll().size()
assert initialSize == finalSize
}
//#end

//#if(ConferenciaFeature)
When(~'^I create the conference with some field blank$') {
at ConferenciaCreatePage
page.fillConferenciaDetailsPartially()
assert page.isSomeConferenciaFildsBlank()
}
//#end


When(~'^I create the conferencia "([^"]*)" with file name "([^"]*)"$') { String title, String filename ->
ConferenciaTestDataAndOperations.createConferencia(title, filename)
Expand Down Expand Up @@ -144,4 +224,80 @@ And(~'^the conferencias are not stored by the system$') {->
at ConferenciaPage
page.checkIfConferenciaListIsEmpty()

}
}

//#if(ConferenciaFeature)
When(~'^I click on the column "Date" at the conferencia list table$') {->
at ConferenciaPage
page.selectColumn("Date")
}
//#end

//#if(ConferenciaFeature)
Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending date order$') {->
at ConferenciaPage
page.listConferencia()
page.orderListConferencia("Date")
}
//#end

//#if(ConferenciaFeature)
When(~'^I click on the column "Research Line" at the conferencia list table$') {->
at ConferenciaPage
page.selectColumn("Research Line")
}
//#end

//#if(ConferenciaFeature)
Then(~'^a list of conferencias stored by the system is displayed at the conferencia page by publication ascending alphabetic order$') {->
at ConferenciaPage
page.listConferencia()
page.orderListConferencia("Research Line")
}
//#end

//#if(ConferenciaFeature)
When(~'^I select the search conferencia option at the conferencia page$') {->
at ConferenciaPage
page.selectSearchConferencia()
}
//#end

//#if(ConferenciaFeature)
When(~'^I search for the conferencia "([^"]*)"$') { String title ->
ConferenciaTestDataAndOperations.searchConferencia(title)
}
//#end

//#if(ConferenciaFeature)
Then(~'^there is no change in the data stored by the system$') {

}
//#end

//#if(ConferenciaFeature)
And(~'^The system has conference dated "([^"]*)"$') {String date->
conferencia = Conferencia.findByDate(date)
}
//#end

//#if(ConferenciaFeature)
When(~'^I write "([^"]*)" at the date field$') {String date->
at ConferenciaPage
page.fillDateField(date)
}
//#end

//#if(ConferenciaFeature)
When(~'^I select the option Search for Conference at the conference page$') {->
at at ConferenciaPage
page.selectSearchConferencia()
}
//#end

//#if(ConferenciaFeature)
Then(~'^a list of all conferences containing the date "([^"]*)" will be presented in the conference screen$') { String date->
at ConferenciaPage
page.FindByDate(date)
}
//#end