jenkins-bot has submitted this change and it was merged.

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(-)

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



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..b980653 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
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
 When(/I go to the main page$/) do
        visit(MainPage)
 end
@@ -39,3 +41,20 @@
        end
 end
 
+When(/^I hover a project card$/) do
+       on(MainPage).project_card_element.fire_event('onmouseover')
+end
+
+When(/^I click the "(.*?)" button on a project card$/) do |action|
+       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: merged
Gerrit-Change-Id: Ie0031f53737d54f051dfa78d0d326223ff2cd889
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/TwnMainPage
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to