Matthias Mullie has submitted this change and it was merged.

Change subject: Fix some browser tests
......................................................................


Fix some browser tests

Change-Id: I328c3f1746e7132346143c91c44a7ca10c72dc31
---
M tests/browser/features/action_menu_permalink.feature
M tests/browser/features/anon_interface.feature
M tests/browser/features/edit_existing.feature
M tests/browser/features/flow_in_recent_changes.feature
M tests/browser/features/flow_logged_in.feature
M tests/browser/features/flow_no_javascript.feature
M tests/browser/features/mark_topic_as_resolved.feature
M tests/browser/features/moderation.feature
M tests/browser/features/new_topic.feature
M tests/browser/features/post_links.feature
M tests/browser/features/reopen_topic.feature
M tests/browser/features/reply.feature
M tests/browser/features/reply_moderation.feature
M tests/browser/features/sorting_topics.feature
M tests/browser/features/step_definitions/action_menu_permalink_steps.rb
M tests/browser/features/step_definitions/reply_moderation_steps.rb
M tests/browser/features/step_definitions/reply_steps.rb
M tests/browser/features/step_definitions/watch_steps.rb
M tests/browser/features/support/pages/flow_page.rb
M tests/browser/features/suppress.feature
M tests/browser/features/thank.feature
M tests/browser/features/watch.feature
22 files changed, 133 insertions(+), 62 deletions(-)

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



diff --git a/tests/browser/features/action_menu_permalink.feature 
b/tests/browser/features/action_menu_permalink.feature
index cdeac63..cbeb5b5 100644
--- a/tests/browser/features/action_menu_permalink.feature
+++ b/tests/browser/features/action_menu_permalink.feature
@@ -1,31 +1,31 @@
-@chrome @clean @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Actions menu Permalink
 
   Background:
     Given I am logged in
-      And I am on Flow page
+    And I am on Flow page
 
   Scenario: Topic Actions menu Permalink
     Given I have created a Flow topic with title "Permalinktest"
     When I hover on the Topic Actions link
-      And I click Permalink from the Actions menu
-      And I am viewing Topic page
+    And I click Permalink from the Actions menu
+    And I am viewing Topic page
     Then I see only one topic on the page
-      And the top post should have a heading which contains "Permalinktest"
+    And the top post should have a heading which contains "Permalinktest"
 
   Scenario: Actions menu Permalink
-    Given I have created a Flow topic with title "PermalinkReplyTest"
-      And I add 3 comments to the Topic
-    When I hover on the Post Actions link on the 3rd comment on the topic
-      And I hover on the Post Actions link on the 3rd comment on the topic
-      And I click Permalink from the 3rd comment Post Actions menu
-      And I am viewing Topic page
-    Then I see only one topic on the page
-      And the highlighted comment should contain the text for the 3rd comment
+    Given I have created a Flow topic
+    And I reply with comment "this is my response"
+    When I select the permalink for the second post of the first topic
+    Then I am viewing Topic page
+    And I see only one topic on the page
+    And the highlighted comment is "this is my response"
 
-    Scenario: Old style topic permalink
-      Given I have created a Flow topic with title "Permalinktest"
-      When I go to an old style permalink to my topic
-        And I am viewing Topic page
-      Then I see only one topic on the page
-        And the top post should have a heading which contains "Permalinktest"
+  Scenario: Old style topic permalink
+    Given I have created a Flow topic with title "Permalinktest"
+    When I go to an old style permalink to my topic
+    And I am viewing Topic page
+    Then I see only one topic on the page
+    And the top post should have a heading which contains "Permalinktest"
diff --git a/tests/browser/features/anon_interface.feature 
b/tests/browser/features/anon_interface.feature
index 37eb364..a9f95f4 100644
--- a/tests/browser/features/anon_interface.feature
+++ b/tests/browser/features/anon_interface.feature
@@ -1,4 +1,6 @@
-@chrome @clean @ee-prototype.wmflabs.org @en.wikipedia.beta.wmflabs.org 
@firefox @internet_explorer_10 @login @phantomjs @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10 @phantomjs
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Check the interface for anonymous users
 
   Scenario: Anon does not see block or actions
diff --git a/tests/browser/features/edit_existing.feature 
b/tests/browser/features/edit_existing.feature
index 7b19c64..edd99d9 100644
--- a/tests/browser/features/edit_existing.feature
+++ b/tests/browser/features/edit_existing.feature
@@ -1,4 +1,6 @@
-@clean @ee-prototype.wmflabs.org @en.wikipedia.beta.wmflabs.org @firefox 
@internet_explorer_10 @login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Edit existing title
 
   Assumes that the test Flow page has at least two topics (with posts).
diff --git a/tests/browser/features/flow_in_recent_changes.feature 
b/tests/browser/features/flow_in_recent_changes.feature
index e0b6599..8ecc0a4 100644
--- a/tests/browser/features/flow_in_recent_changes.feature
+++ b/tests/browser/features/flow_in_recent_changes.feature
@@ -1,4 +1,6 @@
-@clean @ee-prototype.wmflabs.org @en.wikipedia.beta.wmflabs.org @firefox 
@internet_explorer_10 @login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Flow updates are in Recent Changes
 
   Background:
diff --git a/tests/browser/features/flow_logged_in.feature 
b/tests/browser/features/flow_logged_in.feature
index 73e9d00..1c4e1d6 100644
--- a/tests/browser/features/flow_logged_in.feature
+++ b/tests/browser/features/flow_logged_in.feature
@@ -1,4 +1,6 @@
-@chrome @clean @ee-prototype.wmflabs.org @en.wikipedia.beta.wmflabs.org 
@firefox @login @test2.wikipedia.org
+@chrome @firefox
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Create new topic logged in
 
   It requires the cldr extension, a "Flow QA" page, and a "Selenium user" who 
has
diff --git a/tests/browser/features/flow_no_javascript.feature 
b/tests/browser/features/flow_no_javascript.feature
index 439bbd6..0437696 100644
--- a/tests/browser/features/flow_no_javascript.feature
+++ b/tests/browser/features/flow_no_javascript.feature
@@ -1,4 +1,6 @@
-@custom-browser @en.wikipedia.beta.wmflabs.org @firefox @login 
@test2.m.wikipedia.org
+@custom-browser @firefox
+@login
+@en.wikipedia.beta.wmflabs.org
 Feature: Basic site for legacy devices
 
   Background:
diff --git a/tests/browser/features/mark_topic_as_resolved.feature 
b/tests/browser/features/mark_topic_as_resolved.feature
index a040b12..d6f5f45 100644
--- a/tests/browser/features/mark_topic_as_resolved.feature
+++ b/tests/browser/features/mark_topic_as_resolved.feature
@@ -1,4 +1,6 @@
-@chrome @internet_explorer_10 @firefox @login @clean 
@en.wikipedia.beta.wmflabs.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Mark topic as resolved
 
   Background:
diff --git a/tests/browser/features/moderation.feature 
b/tests/browser/features/moderation.feature
index b3f0260..2f0bd10 100644
--- a/tests/browser/features/moderation.feature
+++ b/tests/browser/features/moderation.feature
@@ -1,4 +1,6 @@
-@chrome @clean @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Moderation
 
   Assumes Flow is enabled for the User_talk namespace.
diff --git a/tests/browser/features/new_topic.feature 
b/tests/browser/features/new_topic.feature
index 78494bb..a9ae4a4 100644
--- a/tests/browser/features/new_topic.feature
+++ b/tests/browser/features/new_topic.feature
@@ -1,4 +1,5 @@
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@phantomjs @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10 @phantomjs
+@en.wikipedia.beta.wmflabs.org
 Feature: Creating a new topic
 
   Background:
diff --git a/tests/browser/features/post_links.feature 
b/tests/browser/features/post_links.feature
index 1ad2dfc..5c1c39b 100644
--- a/tests/browser/features/post_links.feature
+++ b/tests/browser/features/post_links.feature
@@ -1,4 +1,6 @@
-@chrome @clean @ee-prototype.wmflabs.org @en.wikipedia.beta.wmflabs.org 
@firefox @internet_explorer_10 @login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Follow user links
 
   Scenario: User links takes me to the user page
diff --git a/tests/browser/features/reopen_topic.feature 
b/tests/browser/features/reopen_topic.feature
index e8aa645..71d35ef 100644
--- a/tests/browser/features/reopen_topic.feature
+++ b/tests/browser/features/reopen_topic.feature
@@ -1,4 +1,6 @@
-@chrome @internet_explorer_10 @firefox @login @clean 
@en.wikipedia.beta.wmflabs.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Reopen a resolved topic
 
   Background:
diff --git a/tests/browser/features/reply.feature 
b/tests/browser/features/reply.feature
index 9160791..0213c0c 100644
--- a/tests/browser/features/reply.feature
+++ b/tests/browser/features/reply.feature
@@ -1,4 +1,6 @@
-@chrome @clean @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Replying
 
   Background:
diff --git a/tests/browser/features/reply_moderation.feature 
b/tests/browser/features/reply_moderation.feature
index 32face1..d872112 100644
--- a/tests/browser/features/reply_moderation.feature
+++ b/tests/browser/features/reply_moderation.feature
@@ -1,17 +1,15 @@
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 @login 
@test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@login
+@en.wikipedia.beta.wmflabs.org
 Feature: Reply moderation
 
   Background:
     Given I am logged in
-        And I am on Flow page
+    And I am on Flow page
 
   Scenario: Hiding a comment
     Given I have created a Flow topic with title "Hide comment test"
-      And I add 3 comments to the Topic
-    When I hover on the Post Actions link on the 3rd comment on the topic
-        And I click Hide comment button
-        And I see a dialog box
-        And I give reason for hiding as being "Shhhh!"
-        And I click the Hide button in the dialog
-    Then the 3rd comment should be marked as hidden
-        And the content of the 3rd comment should not be visible
+    And I reply with comment "hide me if you dare"
+    When I hide the second comment with reason "Shhhhh!"
+    Then the second comment should be marked as hidden
+    And the content of the second comment should not be visible
diff --git a/tests/browser/features/sorting_topics.feature 
b/tests/browser/features/sorting_topics.feature
index a1bcc8e..177ecd1 100644
--- a/tests/browser/features/sorting_topics.feature
+++ b/tests/browser/features/sorting_topics.feature
@@ -1,4 +1,6 @@
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@phantomjs @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10 @phantomjs
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Sorting topics
 
   Background:
diff --git 
a/tests/browser/features/step_definitions/action_menu_permalink_steps.rb 
b/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
index 17361d1..62885aa 100644
--- a/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
+++ b/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
@@ -5,6 +5,13 @@
   end
 end
 
+When(/^I select the permalink for the second post of the first topic$/) do
+  on(FlowPage) do |page|
+    page.second_post_actions_link_element.when_present.click
+    page.actions_link_permalink_second_comment_element.when_present.click
+  end
+end
+
 When(/^I click Permalink from the Actions menu$/) do
   on(FlowPage).permalink_button_element.when_present.click
 end
@@ -37,6 +44,10 @@
   end
 end
 
+Then(/^the highlighted comment is "(.*?)"$/) do |post_text|
+  expect(on(FlowPage).highlighted_post).to match post_text
+end
+
 Then(/^the highlighted comment should contain the text for the 3rd comment$/) 
do
   expect(on(FlowPage).highlighted_post).to match @saved_random
 end
diff --git a/tests/browser/features/step_definitions/reply_moderation_steps.rb 
b/tests/browser/features/step_definitions/reply_moderation_steps.rb
index b9f607f..9e939f3 100644
--- a/tests/browser/features/step_definitions/reply_moderation_steps.rb
+++ b/tests/browser/features/step_definitions/reply_moderation_steps.rb
@@ -12,13 +12,22 @@
   end
 end
 
-Then(/^the 3rd comment should be marked as hidden$/) do
+When(/^I hide the second comment with reason "(.*?)"$/) do |reason|
   on(FlowPage) do |page|
-    page.third_reply_element.when_present
-    expect(page.third_reply_moderation_msg).to match('This comment was hidden')
+    page.second_post_actions_link_element.when_present.click
+    page.actions_link_hide_second_comment_element.when_present.click
+  end
+  step "I type \"#{reason}\" in the dialog box"
+  step 'I click the Hide button in the dialog'
+end
+
+Then(/^the second comment should be marked as hidden$/) do
+  on(FlowPage) do |page|
+    page.second_post_element.when_present
+    expect(page.second_post_moderation_msg).to match('This comment was hidden')
   end
 end
 
-Then(/^the content of the 3rd comment should not be visible$/) do
-  expect(on(FlowPage).third_reply_content_element).not_to be_visible
+Then(/^the content of the second comment should not be visible$/) do
+  expect(on(FlowPage).second_post_content_element).not_to be_visible
 end
diff --git a/tests/browser/features/step_definitions/reply_steps.rb 
b/tests/browser/features/step_definitions/reply_steps.rb
index f480463..b85895e 100644
--- a/tests/browser/features/step_definitions/reply_steps.rb
+++ b/tests/browser/features/step_definitions/reply_steps.rb
@@ -1,7 +1,7 @@
 Given(/^I am not watching my new Flow topic$/) do
   on(FlowPage) do |page|
     page.first_topic_unwatch_link_element.when_present.click
-    page.first_topic_unwatch_link_element.when_not_visible
+    page.first_topic_watch_link_element.when_present
   end
 end
 
@@ -16,18 +16,19 @@
 When(/^I reply with comment "(.*?)"$/) do |content|
   on(FlowPage) do |page|
     page.new_reply_save_element.when_not_present
-    page.new_reply_input_element.when_present.click
-    page.new_reply_input_element.send_keys(content)
+    page.new_reply_placeholder_element.when_present.click
+    page.new_reply_editor_element.send_keys(content)
     page.new_reply_save_element.when_present.click
     page.new_reply_save_element.when_not_present
+    page.flow_first_topic_element.paragraph_element(text: content).when_present
   end
 end
 
 When(/^I start a reply with comment "(.*?)"$/) do |content|
   on(FlowPage) do |page|
     page.new_reply_save_element.when_not_present
-    page.new_reply_input_element.when_present.click
-    page.new_reply_input_element.send_keys(content)
+    page.new_reply_placeholder_element.when_present.click
+    page.new_reply_editor_element.send_keys(content)
   end
 end
 
@@ -44,7 +45,7 @@
 
 Then(/^I should see the topic reply form$/) do
   on(FlowPage) do |page|
-    page.wait_until { page.new_reply_input_element.visible? }
-    expect(page.new_reply_input_element).to be_visible
+    page.wait_until { page.new_reply_editor_element.visible? }
+    expect(page.new_reply_editor_element).to be_visible
   end
 end
diff --git a/tests/browser/features/step_definitions/watch_steps.rb 
b/tests/browser/features/step_definitions/watch_steps.rb
index 57ca38a..149c0b3 100644
--- a/tests/browser/features/step_definitions/watch_steps.rb
+++ b/tests/browser/features/step_definitions/watch_steps.rb
@@ -58,7 +58,6 @@
 
 Then(/^I should see the Watch Topic link$/) do
   on(FlowPage) do |page|
-    page.first_topic_unwatch_link_element.when_not_visible
-    expect(page.first_topic_watch_link_element).to be_visible
+    page.first_topic_watch_link_element.when_present
   end
 end
diff --git a/tests/browser/features/support/pages/flow_page.rb 
b/tests/browser/features/support/pages/flow_page.rb
index 85243a2..1f6e4e4 100644
--- a/tests/browser/features/support/pages/flow_page.rb
+++ b/tests/browser/features/support/pages/flow_page.rb
@@ -10,7 +10,7 @@
     if parent.div_element(class: 'flow-editor-visualeditor').exists?
       parent.div_element(class: 've-ce-documentNode')
     else
-      parent.div_element(class: 'oo-ui-widget').text_area_element
+      parent.div_element(class: 'oo-ui-textInputWidget').text_area_element
     end
   end
 
@@ -187,6 +187,26 @@
     page.first_reply_element.div_element(css: '.flow-post-content')
   end
 
+  #### 2rd post
+  div(:second_post, css: '.flow-post', index: 1)
+  a(:second_post_actions_link, css: ".flow-topic .flow-post .flow-menu-js-drop 
a", index: 1)
+  ul(:second_post_actions_menu, css: ".flow-topic .flow-post .flow-menu ul", 
index: 1)
+
+  a(:actions_link_permalink_second_comment) do |page|
+    page.second_post_actions_menu_element.link_element(text: "Permalink")
+  end
+
+  a(:actions_link_hide_second_comment) do |page|
+    page.second_post_actions_menu_element.link_element(text: "Hide")
+  end
+
+  div(:second_post_content) do |page|
+    page.second_post_element.div_element(css: '.flow-post-content', index: 0)
+  end
+  div(:second_post_moderation_msg) do |page|
+    page.second_post_element.span_element(css: '.flow-moderated-post-content', 
index: 0)
+  end
+
   #### 3rd reply
   # @todo: Should be index: 2, but sadly no way to distinguish replies from 
original post
   div(:third_reply, css: '.flow-post', index: 3)
@@ -224,7 +244,11 @@
   # top-level replies to the topic, and replies to regular posts
   form(:new_reply_form, css: ".flow-reply-form")
 
-  def new_reply_input_element
+  text_area(:new_reply_placeholder) do |page|
+    page.new_reply_form_element.text_area_element
+  end
+
+  def new_reply_editor_element
     visualeditor_or_textarea 'flow-reply-form'
   end
 
@@ -257,9 +281,9 @@
   text_field(:no_javascript_topic_title_text, name: "topiclist_topic")
 
   # Sorting
-  a(:newest_topics_link, text: "Newest topics")
+  span(:newest_topics_link, text: "Newest topics")
   a(:recently_active_topics_choice, href: /topiclist_sortby=updated/)
-  a(:recently_active_topics_link, text: "Recently active topics")
+  span(:recently_active_topics_link, text: "Recently active topics")
   a(:newest_topics_choice, href: /topiclist_sortby=newest/)
 
   ## Watch and unwatch links
diff --git a/tests/browser/features/suppress.feature 
b/tests/browser/features/suppress.feature
index c411af9..4063535 100644
--- a/tests/browser/features/suppress.feature
+++ b/tests/browser/features/suppress.feature
@@ -1,4 +1,6 @@
-@chrome @clean @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Suppress
 
   Assumes Flow is enabled on Talk:Flow_QA
diff --git a/tests/browser/features/thank.feature 
b/tests/browser/features/thank.feature
index a347922..54af7ec 100644
--- a/tests/browser/features/thank.feature
+++ b/tests/browser/features/thank.feature
@@ -1,4 +1,6 @@
-@chrome @clean @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 
@login @test2.wikipedia.org
+@chrome @firefox @internet_explorer_10
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Thank author of a Flow post
 
   Scenario: Anon does not see Thank button
diff --git a/tests/browser/features/watch.feature 
b/tests/browser/features/watch.feature
index b746083..704ecd3 100644
--- a/tests/browser/features/watch.feature
+++ b/tests/browser/features/watch.feature
@@ -1,4 +1,6 @@
-@test2.wikipedia.org @en.wikipedia.beta.wmflabs.org @phantomjs
+@chrome @firefox @internet_explorer_10 @phantomjs
+@clean @login
+@en.wikipedia.beta.wmflabs.org
 Feature: Watching/Unwatching Boards and Topics
 
        Scenario: Watch topic

-- 
To view, visit https://gerrit.wikimedia.org/r/220000
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I328c3f1746e7132346143c91c44a7ca10c72dc31
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: Mooeypoo <mor...@gmail.com>
Gerrit-Reviewer: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to