diff --git a/features/desktop/aspect_navigation.feature b/features/desktop/aspect_navigation.feature index 0e3016e9e..84d601857 100644 --- a/features/desktop/aspect_navigation.feature +++ b/features/desktop/aspect_navigation.feature @@ -17,11 +17,10 @@ Feature: Aspect navigation on the left menu Scenario: Aspects selection is remembered through site navigation When I select only "Besties" aspect - And I click the publisher and post "Hey besties!" - - When I go to the aspects page - And I select only "Besties" aspect - Then I should see "Hey besties!" + And I go to the aspects page + Then I should see "Besties" aspect selected + And I should see "Unicorns" aspect unselected + And I should see "Others" aspect unselected When I go to the contacts page And I go to the aspects page diff --git a/features/desktop/mentions_from_profile_page.feature b/features/desktop/mentions_from_profile_page.feature index 9a0f1822e..d1e4490ea 100644 --- a/features/desktop/mentions_from_profile_page.feature +++ b/features/desktop/mentions_from_profile_page.feature @@ -50,5 +50,6 @@ Feature: mentioning a contact from their profile page Then I should see "I am eating a yogurt" When I am on the aspects page + And I select all aspects And I select only "NotPostingThingsHere" aspect Then I should not see "I am eating a yogurt" diff --git a/features/desktop/not_safe_for_work.feature b/features/desktop/not_safe_for_work.feature index 781632287..6d7f7fd7d 100644 --- a/features/desktop/not_safe_for_work.feature +++ b/features/desktop/not_safe_for_work.feature @@ -22,14 +22,11 @@ Scenario: Toggling nsfw state Given a nsfw user with email "tommy@pr0nking.com" And a user with email "laura@officeworkers.com" And a user with email "laura@officeworkers.com" is connected with "tommy@pr0nking.com" - When I sign in as "tommy@pr0nking.com" - And I click the publisher and post "I love 0bj3ction4bl3 c0nt3nt!" - And I click the publisher and post "Sexy Senators Gone Wild!" - Then I should have 2 nsfw posts + And "tommy@pr0nking.com" has a public post with text "I love 0bj3ction4bl3 c0nt3nt!" + And "tommy@pr0nking.com" has a public post with text "Sexy Senators Gone Wild!" #toggling global nsfw state - When I log out - And I sign in as "laura@officeworkers.com" + When I sign in as "laura@officeworkers.com" Then I should not see "I love 0bj3ction4bl3 c0nt3nt!" When I toggle nsfw posts Then I should see "I love 0bj3ction4bl3 c0nt3nt!" and "Sexy Senators Gone Wild!" diff --git a/features/desktop/posts_from_main_page.feature b/features/desktop/posts_from_main_page.feature index c42cc9453..03f7f451b 100644 --- a/features/desktop/posts_from_main_page.feature +++ b/features/desktop/posts_from_main_page.feature @@ -42,10 +42,12 @@ Feature: posting from the main page Given I expand the publisher When I write the status message "The World needs more Cats." And I submit the publisher - - And I go to the aspects page Then "The World needs more Cats." should be post 1 - Then "The World needs more Cats." should be post 2 + And "The World needs more Cats." should be post 2 + + When I go to the aspects page + Then "The World needs more Cats." should be post 1 + And "The World needs more Cats." should be post 2 Scenario: posting a message appends it to the top of the stream When I click the publisher and post "sup dog" @@ -60,10 +62,12 @@ Feature: posting from the main page And I submit the publisher 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" When I am on the aspects page + And I select all aspects And I select only "NotPostingThingsHere" aspect Then I should not see "I am eating a yogurt" @@ -161,6 +165,7 @@ Feature: posting from the main page And I select only "PostingTo" aspect Then I should see "I am eating a yogurt" When I am on the aspects page + And I select all aspects And I select only "NotPostingThingsHere" aspect Then I should not see "I am eating a yogurt" @@ -181,10 +186,12 @@ Feature: posting from the main page And I select only "PostingTo" aspect Then I should see "I am eating a yogurt" and "And cornflakes also" When I am on the aspects page + And I select all aspects And I select only "Besties" aspect Then I should not see "I am eating a yogurt" Then I should see "And cornflakes also" When I am on the aspects page + And I select all aspects And I select only "NotPostingThingsHere" aspect Then I should not see "I am eating a yogurt" and "And cornflakes also" diff --git a/features/desktop/posts_from_profile_page.feature b/features/desktop/posts_from_profile_page.feature index ed85d3eb9..6eb9aeb99 100644 --- a/features/desktop/posts_from_profile_page.feature +++ b/features/desktop/posts_from_profile_page.feature @@ -29,7 +29,8 @@ Feature: posting from own profile page And I select only "Family" aspect Then I should see "I want to understand people" - When I select only "Work" aspect + When I select all aspects + And I select only "Work" aspect Then I should not see "I want to understand people" Scenario: post a photo with text diff --git a/features/mobile/activity_stream.feature b/features/mobile/activity_stream.feature index 2ed571a8c..04d973703 100644 --- a/features/mobile/activity_stream.feature +++ b/features/mobile/activity_stream.feature @@ -8,7 +8,7 @@ Feature: Viewing my activity on the steam mobile page Given a user with username "alice" And "alice@alice.alice" has a public post with text "Hello! i am #newhere" When I toggle the mobile view - And I sign in as "alice@alice.alice" + And I sign in as "alice@alice.alice" on the mobile website Scenario: Show my activity empty When I open the drawer diff --git a/features/mobile/conversations.feature b/features/mobile/conversations.feature index 2ecf1b414..c0814f40a 100644 --- a/features/mobile/conversations.feature +++ b/features/mobile/conversations.feature @@ -9,7 +9,7 @@ Feature: private conversations mobile And a user named "Alice Awesome" with email "alice@alice.alice" And a user with username "bob" is connected with "alice_awesome" When I toggle the mobile view - And I sign in as "bob@bob.bob" + And I sign in as "bob@bob.bob" on the mobile website Scenario: send and delete a mobile message Given I send a mobile message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" @@ -18,7 +18,7 @@ Feature: private conversations mobile And I press the first ".ltr" within ".conversation" And "Alice Awesome" should be part of active conversation And I should see "hello, alice!" within ".stream_element" - When I sign in as "alice@alice.alice" + When I sign in as "alice@alice.alice" on the mobile website And I reply with "hey, how you doing?" And I press the first ".ltr" within ".conversation" Then I should see "hey, how you doing?" diff --git a/features/mobile/multiphoto.feature b/features/mobile/multiphoto.feature index 835d2109a..ab0d19b14 100644 --- a/features/mobile/multiphoto.feature +++ b/features/mobile/multiphoto.feature @@ -8,7 +8,7 @@ Feature: viewing photos on the mobile main page Given a user with username "bob" When I toggle the mobile view - And I sign in as "bob@bob.bob" + And I sign in as "bob@bob.bob" on the mobile website And I click on selector "#compose_badge" Scenario: view full size image diff --git a/features/mobile/posts_from_main_page.feature b/features/mobile/posts_from_main_page.feature index f1371cf18..ce50391f3 100644 --- a/features/mobile/posts_from_main_page.feature +++ b/features/mobile/posts_from_main_page.feature @@ -11,7 +11,7 @@ Feature: posting from the mobile main page | alice | And I toggle the mobile view And I am on the home page - And I sign in as "bob@bob.bob" + And I sign in as "bob@bob.bob" on the mobile website And a user with username "bob" is connected with "alice" Given I have following aspects: | PostingTo | @@ -39,7 +39,7 @@ Feature: posting from the mobile main page When I visit the mobile stream page Then I should see a "img" within ".stream_element div.photo_attachments" When I log out - And I sign in as "alice@alice.alice" + And I sign in as "alice@alice.alice" on the mobile website When I visit the mobile stream page Then I should see a "img" within ".stream_element div.photo_attachments" diff --git a/features/mobile/reactions.feature b/features/mobile/reactions.feature index e60b4e9b8..f783cadbe 100644 --- a/features/mobile/reactions.feature +++ b/features/mobile/reactions.feature @@ -12,7 +12,7 @@ Feature: reactions mobile post And a user with email "bob@bob.bob" is connected with "alice@alice.alice" When "alice@alice.alice" has posted a status message with a photo And I toggle the mobile view - And I sign in as "bob@bob.bob" + And I sign in as "bob@bob.bob" on the mobile website Scenario: like on a mobile post When I should see "0 reactions" within ".show_comments" diff --git a/features/mobile/reshare.feature b/features/mobile/reshare.feature index 1ea29c28a..a5bbde489 100644 --- a/features/mobile/reshare.feature +++ b/features/mobile/reshare.feature @@ -43,6 +43,6 @@ Feature: resharing from the mobile And I toggle the mobile view Then I should see "Original post deleted by author." within ".reshare" And I log out - And I sign in as "eve@eve.eve" + And I sign in as "eve@eve.eve" on the mobile website And I toggle the mobile view Then I should see "Original post deleted by author." within ".reshare" diff --git a/features/mobile/signs_up.feature b/features/mobile/signs_up.feature index 5f241f802..fd09d8c1c 100644 --- a/features/mobile/signs_up.feature +++ b/features/mobile/signs_up.feature @@ -7,10 +7,10 @@ Feature: New user registration Background: Given I toggle the mobile view And I am on the login page - And I follow "Sign up" + And I follow "Sign up" Scenario: user signs up and goes to getting started - When I fill in the new user form + When I fill in the new user form And I submit the form Then I should be on the getting started page Then I should see the 'getting started' contents diff --git a/features/mobile/tags.feature b/features/mobile/tags.feature index e5e25d187..350928997 100644 --- a/features/mobile/tags.feature +++ b/features/mobile/tags.feature @@ -4,8 +4,8 @@ Feature: Interacting with tags Background: Given a user with username "alice" And "alice@alice.alice" has a public post with text "Hello! i am #newhere" - When I toggle the mobile view - And I sign in as "alice@alice.alice" + When I sign in as "alice@alice.alice" + And I toggle the mobile view Scenario: Searching for a tag When I visit the mobile search page diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index ad0234174..a151df7f0 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -15,13 +15,17 @@ module AspectCukeHelpers def toggle_aspect_via_ui(aspect_name) aspects_dropdown = find(".aspect_membership_dropdown .dropdown-toggle", match: :first) aspects_dropdown.click + selected_aspect_count = all(".aspect_membership_dropdown.open .dropdown-menu li.selected").length aspect = find(".aspect_membership_dropdown.open .dropdown-menu li", text: aspect_name) + aspect_selected = aspect["class"].include? "selected" aspect.click aspect.parent.should have_no_css(".loading") # close dropdown page.should have_no_css('#profile.loading') - aspects_dropdown.click if aspects_dropdown.has_xpath?("..[contains(@class, 'active')]", wait: 3) + unless selected_aspect_count == 0 or (selected_aspect_count == 1 and aspect_selected ) + aspects_dropdown.click + end aspects_dropdown.should have_no_xpath("..[contains(@class, 'active')]") end @@ -42,7 +46,6 @@ end When /^I select only "([^"]*)" aspect$/ do |aspect_name| click_link 'My Aspects' within('#aspects_list') do - click_link 'Select all' if has_link? 'Select all' click_link 'Deselect all' current_scope.should have_no_css '.selected' end @@ -56,6 +59,12 @@ When /^I select "([^"]*)" aspect as well$/ do |aspect_name| step %Q(I should see "#{aspect_name}" aspect selected) end +When /^I select all aspects$/ do + within('#aspects_list') do + click_link "Select all" + end +end + When /^I add the first person to the aspect$/ do find(".contact_add-to-aspect", match: :first).tap do |button| button.click diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 98225c6be..270ca8f4f 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -165,7 +165,7 @@ Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, end Then /^page should (not )?have "([^\"]*)"$/ do |negate, selector| - page.has_css?(selector).should ( negate ? (be false) : (be true) ) + page.should ( negate ? (have_no_css(selector)) : (have_css(selector)) ) end When /^I have turned off jQuery effects$/ do diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index 1679e4506..4179799fd 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -21,6 +21,13 @@ When /^I (?:sign|log) in as "([^"]*)"$/ do |email| confirm_login end +When /^I (?:sign|log) in as "([^"]*)" on the mobile website$/ do |email| + @me = User.find_by_email(email) + @me.password ||= 'password' + automatic_login + confirm_login_mobile +end + When /^I (?:sign|log) in with password "([^"]*)"$/ do |password| @me.password = password automatic_login diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index a78d8cece..7c15d6ff4 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -29,7 +29,7 @@ module PublishingCukeHelpers txt = find('#publisher #status_message_fake_text').value find('#publisher .creation').click # wait for the content to appear - expect(page).to have_content(txt) unless page.has_css?('.nsfw-shield') + expect(find('#main_stream')).to have_content(txt) end def click_and_post(text) @@ -52,7 +52,7 @@ module PublishingCukeHelpers def expand_first_post within(".stream_element", match: :first) do find(".expander").click - expect(has_css?(".expander")).to be false + expect(page).to have_no_css(".expander") end end diff --git a/features/support/user_cuke_helpers.rb b/features/support/user_cuke_helpers.rb index 056b12db9..20603dde8 100644 --- a/features/support/user_cuke_helpers.rb +++ b/features/support/user_cuke_helpers.rb @@ -47,6 +47,11 @@ module UserCukeHelpers page.has_content?("#{@me.first_name} #{@me.last_name}") end + # checks the mobile page content to see, if the login was successful + def confirm_login_mobile + page.has_css?("#notification_badge") + end + # delete all cookies, destroying the current session def logout $browser.delete_cookie('_session', 'path=/') if $browser