jenkins-bot has submitted this change and it was merged.
Change subject: [BrowserTest] create simple test for Basic Citation
......................................................................
[BrowserTest] create simple test for Basic Citation
We can make this more sophisticated later, but right now it
accurately checks that upon clicking Basic citation, the user
sees a true VisualEditor UI
Change-Id: Icea910e2bc1bbd4277a7e8eee08f2b0e49661062
---
M modules/ve-mw/tests/browser/features/cite.feature
M modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb
M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
3 files changed, 37 insertions(+), 22 deletions(-)
Approvals:
Ryasmeen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/tests/browser/features/cite.feature
b/modules/ve-mw/tests/browser/features/cite.feature
index 41e27bd..061706d 100644
--- a/modules/ve-mw/tests/browser/features/cite.feature
+++ b/modules/ve-mw/tests/browser/features/cite.feature
@@ -3,9 +3,9 @@
Background:
Given I go to the "Cite VisualEditor Test" page with content "Cite
VisualEditor Test"
- And I click in the editable part
- And I click the Cite button
- And I can see the Cite User Interface
+ And I click in the editable part
+ And I click the Cite button
+ And I can see the Cite User Interface
Scenario: Website
When I click Website
@@ -50,25 +50,29 @@
Scenario: News
When I click News
- And I fill in the first textarea with "News URL"
- And I fill in the second textarea with "News Source title"
- And I fill in the third textarea with "News Last name"
- And I fill in the fourth textarea with "News First name"
- And I fill in the fifth textarea with "News Source date"
- And I fill in the sixth textarea with "News Work"
- And I fill in the seventh textarea with "News URL access date"
- And the News input field titles are in the correct order
- And I click Insert Citation
- And I click Save page
- And I click Links Review your changes
+ And I fill in the first textarea with "News URL"
+ And I fill in the second textarea with "News Source title"
+ And I fill in the third textarea with "News Last name"
+ And I fill in the fourth textarea with "News First name"
+ And I fill in the fifth textarea with "News Source date"
+ And I fill in the sixth textarea with "News Work"
+ And I fill in the seventh textarea with "News URL access date"
+ And the News input field titles are in the correct order
+ And I click Insert Citation
+ And I click Save page
+ And I click Links Review your changes
Then diff view should show the News citation added
Scenario: Journal
When I click Journal
- And I fill in the first textarea with "Journal title"
- And I fill in the second textarea with "Journal Source date"
- And the Journal input field titles are in the correct order
- And I click Insert Citation
- And I click Save page
- And I click Links Review your changes
- Then diff view should show the Journal citation added
\ No newline at end of file
+ And I fill in the first textarea with "Journal title"
+ And I fill in the second textarea with "Journal Source date"
+ And the Journal input field titles are in the correct order
+ And I click Insert Citation
+ And I click Save page
+ And I click Links Review your changes
+ Then diff view should show the Journal citation added
+
+ Scenario: Basic
+ When I click Basic
+ Then I should see the VisualEditor interface
\ No newline at end of file
diff --git
a/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb
b/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb
index 6cbc199..3e7af40 100644
--- a/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb
+++ b/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb
@@ -10,6 +10,10 @@
on(VisualEditorPage).cite_add_more_information_button_element.when_present.click
end
+When(/^I click Basic$/) do
+ on(VisualEditorPage).cite_basic_reference_element.when_present.click
+end
+
When(/^I click Book$/) do
on(VisualEditorPage).cite_book_element.when_present.click
end
@@ -132,4 +136,9 @@
end
page.links_diff_view.should match Regexp.escape("<ref>{{Cite web|url =
http://en.wikipedia.org/|title = Website Source title|date = Website Source
date 28 July 2014|accessdate = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}28 July
2014|website = Website title|publisher = Website publisher|last = Website Last
name|first = Website First name|New website field = New website field
contents}}</ref>Cite VisualEditor Test")
end
-end
\ No newline at end of file
+end
+
+Then(/^I should see the VisualEditor interface$/) do
+ expect(on(VisualEditorPage).cite_visualeditor_user_interface_element).to
be_visible
+end
+
diff --git
a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
index c5348ba..900c113 100644
--- a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
+++ b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
@@ -4,6 +4,7 @@
include URL
page_url
URL.url("User:#{ENV['MEDIAWIKI_USER']}/#{ENV['BROWSER']}?vehidebetadialog=true&veaction=edit")
span(:bullet_number_selector, class: "oo-ui-iconElement-icon
oo-ui-icon-bullet-list")
+ span(:cite_basic_reference, css: ".oo-ui-icon-reference")
span(:cite_button, text: "Cite")
div(:cite_select, css: "div.oo-ui-widget:nth-child(5) > div:nth-child(2)")
a(:cite_book, css: ".oo-ui-tool-name-cite-book > a:nth-child(1)")
@@ -98,6 +99,7 @@
a(:beta_warning, title: "Close", frame: frame)
a(:cite_add_more_information_button, css: ".ve-ui-mwParameterPage-more a",
index: 7, frame: frame)
a(:book_add_more_information_button, css: ".ve-ui-mwParameterPage-more a",
index: 7, frame: frame)
+ div(:cite_visualeditor_user_interface, css: ".ve-ui-surfaceWidget", frame:
frame)
#text_field(:cite_custom_field_name, css:
".oo-ui-textInputWidget-decorated > input:nth-child(1)", frame: frame)
text_field(:cite_custom_field_name, css: ".oo-ui-searchWidget-query >
div:nth-child(1) > input:nth-child(1)", frame: frame)
text_area(:cite_new_website_field, css: "div.oo-ui-layout:nth-child(10) >
div:nth-child(3) > div:nth-child(1) > textarea:nth-child(1)", frame: frame)
--
To view, visit https://gerrit.wikimedia.org/r/167869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icea910e2bc1bbd4277a7e8eee08f2b0e49661062
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Ryasmeen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits