Skip to content

Commit

Permalink
Adicionando testes para a nova funcionalidade de importar dados do XM…
Browse files Browse the repository at this point in the history
…L para ResearchLine
  • Loading branch information
Bruno Silva committed Feb 23, 2014
1 parent ec4e964 commit 4f42505
Show file tree
Hide file tree
Showing 5 changed files with 3,517 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/cucumber/ResearchLine.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Feature: research line
When I select the "Linha de pesquisa" option at the publications menu
And I select the new research line option at the research line page
Then I can fill the research line details

Scenario: visualize research line web
Given I am logged as admin
And the system has a research line named as "Teoria da informacao - Complexidade no espaco"
Expand All @@ -44,3 +45,17 @@ Feature: research line
And I click the research line "Teoria da informacao - Complexidade no espaco" at the research line list
When I click the edit button
Then I can change the research line "Teoria da informacao - Complexidade no espaco" details

#if ($XMLUpload)
Scenario: upload research line with a file
Given the system has some research line stored
When I upload a new reseach line "testelattes2.xml"
Then the system has more reseach lines now

Scenario: upload reseach lines with a file
Given I am at the publications menu
When I select the "Linha de pesquisa" option at the program menu
And I select the upload button at the research line page
Then I'm still on research line page
And an error message is showed at research line page
#end
48 changes: 48 additions & 0 deletions test/cucumber/steps/ResearchLineSteps.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import rgms.publication.ResearchLine
import steps.ResearchLineTestDataAndOperations
import steps.TestDataAndOperations
import steps.TestDataAndOperationsResearchLine
import pages.ResearchLineCreatePage
Expand Down Expand Up @@ -105,3 +106,50 @@ Then(~'^I can change the research line "([^"]*)" details$') {String name->
at ResearchLineEditPage
page.changeResearchLineDetails(name)
}

Given(~'^the system has some research line stored$'){ ->
TestDataAndOperations.loginController(this)
}

When(~'^I upload a new reseach line "([^"]*)"$') { filename ->
inicialSize = ResearchLine.findAll().size()
def path = new File(".").getCanonicalPath() + File.separator + "test" + File.separator + "files" + File.separator
ResearchLineTestDataAndOperations.uploadOrientation(path + filename)
}

Then(~'^the system has more reseach lines now$'){ ->
TestDataAndOperations.logoutController(this)
finalSize = ResearchLine.findAll().size()
assert inicialSize < finalSize
}

When(~'^I select the upload button at the research line page$'){ ->
at ResearchLinePage
page.uploadWithoutFile()
}

Then(~'^I\'m still on research line page$'){ ->
at ResearchLinePage
}

Then(~'an error message is showed at research line page$'){ ->
at ResearchLinePage
page.hasErrorUploadXML()
}


//Funções Auxiliares
private void goToResearchLineCreatePage(){
to LoginPage
at LoginPage
page.fillLoginData("admin", "adminadmin")

to PublicationsPage
at PublicationsPage
page.select("Linha de pesquisa")

at ResearchLinePage
page.selectNewResearchLine()

at ResearchLineCreatePage
}
Loading

0 comments on commit 4f42505

Please sign in to comment.