mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-08 10:18:50 +01:00
get further testing tunning for projects
This commit is contained in:
parent
7c9102453c
commit
cde8ad35fd
8 changed files with 94 additions and 49 deletions
|
|
@ -8,8 +8,8 @@ Feature: Edit a project
|
|||
Given the following user record
|
||||
| login | password | is_admin |
|
||||
| testuser | secret | false |
|
||||
And I have logged in as "testuser" with password "secret"
|
||||
And there exists a project "manage me" for user "testuser"
|
||||
And I have logged in as "testuser" with password "secret"
|
||||
|
||||
@selenium
|
||||
Scenario: I can describe the project using markup
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ Feature: Manage the list of projects
|
|||
Given the following user record
|
||||
| login | password | is_admin |
|
||||
| testuser | secret | false |
|
||||
And I have logged in as "testuser" with password "secret"
|
||||
And there exists a project "manage me" for user "testuser"
|
||||
And there exists a project "upgrade jquery" for user "testuser"
|
||||
And there exists a project "a project name starting with a" for user "testuser"
|
||||
And I have logged in as "testuser" with password "secret"
|
||||
|
||||
Scenario: The list of project contain all projects
|
||||
When I go to the projects page
|
||||
|
|
@ -38,13 +38,16 @@ Feature: Manage the list of projects
|
|||
And the badge should show 2
|
||||
And the project list badge for "active" projects should show 2
|
||||
|
||||
@selenium
|
||||
@selenium, @wip
|
||||
Scenario: Changing project state will move project to other state list
|
||||
When I go to the projects page
|
||||
Then the project "manage me" should be in state list "active"
|
||||
And the project list badge for "active" projects should show 3
|
||||
When I edit the project state of "manage me" to "hidden"
|
||||
Then the project "manage me" should not be in state list "active"
|
||||
And the project "manage me" should be in state list "hidden"
|
||||
And the project list badge for "active" projects should show 2
|
||||
And the project list badge for "hidden" projects should show 1
|
||||
|
||||
Scenario: Dragging a project to change list order of projects
|
||||
Scenario: Adding a new project
|
||||
|
|
|
|||
|
|
@ -9,6 +9,20 @@ When /^I delete project "([^"]*)"$/ do |project_name|
|
|||
end
|
||||
end
|
||||
|
||||
Then /^the project "([^"]*)" should not be in state list "([^"]*)"$/ do |project_name, state_name|
|
||||
project = @current_user.projects.find_by_name(project_name)
|
||||
project.should_not be_nil
|
||||
xpath = "//div[@id='list-#{state_name}-projects-container']//div[@id='project_#{project.id}']"
|
||||
response.should_not have_xpath(xpath)
|
||||
end
|
||||
|
||||
Then /^the project "([^"]*)" should be in state list "([^"]*)"$/ do |project_name, state_name|
|
||||
project = @current_user.projects.find_by_name(project_name)
|
||||
project.should_not be_nil
|
||||
xpath = "//div[@id='list-#{state_name}-projects-container']//div[@id='project_#{project.id}']"
|
||||
response.should have_xpath(xpath)
|
||||
end
|
||||
|
||||
Then /^the project list badge for "([^"]*)" projects should show (\d+)$/ do |state_name, count|
|
||||
selenium.get_text("css=span##{state_name}-projects-count").should == count
|
||||
end
|
||||
|
|
@ -42,8 +42,8 @@ end
|
|||
|
||||
When /^I edit the project name to "([^\"]*)"$/ do |new_title|
|
||||
click_link "link_edit_project_#{@project.id}"
|
||||
|
||||
# no need to wait for the form because the AJAX loading should not be async!
|
||||
selenium.wait_for_element("xpath=//div[@id='edit_project_#{@project.id}']/form//button[@id='submit_project_#{@project.id}']")
|
||||
|
||||
fill_in "project[name]", :with => new_title
|
||||
|
||||
# changed to make sure selenium waits until the saving has a result either
|
||||
|
|
@ -61,6 +61,28 @@ When /^I edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_current_n
|
|||
When "I edit the project name to \"#{project_new_name}\""
|
||||
end
|
||||
|
||||
|
||||
When /^I edit the project state of "([^"]*)" to "([^"]*)"$/ do |project_name, state_name|
|
||||
project = @current_user.projects.find_by_name(project_name)
|
||||
project.should_not be_nil
|
||||
|
||||
click_link "link_edit_project_#{project.id}"
|
||||
selenium.wait_for_element("xpath=//div[@id='edit_project_#{project.id}']/form//button[@id='submit_project_#{project.id}']")
|
||||
|
||||
choose "project_state_#{state_name}"
|
||||
|
||||
# changed to make sure selenium waits until the saving has a result either
|
||||
# positive or negative. Was: :element=>"flash", :text=>"Project saved"
|
||||
# we may need to change it back if you really need a positive outcome, i.e.
|
||||
# this step needs to fail if the project was not saved successfully
|
||||
selenium.click "submit_project_#{project.id}",
|
||||
:wait_for => :text,
|
||||
:text => /(Project saved|1 error prohibited this project from being saved)/
|
||||
|
||||
selenium.wait_for_element("list-#{state_name}-projects-container")
|
||||
|
||||
end
|
||||
|
||||
Then /^I should see the bold text "([^\"]*)" in the project description$/ do |bold|
|
||||
xpath="//div[@class='project_description']/p/strong"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue