[BrowserTest] remove sleeps from links test

Change-Id: Ib0e09735331dadd5bb494fe87683f6f08b6aee31
This commit is contained in:
Cmcmahon 2014-11-14 10:55:50 -07:00
parent da42fe407c
commit 1aa5d8905b
3 changed files with 27 additions and 7 deletions

View file

@ -8,21 +8,21 @@ Feature: VisualEditor Links
And I can see the Link User Inteface
Scenario: Enter external link
When I enter http://www.example.com into link Content box
When I enter external link http://www.example.com into link Content box
And I click Done to close Link User Interface
And I click Save page
And I click Review your changes
Then an external link appears in the diff view
Scenario: Enter internal link
When I enter Main Page into link Content box
When I enter internal link Main Page into link Content box
And I click Done to close Link User Interface
And I click Save page
And I click Review your changes
Then an internal link appears in the diff view
Scenario: Enter non-existing link
When I enter DoesNotExist into link Content box
When I enter non existing link DoesNotExist into link Content box
And I click Done to close Link User Interface
And I click Save page
And I click Review your changes

View file

@ -14,15 +14,30 @@ When(/^I click Links Review your changes$/) do
end
When(/^I click the Link button$/) do
sleep 1 #Chrome seems to not honor when_present correctly as of 5 Dec 2013
on(VisualEditorPage).ve_link_icon_element.when_present.click
end
When(/^I enter (.+) into link Content box$/) do |content|
When(/^I enter external link (.+) into link Content box$/) do |link_content|
on(VisualEditorPage) do |page|
page.link_textfield_element.when_present
page.link_textfield_element.send_keys(content)
sleep 1
page.link_textfield_element.send_keys(link_content)
page.link_overlay_external_link_element.when_present
end
end
When(/^I enter internal link (.+) into link Content box$/) do |link_content|
on(VisualEditorPage) do |page|
page.link_textfield_element.when_present
page.link_textfield_element.send_keys(link_content)
page.link_overlay_wiki_page_element.when_present
end
end
When(/^I enter non existing link (.+) into link Content box$/) do |link_content|
on(VisualEditorPage) do |page|
page.link_textfield_element.when_present
page.link_textfield_element.send_keys(link_content)
page.link_overlay_does_not_exist_element.when_present
end
end

View file

@ -23,6 +23,7 @@ class VisualEditorPage
span(:insert_menu, class: "oo-ui-popupToolGroup-handle", index: 4)
div(:insert_references, class: "oo-ui-processDialog-location")
div(:ip_warning, class: "ve-ui-mwNoticesPopupTool-item")
span(:looks_good, class: "oo-ui-labelElement-label", text: "Looks good to me")
div(:medium_dialog, class: "oo-ui-window oo-ui-dialog oo-ui-dialog-open oo-ui-dialog-medium")
span(:options_in_hamburger, class: "oo-ui-tool-title", text: "Options")
@ -158,6 +159,10 @@ class VisualEditorPage
span(:ex, text: "Return to save form")
text_area(:describe_change, index: 0)
div(:link_overlay_does_not_exist, text: /New page/)
div(:link_overlay_external_link, text: /External link.+New page/m)
div(:link_overlay_wiki_page, text: /Matching page/)
#USED IN LANGUAGE SCREENSHOT TEST:
span(:page_settings_icon, class: "oo-ui-iconElement-icon oo-ui-icon-settings", index: 2)
label(:prevent_redirect, class: "oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline oo-ui-fieldLayout-disabled")