Fix SlowFinderErrors

This commit is contained in:
Steffen van Bergerem 2014-12-03 10:42:07 +01:00
parent 166590ea36
commit b3f7acb91b
18 changed files with 58 additions and 32 deletions

View file

@ -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

View file

@ -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"

View file

@ -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!"

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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?"

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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