jenkins-bot has submitted this change and it was merged.

Change subject: QA: Define expected behaviour for VisualEditor overlay for bug 
59932
......................................................................


QA: Define expected behaviour for VisualEditor overlay for bug 59932

* Add tests for Keep Going and toast to show when editing VisualEditor (these
currently fail)

Change-Id: I74354f96e26933ade27483c31450d24164b6fdd9
---
A tests/browser/features/editor-ve.feature
M tests/browser/features/keepgoing.feature
M tests/browser/features/step_definitions/common_article_steps.rb
M tests/browser/features/support/pages/article_page.rb
4 files changed, 51 insertions(+), 1 deletion(-)

Approvals:
  Jhall: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/browser/features/editor-ve.feature 
b/tests/browser/features/editor-ve.feature
new file mode 100644
index 0000000..bb1b535
--- /dev/null
+++ b/tests/browser/features/editor-ve.feature
@@ -0,0 +1,13 @@
[email protected] @en.m.wikipedia.org @test2.m.wikipedia.org
+Feature: VisualEditor
+
+@wip
+Scenario: I can edit a page using VisualEditor
+  Given I am in alpha mode
+    And I am logged into the mobile website
+  When I am on the Selenium Edit Test article
+    And I click edit
+    And I type ABCDEFG into VisualEditor
+    And I click continue
+    And I click submit
+  Then I see a toast confirmation
diff --git a/tests/browser/features/keepgoing.feature 
b/tests/browser/features/keepgoing.feature
index ab40b46..7e95d83 100644
--- a/tests/browser/features/keepgoing.feature
+++ b/tests/browser/features/keepgoing.feature
@@ -10,3 +10,14 @@
       And I click continue
       And I click submit
     Then I see the KeepGoing drawer prompting me to continue editing
+
+  @wip
+  Scenario: I see a KeepGoing message after completing my VisualEditor edit
+    Given I am in alpha mode
+      And I have just registered a new account
+    When I am on the Selenium Edit Test article
+      And I click edit
+      And I type ABCDEFG into VisualEditor
+      And I click continue
+      And I click submit
+    Then I see the KeepGoing drawer prompting me to continue editing
diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index dfc69aa..a2f817f 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -6,10 +6,30 @@
   on(ArticlePage).editor_text_area_element.when_present.send_keys(text)
 end
 
+Given(/^I type (.+) into VisualEditor$/) do |text|
+  on(ArticlePage) do |page|
+    page.editor_ve_element.when_present.fire_event("onfocus")
+    page.editor_ve_element.when_present.send_keys(text)
+  end
+end
+
 Given(/^I click continue$/) do
   on(ArticlePage).continue_button_element.when_present.click
 end
 
 Given(/^I click submit$/) do
-  on(ArticlePage).submit_button_element.when_present.click
+  # In VE the submit button takes a while to become enabled while it prepares 
for a save
+  # according to Jeff this is the best way to get round this
+  # FIXME: Must be a more elegant way?
+  try = 10
+  try.times do
+    begin
+      on(ArticlePage).submit_button_element.when_present.click
+    rescue
+    end
+  end
+end
+
+Then(/^I see a toast confirmation$/) do
+  on(ArticlePage).toast_element.when_present.should be_visible
 end
diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 3eb1276..82683f3 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -55,4 +55,10 @@
 
   # drawer
   div(:keep_going, class:'overlay-bottom')
+
+  # visual editor
+  div(:editor_ve, class: "ve-ce-documentNode ve-ce-branchNode")
+
+  # toast
+  div(:toast, class:'toast position-fixed visible')
 end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74354f96e26933ade27483c31450d24164b6fdd9
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: Jhall <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to