Merge branch 'dev' of github.com:opf/openproject into dev

pull/1366/head
Richard 11 years ago
commit ee27d48c46
  1. 2
      features/projects/copy_project.feature
  2. 2
      features/step_definitions/common_steps.rb
  3. 94
      features/step_definitions/web_steps.rb
  4. 4
      features/timelines/timeline_modal_views.feature
  5. 33
      features/users/status.feature
  6. 4
      features/work_packages/index_move_columns.feature
  7. 3
      features/work_packages/moves/work_package_moves_new_copy.feature
  8. 2
      features/work_packages/work_package_show.feature

@ -202,7 +202,7 @@ Feature: Project Settings
Then I should see "foo" within "#content"
And I follow "foo" within "#content"
Then I should see "Alice Alison" within "#content"
And I should see "FOO" within "#content"
And I should see "foo" within "#content"
And I should see "Bob Bobbit" within "#content"
And I should see "version1" within "#content"
And I should see "Description" within "#content"

@ -77,4 +77,4 @@ end
Then(/^"([^"]*)" should be the first row in table$/) do |name|
should have_selector("table.list tbody tr td", :text => Regexp.new("#{name}"))
end
end

@ -172,60 +172,38 @@ When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
end
Then /^(?:|I )should see "([^"]*)"$/ do |text|
if page.respond_to? :should
page.should have_content(text)
else
assert page.has_content?(text)
end
regexp = Regexp.new(Regexp.escape(text), Regexp::IGNORECASE)
page.should have_content(regexp)
end
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
regexp = Regexp.new(regexp)
if page.respond_to? :should
page.should have_xpath('//*', :text => regexp)
else
assert page.has_xpath?('//*', :text => regexp)
end
page.should have_xpath('//*', :text => regexp)
end
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
if page.respond_to? :should
page.should have_no_content(text)
else
assert page.has_no_content?(text)
end
regexp = Regexp.new(Regexp.escape(text), Regexp::IGNORECASE)
page.should have_no_content(regexp)
end
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
regexp = Regexp.new(regexp)
if page.respond_to? :should
page.should have_no_xpath('//*', :text => regexp)
else
assert page.has_no_xpath?('//*', :text => regexp)
end
page.should have_no_xpath('//*', :text => regexp)
end
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
with_scope(parent) do
field = find_field(field)
if field.value.respond_to? :should
field.value.should =~ /#{value}/
else
assert_match(/#{value}/, field.value)
end
field.value.should =~ /#{value}/
end
end
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
with_scope(parent) do
field = find_field(field)
if field.value.respond_to? :should_not
field.value.should_not =~ /#{value}/
else
assert_no_match(/#{value}/, field.value)
end
field.value.should_not =~ /#{value}/
end
end
@ -237,66 +215,36 @@ Then /^the "([^"]*)" field should have the error "([^"]*)"$/ do |field, error_me
using_formtastic = form_for_input[:class].include?('formtastic')
error_class = using_formtastic ? 'error' : 'field_with_errors'
if classes.respond_to? :should
classes.should include(error_class)
else
assert classes.include?(error_class)
end
classes.should include(error_class)
if page.respond_to?(:should)
if using_formtastic
error_paragraph = element.find(:xpath, '../*[@class="inline-errors"][1]')
error_paragraph.should have_content(error_message)
else
page.should have_content("#{field.titlecase} #{error_message}")
end
if using_formtastic
error_paragraph = element.find(:xpath, '../*[@class="inline-errors"][1]')
error_paragraph.should have_content(error_message)
else
if using_formtastic
error_paragraph = element.find(:xpath, '../*[@class="inline-errors"][1]')
assert error_paragraph.has_content?(error_message)
else
assert page.has_content?("#{field.titlecase} #{error_message}")
end
page.should have_content("#{field.titlecase} #{error_message}")
end
end
Then /^the "([^"]*)" field should have no error$/ do |field|
element = find_field(field)
classes = element.find(:xpath, '..')[:class].split(' ')
if classes.respond_to? :should
classes.should_not include('field_with_errors')
classes.should_not include('error')
else
assert !classes.include?('field_with_errors')
assert !classes.include?('error')
end
classes.should_not include('field_with_errors')
classes.should_not include('error')
end
Then /^the (hidden )?"([^"]*)" checkbox should be checked$/ do |hidden, label |
field_checked = find_field(label, :visible => hidden.nil?)['checked']
if field_checked.respond_to? :should
field_checked.should be_true
else
assert field_checked
end
field_checked.should be_true
end
Then /^the (hidden )?"([^"]*)" checkbox should not be checked$/ do |hidden, label |
field_checked = find_field(label, :visible => hidden.nil?)['checked']
if field_checked.respond_to? :should
field_checked.should be_false
else
assert !field_checked
end
field_checked.should be_false
end
Then /^(?:|I )should be on (.+)$/ do |page_name|
current_path = URI.parse(current_url).path
if current_path.respond_to? :should
current_path.should == path_to(page_name)
else
assert_equal path_to(page_name), current_path
end
current_path.should == path_to(page_name)
end
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
@ -305,11 +253,7 @@ Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
expected_params = {}
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
if actual_params.respond_to? :should
actual_params.should == expected_params
else
assert_equal expected_params, actual_params
end
actual_params.should == expected_params
end
Then /^show me the page$/ do

@ -79,12 +79,12 @@ Feature: Timeline View Tests
And I wait for timeline to load table
And I click on the Planning Element with name "January"
Then I should see a modal window
And I should see "#1: JANUARY" in the modal
And I should see "#1: January" in the modal
And I should see "http://google.de" in the modal
And I should see "01/01/2012" in the modal
And I should see "01/31/2012" in the modal
And I should see "New timeline report"
And I should be on the page of the timeline "Testline" of the project called "ecookbook"
When I ctrl-click on "#2" in the modal
Then I should see "FEBRUARY" in the new window
Then I should see "February" in the new window
Then I should see "Avocado Rincon" in the new window

@ -63,28 +63,31 @@ Feature: User Status
@javascript
Scenario: Users can be filtered by status
# had to append the 'within ".list tbody"' in order to avoid the "I should
# (not) see "admin"' step to find the "OpenProject Admin" string for the
# logged in user as well as the "Administrator" string in the table header.
Given the user "bobby" had too many recently failed logins
And I filter the users list by status "active (1)"
Then I should not see "bobby"
And I should see "admin"
And I should not see "Anonymous"
Then I should not see "bobby" within ".list tbody"
And I should see "admin" within ".list tbody"
And I should not see "Anonymous" within ".list tbody"
And I filter the users list by status "locked temporarily (1)"
Then I should see "bobby"
And I should not see "admin"
And I should not see "Anonymous"
Then I should see "bobby" within ".list tbody"
And I should not see "admin" within ".list tbody"
And I should not see "Anonymous" within ".list tbody"
When the user "bobby" is locked
And I filter the users list by status "locked permanently (1)"
Then I should see "bobby"
And I should not see "admin"
And I should not see "Anonymous"
Then I should see "bobby" within ".list tbody"
And I should not see "admin" within ".list tbody"
And I should not see "Anonymous" within ".list tbody"
And I filter the users list by status "locked temporarily (1)"
Then I should see "bobby"
And I should not see "admin"
And I should not see "Anonymous"
Then I should see "bobby" within ".list tbody"
And I should not see "admin" within ".list tbody"
And I should not see "Anonymous" within ".list tbody"
And I filter the users list by status "all (2)"
Then I should see "bobby"
And I should see "admin"
And I should not see "Anonymous"
Then I should see "bobby" within ".list tbody"
And I should see "admin" within ".list tbody"
And I should not see "Anonymous" within ".list tbody"
@javascript
Scenario: User can be unlocked on the index page

@ -70,7 +70,7 @@ Feature: Disabled done ratio on the work package index
And I click the toolbar button named "Filter"
And I click "Options"
And I select to see column "Author"
Then I should see "AUTHOR" within ".workpackages-table"
Then I should see "Author" within ".workpackages-table"
@javascript
Scenario: Subject column should not be displayed when Subject is moved out of selected columns
@ -78,4 +78,4 @@ Feature: Disabled done ratio on the work package index
And I click the toolbar button named "Filter"
And I click "Options"
And I select to not see column "Subject"
Then I should not see "SUBJECT" within ".workpackages-table"
Then I should not see "Subject" within ".workpackages-table"

@ -114,7 +114,6 @@ Feature: Copying a work package
And I should see "project_2" within ".breadcrumb"
@javascript
Scenario: Move an issue to project with missing type
When I go to the move page of the work package "issue3"
And I select "project_1" from "Project"
@ -130,7 +129,7 @@ Feature: Copying a work package
| issue1 |
| issue2 |
And I follow "Copy" within "#work-package-context-menu"
Then I should see "COPY" within "#content"
Then I should see "Copy" within "#content"
And I should not see "Move" within "#content"
# FIXME: Please check this: is this the same issue as reported in #1868

@ -154,7 +154,7 @@ Feature: Viewing a work package
When I go to the page of the work package "issue1"
When I select "Copy" from the action menu
Then I should see "COPY"
Then I should see "Copy"
@javascript
Scenario: For an issue move leads to work package copy page

Loading…
Cancel
Save