From 34319758eda6b6b62a8aae14ffcd6e5ac7c069fd Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 29 Aug 2015 17:03:20 +0200 Subject: [PATCH] Improve posts from ... page cukes closes #6367 --- features/desktop/posts_from_main_page.feature | 10 ++++------ features/desktop/posts_from_profile_page.feature | 6 +++--- features/step_definitions/custom_web_steps.rb | 13 +++++++++++++ features/step_definitions/posts_steps.rb | 4 ---- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/features/desktop/posts_from_main_page.feature b/features/desktop/posts_from_main_page.feature index ce425b22d..6375a4b19 100644 --- a/features/desktop/posts_from_main_page.feature +++ b/features/desktop/posts_from_main_page.feature @@ -52,7 +52,7 @@ Feature: posting from the main page Scenario: posting a message appends it to the top of the stream When I click the publisher and post "sup dog" And I click the publisher and post "hello there" - Then I should see "hello there" as the first post in my stream + Then "hello there" should be post 1 Scenario: post a text-only message to just one aspect When I select only "PostingTo" aspect @@ -64,7 +64,7 @@ Feature: posting from the main page When I am on the aspects page And I select all aspects And I select only "PostingTo" aspect - Then I should see "I am eating a yogurt" + Then "I am eating a yogurt" should be post 1 When I am on the aspects page And I select all aspects @@ -126,7 +126,6 @@ Feature: posting from the main page And the publisher should be expanded And I close the publisher - @wip Scenario: hide a contact's post Given I expand the publisher When I write the status message "Here is a post for you to hide" @@ -137,8 +136,7 @@ Feature: posting from the main page And I am on "bob@bob.bob"'s page And I hover over the ".stream_element" - And I click to delete the first post - And I confirm the alert + And I click to hide the first post And I go to "bob@bob.bob"'s page Then I should not see "Here is a post for you to hide" When I am on the aspects page @@ -163,7 +161,7 @@ Feature: posting from the main page And I am on the aspects page And I select only "PostingTo" aspect - Then I should see "I am eating a yogurt" + Then "I am eating a yogurt" should be post 1 When I am on the aspects page And I select all aspects And I select only "NotPostingThingsHere" aspect diff --git a/features/desktop/posts_from_profile_page.feature b/features/desktop/posts_from_profile_page.feature index 1f26e5fc1..3ea86e32c 100644 --- a/features/desktop/posts_from_profile_page.feature +++ b/features/desktop/posts_from_profile_page.feature @@ -19,14 +19,14 @@ Feature: posting from own profile page And I press "Share" - Then I should see "I want to understand people" + Then "I want to understand people" should be post 1 When I go to the home page - Then I should see "I want to understand people" + Then "I want to understand people" should be post 1 When I am on the aspects page And I select only "Family" aspect - Then I should see "I want to understand people" + Then "I want to understand people" should be post 1 When I select all aspects And I select only "Work" aspect diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 19c284888..0c7a8f149 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -95,11 +95,24 @@ When /^I prepare the deletion of the first post$/ do end end +When /^I prepare hiding the first post$/ do + within(find(".stream .stream_element", match: :first)) do + ctrl = find(".control-icons") + ctrl.hover + ctrl.find(".hide_post").click + end +end + When /^I click to delete the first post$/ do step "I prepare the deletion of the first post" step "I confirm the alert" end +When /^I click to hide the first post$/ do + step "I prepare hiding the first post" + step "I confirm the alert" +end + When /^I click to delete the first comment$/ do within("div.comment", match: :first) do find(".control-icons").hover diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index 10c04b8ab..bb353b9e0 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -62,10 +62,6 @@ When /^I expand the post$/ do expand_first_post end -Then /^I should see "([^"]*)" as the first post in my stream$/ do |text| - first_post_text.should include(text) -end - When /^I click the publisher and post "([^"]*)"$/ do |text| click_and_post(text) end