Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86194
Change subject: Tests for project card actions
......................................................................
Tests for project card actions
Change-Id: Ie0031f53737d54f051dfa78d0d326223ff2cd889
---
M tests/browser/features/signed_in_and_approved_users.feature
M tests/browser/features/step_definitions/signed_in_and_approved_user_steps.rb
M tests/browser/features/support/pages/main_page.rb
3 files changed, 33 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwnMainPage
refs/changes/94/86194/1
diff --git a/tests/browser/features/signed_in_and_approved_users.feature
b/tests/browser/features/signed_in_and_approved_users.feature
index fc25322..22a3671 100644
--- a/tests/browser/features/signed_in_and_approved_users.feature
+++ b/tests/browser/features/signed_in_and_approved_users.feature
@@ -37,23 +37,19 @@
And I click the "Proofread" button in my personal stats
Then I should see list of recent translations in the proofreading view
- Scenario: "View language statistics" link should take the user to the
statistics page on TWN
- Given that I am an approved translator on TWN
- And I am logged in
- When I click on the 'View language statistics' link
- Then I should see the Special:LanguageStats page
+ Scenario: Going to translate a project
+ When I change my interface language away from English
+ And I go to the main page
+ And I hover a project card
+ And I click the "Translate" button on a project card
+ Then I should see list of messages in the the translation view
- Scenario: Clicking on project card -> Translate takes to translation editor
- Given that I am an approved translator on TWN
- And I have successfully signed-in
- When I click on the 'Translate' button displayed on hover on a Project Card
- Then I should see the translation editor in the translate view
-
- Scenario: Clicking on project card -> Proofread takes to proof read mode in
the editor
- Given that I am an approved translator on TWN
- And I have successfully signed-in
- When I click on the 'Proofread' button displayed on hover on a Project Card
- Then I should see the translation editor in the proofread view
+ Scenario: Going to proofread a project
+ When I change my interface language away from English
+ And I go to the main page
+ And I hover a project card
+ And I click the "Proofread" button on a project card
+ Then I should see list of messages in the the proofreading view
Scenario: Selection of a group from the message group dialog takes the user
to translation view of that group
Given I am an approved signed-in translator on TWN
diff --git
a/tests/browser/features/step_definitions/signed_in_and_approved_user_steps.rb
b/tests/browser/features/step_definitions/signed_in_and_approved_user_steps.rb
index edfa5fc..7be1f9f 100644
---
a/tests/browser/features/step_definitions/signed_in_and_approved_user_steps.rb
+++
b/tests/browser/features/step_definitions/signed_in_and_approved_user_steps.rb
@@ -39,3 +39,22 @@
end
end
+When(/^I hover a project card$/) do
+ # Hover does not work if the element is outside of the viewport, GRRR!
+ on(MainPage).project_card_element.hover
+end
+
+When(/^I click the "(.*?)" button on a project card$/) do |action|
+ # .a() throws deprecation warning, making bunny sad
+ on(MainPage).project_card_element.a(class: action.downcase).click
+end
+
+Then(/^I should see list of messages in the the translation view$/) do
+
on(TranslatePage).translate_mode_button_element.attribute('class').should
match(/\bdown\b/)
+end
+
+Then(/^I should see list of messages in the the proofreading view$/) do
+
on(TranslatePage).proofread_mode_button_element.attribute('class').should
match(/\bdown\b/)
+end
+
+
diff --git a/tests/browser/features/support/pages/main_page.rb
b/tests/browser/features/support/pages/main_page.rb
index 855c54d..d7fc8a6 100644
--- a/tests/browser/features/support/pages/main_page.rb
+++ b/tests/browser/features/support/pages/main_page.rb
@@ -11,4 +11,6 @@
button(:translate_recent_messages, id: 'twnmp-translate')
button(:proofread_recent_translations, id: 'twnmp-proofread')
+
+ div(:project_card, class: 'project-tile', index: 0)
end
--
To view, visit https://gerrit.wikimedia.org/r/86194
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0031f53737d54f051dfa78d0d326223ff2cd889
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwnMainPage
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits