Commit cd6baa14 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'line-is-wrong-test' into 'master'

Make test element selection more specific to fix constantly failing test.

Fixes #2051.

The problem was that there were two `.note-text` elements matching `.files [id^=diff]:nth-child(2) .note-text`, one for the new comment, and one for the (currently hidden) new comment form. The latter one was selected but currently invisible, triggering the following error in poltergeist:

> The element you are trying to interact with is either not part of the DOM, or is not currently visible on the page (perhaps display: none is set). It's possible the element has been replaced by another element and you meant to interact with the new element. If so you need to do a new 'find' in order to get a reference to the new element.

This caused the test to fail.

See merge request !1592
parents 78391fe5 9b8d5c4a
...@@ -213,7 +213,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -213,7 +213,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'I should see a comment like "Line is wrong" in the second file' do step 'I should see a comment like "Line is wrong" in the second file' do
within '.files [id^=diff]:nth-child(2) .note-text' do within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
page.should have_visible_content "Line is wrong" page.should have_visible_content "Line is wrong"
end end
end end
...@@ -225,7 +225,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -225,7 +225,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'I should see a comment like "Line is wrong here" in the second file' do step 'I should see a comment like "Line is wrong here" in the second file' do
within '.files [id^=diff]:nth-child(2) .note-text' do within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
page.should have_visible_content "Line is wrong here" page.should have_visible_content "Line is wrong here"
end end
end end
...@@ -238,7 +238,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -238,7 +238,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Add Comment" click_button "Add Comment"
end end
within ".files [id^=diff]:nth-child(1) .note-text" do within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do
page.should have_content "Line is correct" page.should have_content "Line is correct"
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment