mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
[BrowserTest] remove sleep from multiedit test
* put the shared step in shared_steps.rb * replace "onfocus" with simple "click" * update RSpec while we're at it Change-Id: I77754abdbeba1314758f5fe10601f6601e8783bd
This commit is contained in:
parent
36e07b247e
commit
6d22cebb62
|
@ -9,18 +9,13 @@ When(/^I enter and save the first edit$/) do
|
|||
end
|
||||
|
||||
When(/^I enter and save a (.+) edit$/) do |count|
|
||||
on(VisualEditorPage) do |page|
|
||||
page.wait_until(10) do
|
||||
page.medium_dialog_element.visible? == false
|
||||
end
|
||||
edit_text = "Editing with " + Random.rand.to_s
|
||||
instance_variable_set("@#{count}_edit_text", edit_text)
|
||||
sleep 2
|
||||
step "I click Edit for VisualEditor"
|
||||
step "I insert the text #{edit_text}"
|
||||
step "I click Save page"
|
||||
step "I click Save page the second time"
|
||||
end
|
||||
on(VisualEditorPage).medium_dialog_element.when_not_visible(10)
|
||||
edit_text = "Editing with " + Random.rand.to_s
|
||||
instance_variable_set("@#{count}_edit_text", edit_text)
|
||||
step "I click Edit for VisualEditor"
|
||||
step "I insert the text #{edit_text}"
|
||||
step "I click Save page"
|
||||
step "I click Save page the second time"
|
||||
end
|
||||
|
||||
When(/^I insert the text (.*?)$/) do |input_string|
|
||||
|
@ -32,5 +27,5 @@ When(/^I click Save page another time$/) do
|
|||
end
|
||||
|
||||
Then(/^the saved page should contain all three edits\.$/) do
|
||||
on(VisualEditorPage).page_text_element.when_present(10).text.should match(@third_edit_text + @second_edit_text + "Editing with " + @random_string + " " + @first_edit_text)
|
||||
expect(on(VisualEditorPage).page_text_element.when_present(10).text).to match "#{@third_edit_text}#{@second_edit_text}Editing with #{@random_string} #{@first_edit_text}"
|
||||
end
|
|
@ -16,14 +16,6 @@ When(/^I click Insert references list$/) do
|
|||
on(VisualEditorPage).insert_references_list_element.when_present.click
|
||||
end
|
||||
|
||||
When(/^I click Edit for VisualEditor$/) do
|
||||
on(VisualEditorPage) do |page|
|
||||
page.edit_ve_element.when_present.click
|
||||
# no longer need to dismiss beta warning here https://gerrit.wikimedia.org/r/#/c/119217/
|
||||
page.content_element.when_present(10).fire_event("onfocus")
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I click Reference$/) do
|
||||
on(VisualEditorPage) do |page|
|
||||
page.insert_menu_element.when_present.click
|
||||
|
|
|
@ -30,6 +30,13 @@ Given(/^I make the text "(.*?)" be selected$/) do |select_text|
|
|||
sleep 1 # turn the sleep on if this test fails with bullet/number in front of string NOT "This is.."
|
||||
end
|
||||
|
||||
When(/^I click Edit for VisualEditor$/) do
|
||||
on(VisualEditorPage) do |page|
|
||||
page.edit_ve_element.when_present.click
|
||||
page.content_element.when_present.click
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I click Review and Save$/) do
|
||||
on(VisualEditorPage) do |page|
|
||||
page.container_disabled_element.when_not_visible.should_not exist
|
||||
|
@ -57,7 +64,10 @@ When(/^I click Save page$/) do
|
|||
end
|
||||
|
||||
When(/^I click Save page the second time$/) do
|
||||
on(VisualEditorPage).second_save_page_element.when_present.click
|
||||
on(VisualEditorPage) do |page|
|
||||
page.second_save_page_element.when_present.click
|
||||
page.second_save_page_element.when_not_present
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I do not see This is a minor edit$/) do
|
||||
|
|
Loading…
Reference in a new issue