[MediaWiki-commits] [Gerrit] Add more browser test steps - change (mediawiki...ContentTranslation)

2014-01-08 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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


Change subject: Add more browser test steps
..

Add more browser test steps

Change-Id: I56277bb0e2d6bd356aec06c1f64c672f993e9af6
---
M tests/browser/features/step_definitions/special_content_translation_steps.rb
M tests/browser/features/support/pages/content_translation_page.rb
2 files changed, 24 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/59/106259/1

diff --git 
a/tests/browser/features/step_definitions/special_content_translation_steps.rb 
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
index ee6d9a6..75b5077 100644
--- 
a/tests/browser/features/step_definitions/special_content_translation_steps.rb
+++ 
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
@@ -7,7 +7,7 @@
 end
 
 When(/^I write (.*?) in the editing area in the translation column$/) do 
|translation|
-   on(ContentTranslationPage).translation_editing_area = translation
+   on(ContentTranslationPage).translation_editor = translation
 end
 
 Then(/^I don't see a Publish Translation button$/) do
@@ -31,7 +31,7 @@
 end
 
 Then(/^I see an input box pre\-filled with the text (.*?) above the editing 
area in the second column$/) do |text|
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).target_title.should == text
 end
 
 Then(/^I see a source column with the content of the page (.*?)$/) do 
|page_name|
@@ -39,47 +39,40 @@
 end
 
 Then(/^I see a translation column with an empty editing area$/) do
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).translation_editor.should == 
 end
 
 Then(/^I see a translation information column$/) do
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).column(information).should be_visible
 end
 
 Then(/^I see a translation progress bar$/) do
-   pending # express the regexp above with the code you wish you had
+   pending Not implemented yet
+   on(ContentTranslationPage).progress_bar.should be_visible
 end
 
 Then(/^I see the message You must be logged in to translate in this 
page\.$/) do
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^I see the title (.*?) at the top of the source column$/) do 
|page_title|
-   pending # express the regexp above with the code you wish you had
+Then(/^I see the title (.*?) at the top of the source column$/) do 
|source_page_title|
+   on(ContentTranslationPage).source_title.should == source_page_title
 end
 
 Then(/^the content of the page is (.*?)$/) do |page_content|
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^the direction of the source column is (.+)$/) do |direction|
-   pending # express the regexp above with the code you wish you had
-end
-
-Then(/^the direction of the translation column is (.+)$/) do |direction|
-   pending # express the regexp above with the code you wish you had
+Then(/^the direction of the (.+) column is (.+)$/) do |column_type, 
direction|
+   on(ContentTranslationPage).column(column_type).attribute(dir).should 
== direction
 end
 
 Then(/^the first version in the history of the page (.+?) should have the 
tag (.+?)$/) do |page_title, tag_name|
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^the language code of the source column is (.+)$/) do |language_code|
-   pending # express the regexp above with the code you wish you had
-end
-
-Then(/^the language code of the translation column is (.+?)$/) do 
|language_code|
-   pending # express the regexp above with the code you wish you had
+Then(/^the language code of the (.+) column is (.+)$/) do |column_type, 
language_code|
+   on(ContentTranslationPage).column(column_type).attribute(lang).should 
== language_code
 end
 
 Then(/^the page (.+?) is displayed$/) do |page_title|
@@ -87,5 +80,5 @@
 end
 
 Then(/^the view page link points to the page (.*?) on the same wiki$/) do 
|source_page|
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).view_page_element.attribute(lang).should 
== language_code
 end
diff --git a/tests/browser/features/support/pages/content_translation_page.rb 
b/tests/browser/features/support/pages/content_translation_page.rb
index 9a92df9..6da00e8 100644
--- a/tests/browser/features/support/pages/content_translation_page.rb
+++ b/tests/browser/features/support/pages/content_translation_page.rb
@@ -5,6 +5,8 @@
 
button(:publish_translation, class: publish-translation)
 
+   div(:progress_bar, class: ct-progress-bar)
+
def column(column_type)

[MediaWiki-commits] [Gerrit] Add more browser test steps - change (mediawiki...ContentTranslation)

2014-01-08 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add more browser test steps
..


Add more browser test steps

Change-Id: I56277bb0e2d6bd356aec06c1f64c672f993e9af6
---
M tests/browser/features/step_definitions/special_content_translation_steps.rb
M tests/browser/features/support/pages/content_translation_page.rb
2 files changed, 23 insertions(+), 20 deletions(-)

Approvals:
  KartikMistry: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/tests/browser/features/step_definitions/special_content_translation_steps.rb 
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
index c6e2d6c..84ed1a6 100644
--- 
a/tests/browser/features/step_definitions/special_content_translation_steps.rb
+++ 
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
@@ -7,7 +7,7 @@
 end
 
 When(/^I write (.*?) in the editing area in the translation column$/) do 
|translation|
-   on(ContentTranslationPage).translation_editing_area = translation
+   on(ContentTranslationPage).translation_editor = translation
 end
 
 Then(/^I don't see a Publish Translation button$/) do
@@ -31,7 +31,7 @@
 end
 
 Then(/^I see an input box pre\-filled with the text (.*?) above the editing 
area in the second column$/) do |text|
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).target_title.should == text
 end
 
 Then(/^I see a source column with the content of the page (.*?)$/) do 
|page_name|
@@ -39,47 +39,40 @@
 end
 
 Then(/^I see a translation column with an empty editing area$/) do
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).translation_editor.should == 
 end
 
 Then(/^I see a translation information column$/) do
-   pending # express the regexp above with the code you wish you had
+   on(ContentTranslationPage).column(information).should be_visible
 end
 
 Then(/^I see a translation progress bar$/) do
-   pending # express the regexp above with the code you wish you had
+   pending Not implemented yet
+   on(ContentTranslationPage).progress_bar.should be_visible
 end
 
 Then(/^I see the message You must be logged in to translate in this 
page\.$/) do
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^I see the title (.*?) at the top of the source column$/) do 
|page_title|
-   pending # express the regexp above with the code you wish you had
+Then(/^I see the title (.*?) at the top of the source column$/) do 
|source_page_title|
+   on(ContentTranslationPage).source_title.should == source_page_title
 end
 
 Then(/^the content of the page is (.*?)$/) do |page_content|
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^the direction of the source column is (.+)$/) do |direction|
-   pending # express the regexp above with the code you wish you had
-end
-
-Then(/^the direction of the translation column is (.+)$/) do |direction|
-   pending # express the regexp above with the code you wish you had
+Then(/^the direction of the (.+) column is (.+)$/) do |column_type, 
direction|
+   on(ContentTranslationPage).column(column_type).attribute(dir).should 
== direction
 end
 
 Then(/^the first version in the history of the page (.+?) should have the 
tag (.+?)$/) do |page_title, tag_name|
pending # express the regexp above with the code you wish you had
 end
 
-Then(/^the language code of the source column is (.+)$/) do |language_code|
-   pending # express the regexp above with the code you wish you had
-end
-
-Then(/^the language code of the translation column is (.+?)$/) do 
|language_code|
-   pending # express the regexp above with the code you wish you had
+Then(/^the language code of the (.+) column is (.+)$/) do |column_type, 
language_code|
+   on(ContentTranslationPage).column(column_type).attribute(lang).should 
== language_code
 end
 
 Then(/^the page (.+?) is displayed$/) do |page_title|
diff --git a/tests/browser/features/support/pages/content_translation_page.rb 
b/tests/browser/features/support/pages/content_translation_page.rb
index ebcff53..d07919b 100644
--- a/tests/browser/features/support/pages/content_translation_page.rb
+++ b/tests/browser/features/support/pages/content_translation_page.rb
@@ -7,6 +7,8 @@
 
button(:publish_translation, class: publish-translation)
 
+   div(:progress_bar, class: ct-progress-bar)
+
def column(column_type)
@browser.div(class: .ct-column.#{column_type})
end
@@ -15,7 +17,15 @@
column(column_type).span(class: language-label)
end
 
-   def translation_editing_area
+   def source_title
+   column(source).h1(class: source-title)
+   end
+
+   def target_title
+