Cmcmahon has uploaded a new change for review.

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


Change subject: Test for VE Transclusion UI
......................................................................

Test for VE Transclusion UI

Change-Id: I67f31e5db6d74ff4ae9085cad4424f1a7fc685d9
---
M features/step_definitions/visual_editor_references_steps.rb
A features/step_definitions/visual_editor_transclusion_steps.rb
M features/support/pages/visual_editor_page.rb
A features/visual_editor_transclusion.feature
4 files changed, 97 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/45/72145/1

diff --git a/features/step_definitions/visual_editor_references_steps.rb 
b/features/step_definitions/visual_editor_references_steps.rb
index 04988a0..8eb05a4 100644
--- a/features/step_definitions/visual_editor_references_steps.rb
+++ b/features/step_definitions/visual_editor_references_steps.rb
@@ -15,6 +15,7 @@
 end
 
 When(/^I enter (.+) into Content box$/) do |content|
+  on(VisualEditorPage).content_box_element.wait_until_present
   on(VisualEditorPage).content_box=content
 end
 
diff --git a/features/step_definitions/visual_editor_transclusion_steps.rb 
b/features/step_definitions/visual_editor_transclusion_steps.rb
new file mode 100644
index 0000000..2e175fc
--- /dev/null
+++ b/features/step_definitions/visual_editor_transclusion_steps.rb
@@ -0,0 +1,57 @@
+Given(/^I can see the Transclusion User Interface$/) do
+  on(VisualEditorPage).title.should match 'Transclusion'
+end
+
+Given(/^I have added a parameter to a template$/) do
+  step 'I have added a template'
+  step 'I enter x in the parameter box'
+  step 'I click Add parameter'
+end
+
+Given(/^I have added a template$/) do 
+  step 'I click Transclusion'
+  step 'I enter S into Content box'
+  on(VisualEditorPage).add_template_element.when_present.click
+end
+
+When(/^I click Add parameter$/) do
+  on(VisualEditorPage).add_parameter_element.when_present.click
+end
+
+When(/^I click Remove parameter$/) do
+  on(VisualEditorPage).remove_parameter_element.when_present.click
+end
+
+When(/^I click Remove template$/) do
+  on(VisualEditorPage).remove_template_element.when_present.click
+end
+
+When(/^I click Transclusion$/) do
+  on(VisualEditorPage).transclusion_element.when_present.click
+end
+
+When(/^I enter (.+) in the parameter box$/) do |param_value|
+  on(VisualEditorPage) do |page| 
+      page.parameter_box_element.wait_until_present
+      page.parameter_box=param_value
+  end
+end
+
+Then(/^I should see a list of template suggestions$/) do
+  on(VisualEditorPage).suggestion_list_element.should be_visible
+end
+
+Then(/^I should be able to click the Add template button$/) do
+  on(VisualEditorPage).add_template_element.should be_visible
+end
+Then(/^I should not be able to see parameter named (.+)$/) do |param_name|
+  on(VisualEditorPage).template_list_item_element.should_not be_visible
+end
+
+Then(/^I should see an input text area$/) do
+  on(VisualEditorPage).transclusion_textarea_element.when_present.should 
be_visible
+end
+
+Then(/^I should see the Apply changes button$/) do
+  on(VisualEditorPage).apply_changes_element.should be_visible
+end
\ No newline at end of file
diff --git a/features/support/pages/visual_editor_page.rb 
b/features/support/pages/visual_editor_page.rb
index e8de048..9926c1f 100644
--- a/features/support/pages/visual_editor_page.rb
+++ b/features/support/pages/visual_editor_page.rb
@@ -6,7 +6,6 @@
 
   div(:container_disabled, class: 've-ui-widget ve-ui-widget-disabled 
ve-ui-flaggableElement-constructive ve-ui-buttonWidget')
   div(:content, class: 've-ce-documentNode ve-ce-branchNode')
-
   text_area(:describe_change, id: 
've-init-mw-viewPageTarget-saveDialog-editSummary')
   span(:diff_view, class: 'diffchange diffchange-inline')
   div(:diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer')
@@ -21,11 +20,21 @@
   span(:save_page, class: 've-ui-labeledElement-label', text: 'Save page')
   span(:second_save_page, class: 've-ui-labeledElement-label', text: 'Save 
page', index: 1)
   span(:ve_references, class: 've-ui-buttonTool-icon ve-ui-icon-reference')
-
+  span(:transclusion, class: 've-ui-buttonTool-icon ve-ui-icon-template')
   in_frame(:index => 0) do |frame|
+    span(:add_parameter, text: 'Add parameter', frame: frame)
+    span(:add_template, text: 'Add template', frame: frame)
+    span(:apply_changes, text: 'Apply changes', frame: frame)
     text_field(:content_box, index: 0, frame: frame)
     span(:create_new, text:'Create new source', frame: frame)
     div(:insert_reference, class: 've-ui-widget ve-ui-flaggableElement-primary 
ve-ui-buttonWidget ve-ui-window-applyButton', frame: frame)
+    text_field(:parameter_box, index: 0, frame: frame)
     div(:ref_body, class:'ve-ui-window-head', frame: frame)
+    span(:remove_parameter, text: 'Remove parameter', frame: frame)
+    span(:remove_template, text: 'Remove template', frame: frame)
+    unordered_list(:suggestion_list, class: 've-ui-widget ve-ui-selectWidget 
ve-ui-menuWidget ve-ui-textInputMenuWidget ve-ui-lookupWidget-menu 
ve-ui-mwTitleInputWidget-menu', frame: frame)
+    list_item(:template_list_item, text: 'S', frame: frame)
+    div(:title, class: 've-ui-window-title', frame: frame)
+    text_area(:transclusion_textarea, index: 0, frame: frame)
   end
 end
diff --git a/features/visual_editor_transclusion.feature 
b/features/visual_editor_transclusion.feature
new file mode 100644
index 0000000..88914ac
--- /dev/null
+++ b/features/visual_editor_transclusion.feature
@@ -0,0 +1,28 @@
+@ie6-bug  @ie7-bug  @ie8-bug @test2.wikipedia.org @login
+Feature: VisualEditor Transclusion
+
+  Background:
+    Given I am logged in
+      And I am at my user page
+      When I click Edit for VisualEditor
+      And I click Transclusion
+
+  Scenario: Add template
+    Given I can see the Transclusion User Interface
+    When I enter S into Content box
+    Then I should see a list of template suggestions
+      And I should be able to click the Add template button
+  
+  Scenario: Add parameter to template
+    Given I have added a template
+    When I enter x in the parameter box
+      And I click Add parameter
+    Then I should see an input text area
+      And I should see the Apply changes button
+
+  Scenario: Remove parameter
+    Given I have added a parameter to a template
+    When I click Remove parameter
+      And I click Remove template
+    Then I should not be able to see parameter named S
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67f31e5db6d74ff4ae9085cad4424f1a7fc685d9
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
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