Fix spinach test

This commit is contained in:
Clement Ho 2017-06-06 16:58:44 -05:00
parent b6bded14be
commit f1dc6b57d7
4 changed files with 8 additions and 6 deletions

View file

@ -12,11 +12,13 @@ Feature: Project Issues
Given I should see "Release 0.4" in issues
And I should not see "Release 0.3" in issues
@javascript
Scenario: I should see closed issues
Given I click link "Closed"
Then I should see "Release 0.3" in issues
And I should not see "Release 0.4" in issues
@javascript
Scenario: I should see all issues
Given I click link "All"
Then I should see "Release 0.3" in issues

View file

@ -38,11 +38,13 @@ Feature: Project Merge Requests
When I visit merge request page "Bug NS-08"
Then I should see the diverged commits count
@javascript
Scenario: I should see rejected merge requests
Given I click link "Closed"
Then I should see "Feature NS-03" in merge requests
And I should not see "Bug NS-04" in merge requests
@javascript
Scenario: I should see all merge requests
Given I click link "All"
Then I should see "Feature NS-03" in merge requests

View file

@ -28,7 +28,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'I click link "Closed"' do
find('.issues-state-filters a', text: "Closed").click
find('.issues-state-filters .state-closed span', text: 'Closed').click
end
step 'I click button "Unsubscribe"' do
@ -44,7 +44,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'I click link "All"' do
click_link "All"
find('.issues-state-filters .state-all span', text: 'All').click
# Waits for load
expect(find('.issues-state-filters > .active')).to have_content 'All'
end

View file

@ -26,7 +26,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "All"' do
click_link "All"
find('.issues-state-filters .state-all span', text: 'All').click
# Waits for load
expect(find('.issues-state-filters > .active')).to have_content 'All'
end
@ -36,9 +36,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "Closed"' do
page.within('.issues-state-filters') do
click_link "Closed"
end
find('.issues-state-filters .state-closed span', text: 'Closed').click
end
step 'I should see merge request "Wiki Feature"' do