Merge "[browser test] Refactor markup test to use API"

This commit is contained in:
jenkins-bot 2014-05-06 22:14:04 +00:00 committed by Gerrit Code Review
commit 74faf0d2de
3 changed files with 19 additions and 14 deletions

View file

@ -1,6 +1,10 @@
@en.wikipedia.beta.wmflabs.org @firefox @login @make_selectable_line @test2.wikipedia.org
@en.wikipedia.beta.wmflabs.org @firefox @login @test2.wikipedia.org
Feature: VisualEditor general text markup features
Background:
Given I go to the "General Markup VisualEditor Test" page with content "General Markup VisualEditor Test"
And I make the text "General Markup VisualEditor Test" be selected
Scenario Outline: VisualEditor general markup
When I click the text style menu
And I click the <type_of_markup> menu option
@ -9,11 +13,11 @@ Feature: VisualEditor general text markup features
Then <expected_markup_text> should appear in the diff view
And I can click the X on the save box
Examples:
| type_of_markup | expected_markup_text |
| Bold | '''This is a new line''' |
| Computer Code | <code>This is a new line</code> |
| Italics | ''This is a new line'' |
| Strikethrough | <s>This is a new line</s> |
| Subscript | <sub>This is a new line</sub> |
| Superscript | <sup>This is a new line</sup> |
| Underline | <u>This is a new line</u> |
| type_of_markup | expected_markup_text |
| Bold | '''General Markup VisualEditor Test''' |
| Computer Code | <code>General Markup VisualEditor Test</code> |
| Italics | ''General Markup VisualEditor Test'' |
| Strikethrough | <s>General Markup VisualEditor Test</s> |
| Subscript | <sub>General Markup VisualEditor Test</sub> |
| Superscript | <sup>General Markup VisualEditor Test</sup> |
| Underline | <u>General Markup VisualEditor Test</u> |

View file

@ -1,8 +1,3 @@
Given(/^I go to the "(.+)" page with content "(.+)"$/) do |page_title, page_content|
@wikitext = page_content
on(APIPage).create page_title, page_content
step "I am on the #{page_title} page"
end
Given(/^I close the VE information window$/) do
pending # express the regexp above with the code you wish you had

View file

@ -7,6 +7,12 @@ Given(/^I am on the (.+) page$/) do |article|
visit(ZtargetPage, :using_params => {:article_name => article})
end
Given(/^I go to the "(.+)" page with content "(.+)"$/) do |page_title, page_content|
@wikitext = page_content
on(APIPage).create page_title, page_content
step "I am on the #{page_title} page"
end
Given(/^I make the text "(.*?)" be selected$/) do |select_text|
on(VisualEditorPage).content_element.when_present.click
require "watir-webdriver/extensions/select_text"