jenkins-bot has submitted this change and it was merged.
Change subject: [BrowserTest] add News and Journal to Cite test
......................................................................
[BrowserTest] add News and Journal to Cite test
Change-Id: I86922627de85371e6c5447a92f0671bea42cda5f
---
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, 60 insertions(+), 3 deletions(-)
Approvals:
Cmcmahon: 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 384cb5f..0af21df 100644
--- a/modules/ve-mw/tests/browser/features/cite.feature
+++ b/modules/ve-mw/tests/browser/features/cite.feature
@@ -41,4 +41,24 @@
And I click Insert Citation
And I click Save page
And I click Links Review your changes
- Then diff view should show the Book citation added
\ No newline at end of file
+ Then diff view should show the Book citation added
+
+ Scenario: News
+ When I click News
+ And I fill in the first textarea with "News Source title"
+ And I fill in the second textarea with "News Source 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
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 f62d7a5..51804c1 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
@@ -22,6 +22,14 @@
on(VisualEditorPage).insert_citation_element.when_present.click
end
+When(/^I click Journal$/) do
+ on(VisualEditorPage).cite_journal_element.when_present.click
+end
+
+When(/^I click News$/) do
+ on(VisualEditorPage).cite_news_element.when_present.click
+end
+
When(/^I click Website$/) do
on(VisualEditorPage).cite_website_element.when_present.click
end
@@ -75,6 +83,14 @@
on(VisualEditorPage).cite_ui.should match /Title.+Last name.+First
name.+Publisher.+Year of publication.+ISBN.+Location of publication.+Pages/m
end
+When(/^the Journal input field titles are in the correct order$/) do
+ on(VisualEditorPage).cite_ui.should match /Title.+Source date/m
+end
+
+When(/^the News input field titles are in the correct order$/) do
+ on(VisualEditorPage).cite_ui.should match /Source title.+Source date/m
+end
+
When(/^the Website input field titles are in the correct order$/) do
on(VisualEditorPage).cite_ui.should match /URL.+Source title.+Source
date.+URL access date.+Website title/m
end
@@ -88,6 +104,24 @@
end
end
+Then(/^diff view should show the Journal citation added$/) do
+ on(VisualEditorPage) do |page|
+ page.wait_until(10) do
+ page.links_diff_view.include? "Cite VisualEditor Test"
+ end
+ page.links_diff_view.should match Regexp.escape("<ref>{{Cite journal|title
= Journal title|date = Journal Source date}}</ref>Cite VisualEditor Test")
+ end
+end
+
+Then(/^diff view should show the News citation added$/) do
+ on(VisualEditorPage) do |page|
+ page.wait_until(10) do
+ page.links_diff_view.include? "Cite VisualEditor Test"
+ end
+ page.links_diff_view.should match Regexp.escape("<ref>{{Cite news|title =
News Source title|date = News Source date}}</ref>Cite VisualEditor Test")
+ end
+end
+
Then(/^diff view should show the Website citation added$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
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 54199ed..b873e72 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
@@ -7,6 +7,8 @@
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)")
+ a(:cite_journal, css: ".oo-ui-tool-name-cite-journal > a:nth-child(1)")
+ a(:cite_news, css: ".oo-ui-tool-name-cite-news > a:nth-child(1)")
span(:cite_website, css: ".oo-ui-icon-ref-cite-web")
div(:container_disabled, class: "oo-ui-widget oo-ui-widget-disabled
oo-ui-flaggableElement-constructive oo-ui-.oo-ui-buttonedElement-framed")
div(:content, class: "ve-ce-branchNode")
@@ -96,7 +98,8 @@
a(:beta_warning, title: "Close", frame: frame)
a(:cite_add_more_information_button, css: ".ve-ui-mwParameterPage-more a",
index: 4, frame: frame)
a(:book_add_more_information_button, css: ".ve-ui-mwParameterPage-more a",
index: 7, 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-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)
li(:cite_new_field_instance , class: "oo-ui-widget oo-ui-widget-enabled
oo-ui-optionWidget ve-ui-mwParameterResultWidget oo-ui-labeledElement", frame:
frame)
text_area(:cite_new_website_field, css: "div.oo-ui-layout:nth-child(7) >
div:nth-child(3) > div:nth-child(1) > textarea:nth-child(1)", frame: frame)
div(:cite_show_more_fields, class:
"ve-ui-mwMoreParametersResultWidget-label", frame: frame)
@@ -112,7 +115,7 @@
text_area(:cite_eighth_textarea, index: 7, frame: frame)
div(:content_box, class: "ve-ce-documentNode ve-ce-branchNode", frame:
frame)
- span(:insert_citation, text: "Insert citation", frame: frame)
+ span(:insert_citation, text: "Insert", frame: frame)
span(:links_done, text: "Done", frame: frame)
text_field(:link_textfield, index: 0, frame: frame)
span(:another_save_page, class: "oo-ui-labeledElement-label", text: "Save
page", frame: frame)
--
To view, visit https://gerrit.wikimedia.org/r/155434
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I86922627de85371e6c5447a92f0671bea42cda5f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits