mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
[browser test] icons appear hovering when cursor is on object
Change-Id: I296445d0ec11f375ddb30f293ec3542ccc6332d6
This commit is contained in:
parent
50ffa7c40c
commit
22f409070b
|
@ -0,0 +1,38 @@
|
|||
Given(/^I am at the cursor test page$/) do
|
||||
visit(CursorTestPage)
|
||||
end
|
||||
|
||||
When(/^I send right arrow times (\d+)$/) do |number|
|
||||
on(VisualEditorPage) do |page|
|
||||
page.content_element.when_present.fire_event('onfocus')
|
||||
number.to_i.times do
|
||||
page.content_element.send_keys :arrow_right
|
||||
page.content_element.fire_event('onblur') #gerrit 86800/86801
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I do not see the References hover icon$/) do
|
||||
on(CursorTestPage).references_hover_element.should_not be_visible
|
||||
end
|
||||
|
||||
Then(/^I should see the References hover icon$/) do
|
||||
on(CursorTestPage).references_hover_element.when_present.should be_visible
|
||||
end
|
||||
|
||||
Then(/^I should see the Transclusion hover icon$/) do
|
||||
on(CursorTestPage).transclusion_hover_element.when_present.should be_visible
|
||||
end
|
||||
|
||||
Then(/^I do not see the Transclusion hover icon$/) do
|
||||
on(CursorTestPage).transclusion_hover_element.should_not be_visible
|
||||
end
|
||||
|
||||
Then(/^I do not see the Link hover icon$/) do
|
||||
on(CursorTestPage).link_hover_element.should_not be_visible
|
||||
end
|
||||
|
||||
Then(/^I should see the Link hover icon$/) do
|
||||
on(CursorTestPage).link_hover_element.should be_visible
|
||||
end
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
class CursorTestPage
|
||||
include PageObject
|
||||
|
||||
include URL
|
||||
page_url URL.url('User:Selenium_user/cursor_test_page')
|
||||
# contents of this page must contain EXACTLY the wikitext string:
|
||||
# Reference one <ref> this is ref1 </ref>invisible transclusion here{{Template sandbox notice}} and visible transclusion here{{User:Selenium_user/cursor}}[http://www.google.com This is link to google]{{reflist}}
|
||||
|
||||
span(:references_hover, class: 've-ui-iconedElement-icon ve-ui-icon-reference', index: 1)
|
||||
span(:transclusion_hover, class: 've-ui-iconedElement-icon ve-ui-icon-template', index: 1)
|
||||
span(:link_hover, class: 've-ui-iconedElement-icon ve-ui-icon-link', index: 1)
|
||||
|
||||
end
|
|
@ -0,0 +1,35 @@
|
|||
@ie6-bug @ie7-bug @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org @en.wikipedia.beta.wmflabs.org
|
||||
Feature: VisualEditor cursor
|
||||
|
||||
Background:
|
||||
Given I am logged in
|
||||
And I am at the cursor test page
|
||||
And I click Edit for VisualEditor
|
||||
|
||||
Scenario Outline: show hover icons
|
||||
When I send right arrow times <arrow_just_before>
|
||||
And I do not see the <not_on_page> hover icon
|
||||
And I send right arrow times 1
|
||||
Then I should see the <visible> hover icon
|
||||
And I do not see the <first_wrong> hover icon
|
||||
And I do not see the <second_wrong> hover icon
|
||||
And I send right arrow times 1
|
||||
And I do not see the <again_not_on_page> hover icon
|
||||
Examples:
|
||||
| arrow_just_before | not_on_page | visible | first_wrong | second_wrong | again_not_on_page |
|
||||
| 14 | References | References | Transclusion | Link | References |
|
||||
| 42 | Transclusion | Transclusion | References | Link | Transclusion |
|
||||
| 73 | Transclusion | Transclusion | References | Link | Transclusion |
|
||||
|
||||
# The last line of this scenario is different from the Outline above.
|
||||
# Links text should be navigable and show the hover icon
|
||||
|
||||
Scenario: Cursor over link shows link icons
|
||||
When I send right arrow times 74
|
||||
And I do not see the Link hover icon
|
||||
And I send right arrow times 1
|
||||
Then I should see the Link hover icon
|
||||
And I do not see the References hover icon
|
||||
And I do not see the Transclusion hover icon
|
||||
And I send right arrow times 1
|
||||
And I should see the Link hover icon
|
Loading…
Reference in a new issue