Merge "[BrowserTest] add News and Journal to Cite test"

This commit is contained in:
jenkins-bot 2014-08-21 20:19:19 +00:00 committed by Gerrit Code Review
commit 60808e5d54
3 changed files with 60 additions and 3 deletions

View file

@ -41,4 +41,24 @@ Feature: VisualEditor Cite
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
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

View file

@ -22,6 +22,14 @@ When(/^I click Insert Citation$/) do
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 @@ When(/^the Book input field titles are in the correct order$/) do
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 @@ Then(/^diff view should show the Book citation added$/) do
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

View file

@ -7,6 +7,8 @@ class VisualEditorPage
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 @@ class VisualEditorPage
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 @@ class VisualEditorPage
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)