Cmcmahon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/87620


Change subject: WIP icons appear hovering when cursor is on object
......................................................................

WIP icons appear hovering when cursor is on object

Change-Id: I296445d0ec11f375ddb30f293ec3542ccc6332d6
---
A 
modules/ve-mw/test/browser/features/step_definitions/visual_editor_cursor_steps.rb
A modules/ve-mw/test/browser/features/support/pages/cursor_test_page.rb
A modules/ve-mw/test/browser/features/visual_editor_cursor_references.feature
A 
modules/ve-mw/test/browser/features/visual_editor_cursor_transclusion_invisible.feature
4 files changed, 72 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/20/87620/1

diff --git 
a/modules/ve-mw/test/browser/features/step_definitions/visual_editor_cursor_steps.rb
 
b/modules/ve-mw/test/browser/features/step_definitions/visual_editor_cursor_steps.rb
new file mode 100644
index 0000000..6c7042b
--- /dev/null
+++ 
b/modules/ve-mw/test/browser/features/step_definitions/visual_editor_cursor_steps.rb
@@ -0,0 +1,25 @@
+Given(/^I am at the cursor test page$/) do
+  visit(CursorTestPage)
+end
+
+When(/^I send right arrow times (\d+)$/) do |number|
+       number.to_i.times do 
+               on(VisualEditorPage).content_element.when_present.send_keys 
:arrow_right
+       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 not see the Transclusion hover icon$/) do
+  on(CursorTestPage).transclusion_hover_element.should_not be_visible
+end
+
+Then(/^I should not see the Link hover icon$/) do
+  on(CursorTestPage).link_hover_element.should_not be_visible
+end
diff --git 
a/modules/ve-mw/test/browser/features/support/pages/cursor_test_page.rb 
b/modules/ve-mw/test/browser/features/support/pages/cursor_test_page.rb
new file mode 100644
index 0000000..8554e35
--- /dev/null
+++ b/modules/ve-mw/test/browser/features/support/pages/cursor_test_page.rb
@@ -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-transclusion', index: 1)
+  span(:link_hover, class: 've-ui-iconedElement-icon ve-ui-icon-link', index: 
1)
+
+end
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_cursor_references.feature 
b/modules/ve-mw/test/browser/features/visual_editor_cursor_references.feature
new file mode 100644
index 0000000..ebbd8ed
--- /dev/null
+++ 
b/modules/ve-mw/test/browser/features/visual_editor_cursor_references.feature
@@ -0,0 +1,17 @@
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org
+Feature: VisualEditor
+
+  @login
+  Scenario: Cursor over reference shows hover icons
+    Given I am logged in
+      And I am at the cursor test page
+      And I click Edit for VisualEditor
+    When I send right arrow times 14
+      And I do not see the References hover icon
+      And I send right arrow times 1
+    Then I should see the References hover icon
+      And I should not see the Transclusion hover icon
+      And I should not see the Link hover icon
+      And I send right arrow times 1
+      And I do not see the References hover icon
+
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_cursor_transclusion_invisible.feature
 
b/modules/ve-mw/test/browser/features/visual_editor_cursor_transclusion_invisible.feature
new file mode 100644
index 0000000..0a5b33a
--- /dev/null
+++ 
b/modules/ve-mw/test/browser/features/visual_editor_cursor_transclusion_invisible.feature
@@ -0,0 +1,17 @@
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org
+Feature: VisualEditor
+
+  @login
+  Scenario: Cursor over transclusion shows hover icons
+    Given I am logged in
+      And I am at the cursor test page
+      And I click Edit for VisualEditor
+    When I send right arrow times 42
+      And I do not see the Transclusion hover icon
+      And I send right arrow times 1
+    Then I should see the Transclusion hover icon
+      And I should not see the Transclusion hover icon
+      And I should not see the Link hover icon
+      And I send right arrow times 1
+      And I do not see the Transclusion hover icon
+

-- 
To view, visit https://gerrit.wikimedia.org/r/87620
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I296445d0ec11f375ddb30f293ec3542ccc6332d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to