Merge "Avoid errors when elements are not loaded yet"

This commit is contained in:
jenkins-bot 2016-09-01 07:43:00 +00:00 committed by Gerrit Code Review
commit 73e822ebdf
4 changed files with 13 additions and 13 deletions

View file

@ -59,19 +59,19 @@ Then(/^The auto expand button should be on/) do
end
Then(/^There should be a RevisionSlider expand button/) do
expect{ on(DiffPage).revisionslider_toggle_button }.not_to raise_error
expect(on(DiffPage).revisionslider_toggle_button_element.when_visible).to be_visible
end
Then(/^There should not be a RevisionSlider expand button/) do
expect{ on(DiffPage).revisionslider_toggle_button }.to raise_error
expect(on(DiffPage).revisionslider_toggle_button_element.when_not_visible).not_to be_visible
end
Then(/^RevisionSlider wrapper should be hidden/) do
on(DiffPage).revisionslider_wrapper_element.visible?.should be_falsey
expect(on(DiffPage).revisionslider_wrapper_element.when_not_visible).not_to be_visible
end
Then(/^RevisionSlider wrapper should be visible/) do
on(DiffPage).revisionslider_wrapper_element.visible?.should be_truthy
expect(on(DiffPage).revisionslider_wrapper_element.when_visible).to be_visible
end
Given(/^I click on the auto expand button/) do
@ -79,5 +79,5 @@ Given(/^I click on the auto expand button/) do
end
Given(/^I click on the expand button/) do
on(DiffPage).revisionslider_toggle_button_element.click
on(DiffPage).revisionslider_toggle_button_element.when_visible.click
end

View file

@ -1,13 +1,13 @@
Given(/^I have closed the help dialog at the start$/) do
on(DiffPage).revisionslider_help_close_start_element.click
on(DiffPage).revisionslider_help_close_start_element.when_visible.click
end
Given(/^I have closed the help dialog at the end/) do
on(DiffPage).revisionslider_help_close_end_element.click
on(DiffPage).revisionslider_help_close_end_element.when_visible.click
end
Given(/^I have moved to the next step$/) do
on(DiffPage).revisionslider_help_next_element.click
on(DiffPage).revisionslider_help_next_element.when_visible.click
end
Given(/^The help dialog is hidden$/) do
@ -15,9 +15,9 @@ Given(/^The help dialog is hidden$/) do
end
Then(/^The help dialog should be visible/) do
on(DiffPage).revisionslider_help_dialog_element.visible?.should be_truthy
expect(on(DiffPage).revisionslider_help_dialog_element.when_visible).to be_visible
end
Then(/^The help dialog should not be present/) do
expect{ on(DiffPage).revisionslider_help_dialog }.to raise_error
expect(on(DiffPage).revisionslider_help_dialog_element.when_not_visible).not_to be_visible
end

View file

@ -1,5 +1,5 @@
Given(/^I click on revision (\d+)$/) do |index|
on(DiffPage).revisionslider_rev(index.to_i).click
on(DiffPage).revisionslider_rev(index.to_i).when_visible.click
end
Given(/^I drag the lower pointer to revision (\d+)$/) do |index|

View file

@ -15,9 +15,9 @@ Then(/^The backward arrow should be enabled/) do
end
Given(/^I click on the forward arrow$/) do
on(DiffPage).revisionslider_timeline_forwards_element.click
on(DiffPage).revisionslider_timeline_forwards_element.when_visible.click
end
Given(/^I click on the backward arrow$/) do
on(DiffPage).revisionslider_timeline_backwards_element.click
on(DiffPage).revisionslider_timeline_backwards_element.when_visible.click
end