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
+ column("translation").text_field(class: "target-title")
+ end
+
+ def translation_editor
@browser.div(css: ".translation div[contenteditable]")
end
end
--
To view, visit https://gerrit.wikimedia.org/r/106259
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I56277bb0e2d6bd356aec06c1f64c672f993e9af6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits