Merge pull request #5455 from svbergerem/fix-slowfindererrors

Fix SlowFinderErrors
This commit is contained in:
Jonne Haß 2014-12-03 23:26:04 +01:00
commit 10691e6551
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 Scenario: Aspects selection is remembered through site navigation
When I select only "Besties" aspect When I select only "Besties" aspect
And I click the publisher and post "Hey besties!" And I go to the aspects page
Then I should see "Besties" aspect selected
When I go to the aspects page And I should see "Unicorns" aspect unselected
And I select only "Besties" aspect And I should see "Others" aspect unselected
Then I should see "Hey besties!"
When I go to the contacts page When I go to the contacts page
And I go to the aspects 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" Then I should see "I am eating a yogurt"
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "NotPostingThingsHere" aspect And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt" 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" 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"
And a user with email "laura@officeworkers.com" is connected with "tommy@pr0nking.com" And a user with email "laura@officeworkers.com" is connected with "tommy@pr0nking.com"
When I sign in as "tommy@pr0nking.com" And "tommy@pr0nking.com" has a public post with text "I love 0bj3ction4bl3 c0nt3nt!"
And I click the publisher and post "I love 0bj3ction4bl3 c0nt3nt!" And "tommy@pr0nking.com" has a public post with text "Sexy Senators Gone Wild!"
And I click the publisher and post "Sexy Senators Gone Wild!"
Then I should have 2 nsfw posts
#toggling global nsfw state #toggling global nsfw state
When I log out When I sign in as "laura@officeworkers.com"
And I sign in as "laura@officeworkers.com"
Then I should not see "I love 0bj3ction4bl3 c0nt3nt!" Then I should not see "I love 0bj3ction4bl3 c0nt3nt!"
When I toggle nsfw posts When I toggle nsfw posts
Then I should see "I love 0bj3ction4bl3 c0nt3nt!" and "Sexy Senators Gone Wild!" 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 Given I expand the publisher
When I write the status message "The World needs more Cats." When I write the status message "The World needs more Cats."
And I submit the publisher 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 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 Scenario: posting a message appends it to the top of the stream
When I click the publisher and post "sup dog" When I click the publisher and post "sup dog"
@ -60,10 +62,12 @@ Feature: posting from the main page
And I submit the publisher And I submit the publisher
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "PostingTo" aspect And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "NotPostingThingsHere" aspect And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt" 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 And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "NotPostingThingsHere" aspect And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt" 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 And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt" and "And cornflakes also" Then I should see "I am eating a yogurt" and "And cornflakes also"
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "Besties" aspect And I select only "Besties" aspect
Then I should not see "I am eating a yogurt" Then I should not see "I am eating a yogurt"
Then I should see "And cornflakes also" Then I should see "And cornflakes also"
When I am on the aspects page When I am on the aspects page
And I select all aspects
And I select only "NotPostingThingsHere" aspect And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt" and "And cornflakes also" 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 And I select only "Family" aspect
Then I should see "I want to understand people" 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" Then I should not see "I want to understand people"
Scenario: post a photo with text 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" Given a user with username "alice"
And "alice@alice.alice" has a public post with text "Hello! i am #newhere" And "alice@alice.alice" has a public post with text "Hello! i am #newhere"
When I toggle the mobile view 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 Scenario: Show my activity empty
When I open the drawer 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 named "Alice Awesome" with email "alice@alice.alice"
And a user with username "bob" is connected with "alice_awesome" And a user with username "bob" is connected with "alice_awesome"
When I toggle the mobile view 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 Scenario: send and delete a mobile message
Given I send a mobile message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" 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 I press the first ".ltr" within ".conversation"
And "Alice Awesome" should be part of active conversation And "Alice Awesome" should be part of active conversation
And I should see "hello, alice!" within ".stream_element" 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 reply with "hey, how you doing?"
And I press the first ".ltr" within ".conversation" And I press the first ".ltr" within ".conversation"
Then I should see "hey, how you doing?" 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" Given a user with username "bob"
When I toggle the mobile view 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" And I click on selector "#compose_badge"
Scenario: view full size image Scenario: view full size image

View file

@ -11,7 +11,7 @@ Feature: posting from the mobile main page
| alice | | alice |
And I toggle the mobile view And I toggle the mobile view
And I am on the home page 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" And a user with username "bob" is connected with "alice"
Given I have following aspects: Given I have following aspects:
| PostingTo | | PostingTo |
@ -39,7 +39,7 @@ Feature: posting from the mobile main page
When I visit the mobile stream page When I visit the mobile stream page
Then I should see a "img" within ".stream_element div.photo_attachments" Then I should see a "img" within ".stream_element div.photo_attachments"
When I log out 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 When I visit the mobile stream page
Then I should see a "img" within ".stream_element div.photo_attachments" 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" 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 When "alice@alice.alice" has posted a status message with a photo
And I toggle the mobile view 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 Scenario: like on a mobile post
When I should see "0 reactions" within ".show_comments" 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 And I toggle the mobile view
Then I should see "Original post deleted by author." within ".reshare" Then I should see "Original post deleted by author." within ".reshare"
And I log out 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 And I toggle the mobile view
Then I should see "Original post deleted by author." within ".reshare" Then I should see "Original post deleted by author." within ".reshare"

View file

@ -4,8 +4,8 @@ Feature: Interacting with tags
Background: Background:
Given a user with username "alice" Given a user with username "alice"
And "alice@alice.alice" has a public post with text "Hello! i am #newhere" And "alice@alice.alice" has a public post with text "Hello! i am #newhere"
When I toggle the mobile view When I sign in as "alice@alice.alice"
And I sign in as "alice@alice.alice" And I toggle the mobile view
Scenario: Searching for a tag Scenario: Searching for a tag
When I visit the mobile search page When I visit the mobile search page

View file

@ -15,13 +15,17 @@ module AspectCukeHelpers
def toggle_aspect_via_ui(aspect_name) def toggle_aspect_via_ui(aspect_name)
aspects_dropdown = find(".aspect_membership_dropdown .dropdown-toggle", match: :first) aspects_dropdown = find(".aspect_membership_dropdown .dropdown-toggle", match: :first)
aspects_dropdown.click 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 = find(".aspect_membership_dropdown.open .dropdown-menu li", text: aspect_name)
aspect_selected = aspect["class"].include? "selected"
aspect.click aspect.click
aspect.parent.should have_no_css(".loading") aspect.parent.should have_no_css(".loading")
# close dropdown # close dropdown
page.should have_no_css('#profile.loading') 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')]") aspects_dropdown.should have_no_xpath("..[contains(@class, 'active')]")
end end
@ -42,7 +46,6 @@ end
When /^I select only "([^"]*)" aspect$/ do |aspect_name| When /^I select only "([^"]*)" aspect$/ do |aspect_name|
click_link 'My Aspects' click_link 'My Aspects'
within('#aspects_list') do within('#aspects_list') do
click_link 'Select all' if has_link? 'Select all'
click_link 'Deselect all' click_link 'Deselect all'
current_scope.should have_no_css '.selected' current_scope.should have_no_css '.selected'
end end
@ -56,6 +59,12 @@ When /^I select "([^"]*)" aspect as well$/ do |aspect_name|
step %Q(I should see "#{aspect_name}" aspect selected) step %Q(I should see "#{aspect_name}" aspect selected)
end 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 When /^I add the first person to the aspect$/ do
find(".contact_add-to-aspect", match: :first).tap do |button| find(".contact_add-to-aspect", match: :first).tap do |button|
button.click button.click

View file

@ -165,7 +165,7 @@ Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector,
end end
Then /^page should (not )?have "([^\"]*)"$/ do |negate, selector| 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 end
When /^I have turned off jQuery effects$/ do When /^I have turned off jQuery effects$/ do

View file

@ -21,6 +21,13 @@ When /^I (?:sign|log) in as "([^"]*)"$/ do |email|
confirm_login confirm_login
end 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| When /^I (?:sign|log) in with password "([^"]*)"$/ do |password|
@me.password = password @me.password = password
automatic_login automatic_login

View file

@ -29,7 +29,7 @@ module PublishingCukeHelpers
txt = find('#publisher #status_message_fake_text').value txt = find('#publisher #status_message_fake_text').value
find('#publisher .creation').click find('#publisher .creation').click
# wait for the content to appear # 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 end
def click_and_post(text) def click_and_post(text)
@ -52,7 +52,7 @@ module PublishingCukeHelpers
def expand_first_post def expand_first_post
within(".stream_element", match: :first) do within(".stream_element", match: :first) do
find(".expander").click find(".expander").click
expect(has_css?(".expander")).to be false expect(page).to have_no_css(".expander")
end end
end end

View file

@ -47,6 +47,11 @@ module UserCukeHelpers
page.has_content?("#{@me.first_name} #{@me.last_name}") page.has_content?("#{@me.first_name} #{@me.last_name}")
end 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 # delete all cookies, destroying the current session
def logout def logout
$browser.delete_cookie('_session', 'path=/') if $browser $browser.delete_cookie('_session', 'path=/') if $browser