bump capybara

* removed wait_until where possible
* replaced wait_until with DOM obersavtions
* added match: :first to all finders that assumed getting the first element
* replaced evaluate_script with execute_script where possible
* replaced a few execute_script with DOM observations through Capybara
* removed sleep where possible
* replaced sleep with DOM obersvations
* replaced "wait for ajax" with DOM obersavations
* replaced alert confirmation with new selenium API
* bump selenium webdriver
* made any other fixes to get green again
This commit is contained in:
Jonne Haß 2013-07-21 22:40:04 +02:00
parent cdc29e449d
commit 300752fc87
50 changed files with 226 additions and 375 deletions

View file

@ -160,7 +160,7 @@ group :development do
gem 'guard-rspec', '3.0.1' gem 'guard-rspec', '3.0.1'
gem 'rb-fsevent', '0.9.3', :require => false gem 'rb-fsevent', '0.9.3', :require => false
gem 'rb-inotify', '0.9.0', :require => false gem 'rb-inotify', '0.9.0', :require => false
# Preloading environment # Preloading environment
gem 'guard-spork', '1.5.0' gem 'guard-spork', '1.5.0'
@ -176,9 +176,9 @@ group :test do
# Cucumber (integration tests) # Cucumber (integration tests)
gem 'capybara', '1.1.3' gem 'capybara', '2.1.0'
gem 'database_cleaner', '1.0.1' gem 'database_cleaner', '1.0.1'
gem 'selenium-webdriver', '2.32.1' gem 'selenium-webdriver', '2.33.0'
# General helpers # General helpers

View file

@ -45,13 +45,12 @@ GEM
bootstrap-sass (2.2.2.0) bootstrap-sass (2.2.2.0)
sass (~> 3.2) sass (~> 3.2)
builder (3.0.4) builder (3.0.4)
capybara (1.1.3) capybara (2.1.0)
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
rack (>= 1.0.0) rack (>= 1.0.0)
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0) xpath (~> 2.0)
xpath (~> 0.1.4)
carrierwave (0.8.0) carrierwave (0.8.0)
activemodel (>= 3.2.0) activemodel (>= 3.2.0)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
@ -214,7 +213,7 @@ GEM
mobile-fu (1.2.1) mobile-fu (1.2.1)
rack-mobile-detect rack-mobile-detect
rails rails
multi_json (1.7.6) multi_json (1.7.7)
multipart-post (1.2.0) multipart-post (1.2.0)
mysql2 (0.3.11) mysql2 (0.3.11)
nested_form (0.3.2) nested_form (0.3.2)
@ -348,7 +347,7 @@ GEM
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
selenium-webdriver (2.32.1) selenium-webdriver (2.33.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip rubyzip
@ -406,7 +405,7 @@ GEM
crack (>= 0.3.2) crack (>= 0.3.2)
websocket (1.0.7) websocket (1.0.7)
will_paginate (3.0.4) will_paginate (3.0.4)
xpath (0.1.4) xpath (2.0.0)
nokogiri (~> 1.3) nokogiri (~> 1.3)
PLATFORMS PLATFORMS
@ -419,7 +418,7 @@ DEPENDENCIES
addressable (= 2.3.4) addressable (= 2.3.4)
asset_sync (= 0.5.4) asset_sync (= 0.5.4)
bootstrap-sass (= 2.2.2.0) bootstrap-sass (= 2.2.2.0)
capybara (= 1.1.3) capybara (= 2.1.0)
carrierwave (= 0.8.0) carrierwave (= 0.8.0)
client_side_validations (= 3.2.5) client_side_validations (= 3.2.5)
compass-rails (= 1.0.3) compass-rails (= 1.0.3)
@ -476,7 +475,7 @@ DEPENDENCIES
rspec-rails (= 2.13.2) rspec-rails (= 2.13.2)
ruby-oembed (= 0.8.8) ruby-oembed (= 0.8.8)
sass-rails (= 3.2.6) sass-rails (= 3.2.6)
selenium-webdriver (= 2.32.1) selenium-webdriver (= 2.33.0)
sidekiq (= 2.11.1) sidekiq (= 2.11.1)
sinatra (= 1.3.3) sinatra (= 1.3.3)
sinon-rails (= 1.4.2.1) sinon-rails (= 1.4.2.1)

View file

@ -17,9 +17,9 @@ app.views.Aspect = app.views.Base.extend({
toggleAspect: function(evt){ toggleAspect: function(evt){
if (evt) { evt.preventDefault(); }; if (evt) { evt.preventDefault(); };
this.model.toggleSelected();
this.$el.toggleClass('active'); this.$el.toggleClass('active');
this.$el.find('.icons-check_yes_ok').toggleClass('invisible') this.$el.find('.icons-check_yes_ok').toggleClass('invisible')
this.model.toggleSelected();
app.router.aspects_stream(); app.router.aspects_stream();
}, },

View file

@ -14,8 +14,8 @@ Feature: invitation acceptance
And I fill in the following: And I fill in the following:
| profile_first_name | O | | profile_first_name | O |
And I preemptively confirm the alert
And I follow "awesome_button" And I follow "awesome_button"
And I confirm the alert
Then I should be on the stream page Then I should be on the stream page
Scenario: accept invitation from user Scenario: accept invitation from user
@ -32,8 +32,8 @@ Feature: invitation acceptance
And I fill in the following: And I fill in the following:
| profile_first_name | O | | profile_first_name | O |
And I preemptively confirm the alert
And I follow "awesome_button" And I follow "awesome_button"
And I confirm the alert
Then I should be on the stream page Then I should be on the stream page
And I log out And I log out
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"

View file

@ -5,11 +5,8 @@ Feature: The activity stream
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I post "A- I like turtles" And I post "A- I like turtles"
And I wait for 1 second
And I post "B- barack obama is your new bicycle" And I post "B- barack obama is your new bicycle"
And I wait for 1 second
And I post "C- barack obama is a square" And I post "C- barack obama is a square"
And I wait for 1 second
When I go to the activity stream page When I go to the activity stream page
Then "C- barack obama is a square" should be post 1 Then "C- barack obama is a square" should be post 1
@ -17,11 +14,8 @@ Feature: The activity stream
And "A- I like turtles" should be post 3 And "A- I like turtles" should be post 3
When I like the post "A- I like turtles" When I like the post "A- I like turtles"
And I wait for 1 second
And I comment "Sassy sawfish" on "C- barack obama is a square" And I comment "Sassy sawfish" on "C- barack obama is a square"
And I wait for 1 second
And I like the post "B- barack obama is your new bicycle" And I like the post "B- barack obama is your new bicycle"
And I wait for 1 second
When I go to the activity stream page When I go to the activity stream page
Then "B- barack obama is your new bicycle" should be post 1 Then "B- barack obama is your new bicycle" should be post 1

View file

@ -17,7 +17,6 @@ Feature: Viewing my activity on the steam mobile page
Scenario: Show post on my activity Scenario: Show post on my activity
When I click on selector "a.image_link.like_action.inactive" When I click on selector "a.image_link.like_action.inactive"
And I wait for the ajax to finish
And I click on selector "img.my_activity" And I click on selector "img.my_activity"
Then I should see "My Activity" Then I should see "My Activity"
And I should see "Hello! i am #newhere" within ".ltr" And I should see "Hello! i am #newhere" within ".ltr"

View file

@ -12,20 +12,15 @@ Feature: Blocking a user from the stream
Scenario: Blocking a user Scenario: Blocking a user
When I am on the home page When I am on the home page
And I preemptively confirm the alert
And I wait for the ajax to finish
When I click on the first block button When I click on the first block button
And I confirm the alert
And I am on the home page And I am on the home page
And I wait for the ajax to finish
Then I should not see any posts in my stream Then I should not see any posts in my stream
Scenario: Blocking a user from the profile page Scenario: Blocking a user from the profile page
When I am on the home page When I am on the home page
And I follow "Alice Smith" And I follow "Alice Smith"
And I wait for the ajax to finish
And I preemptively confirm the alert
And I wait for the ajax to finish
When I click on the first block button When I click on the first block button
And I confirm the alert
And I am on the home page And I am on the home page
And I wait for the ajax to finish
Then I should not see any posts in my stream Then I should not see any posts in my stream

View file

@ -9,8 +9,8 @@ Feature: Close Account
When I go to the users edit page When I go to the users edit page
And I follow "Close Account" And I follow "Close Account"
And I put in my password in "close_account_password" in the modal window And I put in my password in "close_account_password" in the modal window
And I preemptively confirm the alert
And I press "Close Account" in the modal window And I press "Close Account" in the modal window
And I confirm the alert
Then I should be on the new user session page Then I should be on the new user session page
When I try to sign in manually When I try to sign in manually
@ -29,8 +29,8 @@ Feature: Close Account
When I go to the users edit page When I go to the users edit page
And I follow "Close Account" And I follow "Close Account"
And I put in my password in "close_account_password" in the modal window And I put in my password in "close_account_password" in the modal window
And I preemptively confirm the alert
And I press "Close Account" in the modal window And I press "Close Account" in the modal window
And I confirm the alert
Then I sign in as "alice@alice.alice" Then I sign in as "alice@alice.alice"
And I am on the home page And I am on the home page
Then I should see "Bob Jones" Then I should see "Bob Jones"

View file

@ -20,7 +20,6 @@ Feature: commenting
And I fill in the following: And I fill in the following:
| text | is that a poodle? | | text | is that a poodle? |
And I press "Comment" And I press "Comment"
And I wait for the ajax to finish
Then I should see "is that a poodle?" within ".comment" Then I should see "is that a poodle?" within ".comment"
And I should see "less than a minute ago" within ".comment time" And I should see "less than a minute ago" within ".comment time"
@ -32,11 +31,8 @@ Feature: commenting
And I fill in the following: And I fill in the following:
| text | is that a poodle? | | text | is that a poodle? |
And I press "Comment" And I press "Comment"
And I wait for the ajax to finish
When I hover over the ".comment"
And I preemptively confirm the alert
And I click to delete the first comment And I click to delete the first comment
And I wait for the ajax to finish And I confirm the alert
Then I should not see "is that a poodle?" Then I should not see "is that a poodle?"
Scenario: expand the comment form in the main stream and an individual aspect stream Scenario: expand the comment form in the main stream and an individual aspect stream
@ -59,5 +55,6 @@ Feature: commenting
When I follow "less than a minute ago" When I follow "less than a minute ago"
Then I should see "Look at this dog" Then I should see "Look at this dog"
And I make a show page comment "I think thats a cat" And I make a show page comment "I think thats a cat"
Then I should see "less than a minute ago" within "#post-comments"
When I go to "alice@alice.alice"'s page When I go to "alice@alice.alice"'s page
Then I should see "I think thats a cat" Then I should see "I think thats a cat"

View file

@ -6,7 +6,7 @@ Feature: following and being followed
| email | | email |
| bob@bob.bob | | bob@bob.bob |
| alice@alice.alice | | alice@alice.alice |
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I add the person to my "Besties" aspect And I add the person to my "Besties" aspect
@ -16,7 +16,7 @@ Feature: following and being followed
And I fill in the following: And I fill in the following:
| status_message_fake_text | I am following you | | status_message_fake_text | I am following you |
And I press "Share" And I press "Share"
Then I go to the destroy user session page Then I sign out
Scenario: seeing a follower's posts on their profile page, but not in your stream Scenario: seeing a follower's posts on their profile page, but not in your stream
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
@ -35,7 +35,7 @@ Feature: following and being followed
And I press the first ".toggle" within "#publisher" And I press the first ".toggle" within "#publisher"
And I press the first ".public" within "#publisher" And I press the first ".public" within "#publisher"
And I press "Share" And I press "Share"
And I go to the destroy user session page And I sign out
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
@ -49,7 +49,6 @@ Feature: following and being followed
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I add the person to my "Besties" aspect And I add the person to my "Besties" aspect
And I wait for the ajax to finish
And I add the person to my "Unicorns" aspect And I add the person to my "Unicorns" aspect
When I go to the home page When I go to the home page
@ -59,7 +58,7 @@ Feature: following and being followed
When I am on the home page When I am on the home page
And I post "I am following you back" And I post "I am following you back"
Then I go to the destroy user session page Then I sign out
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
Then I should have 1 contacts in "Besties" Then I should have 1 contacts in "Besties"
@ -73,15 +72,13 @@ Feature: following and being followed
And I press the first ".toggle.button" And I press the first ".toggle.button"
And I press the first "a" within ".add_aspect" And I press the first "a" within ".add_aspect"
And I wait for the ajax to finish
And I fill in "Name" with "Super People" in the modal window And I fill in "Name" with "Super People" in the modal window
And I press "Create" in the modal window And I press "Create" in the modal window
And I wait for the ajax to finish
When I go to the home page When I go to the home page
Then I should have 1 contact in "Super People" Then I should have 1 contact in "Super People"
Then I go to the destroy user session page Then I sign out
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
Then I should have 1 contact in "Besties" Then I should have 1 contact in "Besties"
@ -90,7 +87,7 @@ Feature: following and being followed
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
Then I should see "Besties" and "Mention" Then I should see "Besties" and "Mention"
Then I should not see "Message" within "#profile" Then I should not see "Message" within "#profile"
Scenario: interacting with the profile page of someone who follows you but who you do not follow Scenario: interacting with the profile page of someone who follows you but who you do not follow
@ -105,9 +102,7 @@ Feature: following and being followed
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
When I add the person to my "Besties" aspect When I add the person to my "Besties" aspect
And I wait for the ajax to finish
And I add the person to my "Unicorns" aspect And I add the person to my "Unicorns" aspect
And I wait for the ajax to finish
When I go to "bob@bob.bob"'s page When I go to "bob@bob.bob"'s page
Then I should see "All Aspects" and "Mention" and "Message" Then I should see "All Aspects" and "Mention" and "Message"

View file

@ -8,4 +8,4 @@ Feature: Download Photos
And I follow "settings" And I follow "settings"
Then I should be on my account settings page Then I should be on my account settings page
And I follow "download my photos" And I follow "download my photos"
Then I should get download alert Then I confirm the alert

View file

@ -40,9 +40,8 @@ Feature: editing your profile
And I should see "#starwars" within "ul#as-selections-tags" And I should see "#starwars" within "ul#as-selections-tags"
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload" When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I preemptively confirm the alert And I confirm the alert
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
Then I should see a "img" within "#profile_photo_upload" Then I should see a "img" within "#profile_photo_upload"
When I go to my new profile page When I go to my new profile page

View file

@ -11,7 +11,7 @@ Feature: editing the profile in the mobile view
| profile_last_name | Fett | | profile_last_name | Fett |
| profile_bio | This is a bio | | profile_bio | This is a bio |
| profile_location | Kamino | | profile_location | Kamino |
And I select "1986" from "profile_date_year" And I select "1986" from "profile_date_year"
And I select "30" from "profile_date_day" And I select "30" from "profile_date_day"
And I select "November" from "profile_date_month" And I select "November" from "profile_date_month"
@ -35,16 +35,15 @@ Feature: editing the profile in the mobile view
When I fill in "profile[tag_string]" with "#kamino" When I fill in "profile[tag_string]" with "#kamino"
And I press the first ".as-result-item" within ".as-results" And I press the first ".as-result-item" within ".as-results"
And I press "Update Profile" And I press "Update Profile"
Then I should see "#kamino" within "ul#as-selections-tags" Then I should see "#kamino" within "ul#as-selections-tags"
And I should see "#starwars" within "ul#as-selections-tags" And I should see "#starwars" within "ul#as-selections-tags"
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload" When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I preemptively confirm the alert And I confirm the alert
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
Then I should see a "img" within "#profile_photo_upload" Then I should see a "img" within "#profile_photo_upload"
When I go to my new profile page When I go to my new profile page
And I should see "Boba Fett" And I should see "Boba Fett"

View file

@ -6,17 +6,16 @@ Feature: posting
Background: Background:
Given following users exist: Given following users exist:
| username | | username |
| bob | | bob |
| alice | | alice |
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I post a status with the text "I am da #boss" And I post a status with the text "I am da #boss"
When I go to the destroy user session page When I sign out
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I search for "#boss" And I search for "#boss"
And I press "Follow #boss" And I press "Follow #boss"
And I wait for the ajax to finish
Scenario: can post a message from the tag page Scenario: can post a message from the tag page
Then I should see "#boss" within "#publisher" Then I should see "#boss" within "#publisher"
@ -42,8 +41,7 @@ Feature: posting
Scenario: can stop following a tag from the homepage Scenario: can stop following a tag from the homepage
When I go to the followed tags stream page When I go to the followed tags stream page
And I preemptively confirm the alert
And I hover over the "li.unfollow#tag-following-boss" And I hover over the "li.unfollow#tag-following-boss"
And I follow "unfollow_boss" And I follow "unfollow_boss"
And I wait for the ajax to finish And I confirm the alert
Then I should not see "#tag-following-boss" within ".left_nav" Then I should not see "#tag-following-boss" within ".left_nav"

View file

@ -14,9 +14,8 @@ Feature: editing the gettig started in the mobile view
And I should see "amparito" And I should see "amparito"
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload" When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I preemptively confirm the alert And I confirm the alert
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
Then I should see a "img" within "#profile_photo_upload" Then I should see a "img" within "#profile_photo_upload"
When I fill in "follow_tags" with "#men" When I fill in "follow_tags" with "#men"

View file

@ -10,7 +10,6 @@ Feature: Keyboard navigation
Scenario: navigate downwards Scenario: navigate downwards
When I am on the home page When I am on the home page
When I wait for the ajax to finish
And I press the "J" key somewhere And I press the "J" key somewhere
Then post 1 should be highlighted Then post 1 should be highlighted
And I should have navigated to the highlighted post And I should have navigated to the highlighted post
@ -18,22 +17,20 @@ Feature: Keyboard navigation
When I press the "J" key somewhere When I press the "J" key somewhere
Then post 2 should be highlighted Then post 2 should be highlighted
And I should have navigated to the highlighted post And I should have navigated to the highlighted post
Given I expand the publisher Given I expand the publisher
When I press the "J" key in the publisher When I press the "J" key in the publisher
Then post 2 should be highlighted Then post 2 should be highlighted
Scenario: navigate upwards Scenario: navigate upwards
When I am on the home page When I am on the home page
When I wait for the ajax to finish
And I scroll to post 3 And I scroll to post 3
When I press the "K" key somewhere When I press the "K" key somewhere
Then post 2 should be highlighted Then post 2 should be highlighted
And I should have navigated to the highlighted post And I should have navigated to the highlighted post
Scenario: expand the comment form in the main stream Scenario: expand the comment form in the main stream
When I am on the home page When I am on the home page
When I wait for the ajax to finish
Then the first comment field should be closed Then the first comment field should be closed
When I press the "J" key somewhere When I press the "J" key somewhere
And I press the "C" key somewhere And I press the "C" key somewhere

View file

@ -26,9 +26,8 @@ Feature: User manages contacts
When I am on the contacts page When I am on the contacts page
And I follow "People" And I follow "People"
And I follow "add contacts to People" And I follow "add contacts to People"
And I wait for the ajax to finish
And I preemptively confirm the alert
And I press "Delete" in the modal window And I press "Delete" in the modal window
And I confirm the alert
Then I should be on the contacts page Then I should be on the contacts page
And I should not see "People" within "#aspect_nav" And I should not see "People" within "#aspect_nav"
@ -37,9 +36,8 @@ Feature: User manages contacts
And I have an aspect called "People" And I have an aspect called "People"
When I am on the aspects page When I am on the aspects page
And I click on "People" aspect edit icon And I click on "People" aspect edit icon
And I wait for the ajax to finish
And I preemptively confirm the alert
And I press "Delete" in the modal window And I press "Delete" in the modal window
And I confirm the alert
Then I should be on the aspects page Then I should be on the aspects page
And I should not see "People" within "#aspect_nav" And I should not see "People" within "#aspect_nav"
@ -50,13 +48,10 @@ Feature: User manages contacts
When I am on the contacts page When I am on the contacts page
And I follow "Cat People" And I follow "Cat People"
And I follow "add contacts to Cat People" And I follow "add contacts to Cat People"
And I wait for the ajax to finish And I check the first contact list button
And I press the first ".contact_list .button"
And I wait for the ajax to finish
Then I should have 1 contact in "Cat People" Then I should have 1 contact in "Cat People"
When I press the first ".contact_list .button" When I uncheck the first contact list button
And I wait for the ajax to finish
Then I should have 0 contacts in "Cat People" Then I should have 0 contacts in "Cat People"
Scenario: infinite scroll on contacts index Scenario: infinite scroll on contacts index

View file

@ -29,7 +29,6 @@ Feature: Mentions
| status_message_fake_text | @Bo | | status_message_fake_text | @Bo |
And I click on the first user in the mentions dropdown list And I click on the first user in the mentions dropdown list
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I follow "Bob Jones" And I follow "Bob Jones"
Then I should see "Bob Jones" Then I should see "Bob Jones"

View file

@ -27,15 +27,12 @@ Feature: mentioning a contact from their profile page
And I want to mention her from the profile And I want to mention her from the profile
And I append "I am eating a yogurt" to the publisher And I append "I am eating a yogurt" to the publisher
And I press "Share" in the modal window And I press "Share" in the modal window
And I wait for the ajax to finish
When I am on the aspects page When I am on the aspects page
And I follow "PostingTo" within "#aspect_nav" And I follow "PostingTo" within "#aspect_nav"
And I wait for the ajax to finish
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 follow "NotPostingThingsHere" within "#aspect_nav" And I follow "NotPostingThingsHere" within "#aspect_nav"
And I wait for the ajax to finish
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"
Scenario: mentioning while posting to just one aspect Scenario: mentioning while posting to just one aspect
@ -45,7 +42,6 @@ Feature: mentioning a contact from their profile page
And I append "I am eating a yogurt" to the publisher And I append "I am eating a yogurt" to the publisher
And I press the aspect dropdown in the modal window And I press the aspect dropdown in the modal window
And I toggle the aspect "NotPostingThingsHere" in the modal window And I toggle the aspect "NotPostingThingsHere" in the modal window
And I wait for the ajax to finish
And I press "Share" in the modal window And I press "Share" in the modal window
When I am on the aspects page When I am on the aspects page

View file

@ -11,21 +11,16 @@ Feature: viewing photos on the mobile main page
And I click on selector "img.compose_icon" And I click on selector "img.compose_icon"
Scenario: view full size image Scenario: view full size image
Given I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload-publisher" Given I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload-publisher"
And I wait for the ajax to finish
When I press "Share" When I press "Share"
And I wait for the ajax to finish
And I click on selector "img.stream-photo" And I click on selector "img.stream-photo"
Then I should see a "img" within "#show_content" Then I should see a "img" within "#show_content"
And I should not see a "#right" within ".row" And I should not see a "#right" within ".row"
Scenario: view multiphoto post Scenario: view multiphoto post
Given I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload-publisher" Given I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload-publisher"
And I wait for the ajax to finish And I attach the file "spec/fixtures/button.gif" to hidden "file" within "#file-upload-publisher"
And I attach the file "spec/fixtures/button.gif" to hidden element "file" within "#file-upload-publisher"
And I wait for the ajax to finish
When I press "Share" When I press "Share"
And I wait for the ajax to finish
And I should see "+ 1" within ".additional_photo_count" And I should see "+ 1" within ".additional_photo_count"
And I click on selector "img.stream-photo" And I click on selector "img.stream-photo"
Then I should see a "#right" within "tbody" Then I should see a "#right" within "tbody"

View file

@ -3,7 +3,7 @@ Feature: Not safe for work
Scenario: Setting not safe for work Scenario: Setting not safe for work
Given following users exist: Given following users exist:
| username | email | | username | email |
| pr0n king | tommy@pr0n.xxx | | pr0n king | tommy@pr0n.xxx |
And I sign in as "tommy@pr0n.xxx" And I sign in as "tommy@pr0n.xxx"
When I go to the edit profile page When I go to the edit profile page
@ -49,12 +49,8 @@ Scenario: Resharing an nsfw post
And "tommy@pr0nking.com" has a public post with text "Sexy Senators Gone Wild!" And "tommy@pr0nking.com" has a public post with text "Sexy Senators Gone Wild!"
And I sign in as "laura@officeworkers.com" And I sign in as "laura@officeworkers.com"
And I toggle nsfw posts And I toggle nsfw posts
And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
And I wait for 2 seconds And I confirm the alert
And I wait for the ajax to finish
And I go to the home page And I go to the home page
#if this is failing on travis throw a random wait in here :/
And I wait for the ajax to finish
Then I should not see "Sexy Senators Gone Wild!" Then I should not see "Sexy Senators Gone Wild!"
And I should have 2 nsfw posts And I should have 2 nsfw posts

View file

@ -9,15 +9,14 @@ Feature: Notifications
| email | | email |
| bob@bob.bob | | bob@bob.bob |
| alice@alice.alice | | alice@alice.alice |
Scenario: someone shares with me Scenario: someone shares with me
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I add the person to my "Besties" aspect And I add the person to my "Besties" aspect
And I go to the destroy user session page And I sign out
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I follow "Notifications" in the header And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible Then the notification dropdown should be visible
Then I should see "started sharing with you" Then I should see "started sharing with you"
And I go to the notifications page And I go to the notifications page
@ -29,15 +28,12 @@ Feature: Notifications
And "alice@alice.alice" has a public post with text "check this out!" And "alice@alice.alice" has a public post with text "check this out!"
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
And I wait for the ajax to finish And I confirm the alert
And I go to the destroy user session page And I sign out
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I follow "Notifications" in the header And I follow "Notifications" in the header
#And I wait for the ajax to finish
Then the notification dropdown should be visible Then the notification dropdown should be visible
#And I wait for the ajax to finish
Then I should see "reshared your post" Then I should see "reshared your post"
And I should have 1 email delivery And I should have 1 email delivery
@ -46,15 +42,11 @@ Feature: Notifications
And "alice@alice.alice" has a public post with text "check this out!" And "alice@alice.alice" has a public post with text "check this out!"
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I preemptively confirm the alert
And I follow "Like" And I follow "Like"
And I wait for the ajax to finish And I sign out
And I go to the destroy user session page
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I follow "Notifications" in the header And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible Then the notification dropdown should be visible
And I wait for the ajax to finish
Then I should see "liked your post" Then I should see "liked your post"
And I should have 1 email delivery And I should have 1 email delivery
@ -67,8 +59,8 @@ Feature: Notifications
And I fill in the following: And I fill in the following:
| text | great post! | | text | great post! |
And I press "Comment" And I press "Comment"
And I wait for the ajax to finish Then I should see "less than a minute ago" within ".comment"
And I go to the destroy user session page And I sign out
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I follow "Notifications" in the header And I follow "Notifications" in the header
Then the notification dropdown should be visible Then the notification dropdown should be visible
@ -80,8 +72,6 @@ Feature: Notifications
And Alice has a post mentioning Bob And Alice has a post mentioning Bob
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I follow "Notifications" in the header And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible Then the notification dropdown should be visible
And I wait for the ajax to finish
Then I should see "mentioned you in a post" Then I should see "mentioned you in a post"
And I should have 1 email delivery And I should have 1 email delivery

View file

@ -6,7 +6,7 @@ Feature: oembed
Background: Background:
Given following user exists: Given following user exists:
| username | email | | username | email |
| Alice Smith | alice@alice.alice | | Alice Smith | alice@alice.alice |
And I have several oEmbed data in cache And I have several oEmbed data in cache
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
@ -17,18 +17,13 @@ Feature: oembed
When I fill in the following: When I fill in the following:
| status_message_fake_text | http://youtube.com/watch?v=M3r2XDceM6A&format=json | | status_message_fake_text | http://youtube.com/watch?v=M3r2XDceM6A&format=json |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I follow "My Aspects"
Then I should see a video player Then I should see a video player
And I should see a ".oembed" within ".post-content"
And I should see a "img" within ".oembed"
Scenario: Post an unsecure video link Scenario: Post an unsecure video link
Given I expand the publisher Given I expand the publisher
When I fill in the following: When I fill in the following:
| status_message_fake_text | http://mytube.com/watch?v=M3r2XDceM6A&format=json | | status_message_fake_text | http://mytube.com/watch?v=M3r2XDceM6A&format=json |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I follow "My Aspects" And I follow "My Aspects"
Then I should not see a video player Then I should not see a video player
And I should see "http://mytube.com/watch?v=M3r2XDceM6A&format=json" And I should see "http://mytube.com/watch?v=M3r2XDceM6A&format=json"

View file

@ -8,11 +8,10 @@ Feature: viewing the photo lightbox
And I am on the home page And I am on the home page
Given I expand the publisher Given I expand the publisher
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I fill in the following: And I fill in the following:
| status_message_fake_text | Look at this dog | | status_message_fake_text | Look at this dog |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
Scenario: viewing a photo Scenario: viewing a photo
Then I should see an image attached to the post Then I should see an image attached to the post

View file

@ -21,36 +21,35 @@ Feature: preview posts in the stream
And I press "Preview" And I press "Preview"
Then "I am eating yogurt" should be post 1 Then "I am eating yogurt" should be post 1
And the first post should be a preview And the first post should be a preview
When I fill in the following: When I fill in the following:
| status_message_fake_text | This preview rocks | | status_message_fake_text | This preview rocks |
And I press "Preview" And I press "Preview"
Then "This preview rocks" should be post 1 Then "This preview rocks" should be post 1
And I should not see "I am eating a yogurt" And I should not see "I am eating a yogurt"
When I fill in the following: When I fill in the following:
| status_message_fake_text | I like rocks | | status_message_fake_text | I like rocks |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
Then "I like rocks" should be post 1 Then "I like rocks" should be post 1
And I should not see "This preview rocks" And I should not see "This preview rocks"
Scenario: preview a photo with text Scenario: preview a photo with text
Given I expand the publisher Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
When I fill in the following: When I fill in the following:
| status_message_fake_text | Look at this dog | | status_message_fake_text | Look at this dog |
And I press "Preview" And I press "Preview"
Then I should see a "img" within ".stream_element div.photo_attachments" Then I should see a "img" within ".stream_element div.photo_attachments"
And I should see "Look at this dog" within ".stream_element" And I should see "Look at this dog" within ".stream_element"
Scenario: preview a post with mentions Scenario: preview a post with mentions
Given I expand the publisher Given I expand the publisher
And I mention Alice in the publisher And I mention Alice in the publisher
And I press "Preview" And I press "Preview"
And I follow "Alice Smith" And I follow "Alice Smith"
Then I should see "Alice Smith" Then I should see "Alice Smith"
Scenario: preview a post on tag page Scenario: preview a post on tag page
Given there is a user "Samuel Beckett" who's tagged "#rockstar" Given there is a user "Samuel Beckett" who's tagged "#rockstar"
When I search for "#rockstar" When I search for "#rockstar"

View file

@ -23,7 +23,6 @@ Feature: posting from the main page
When I fill in the following: When I fill in the following:
| status_message_fake_text | I am eating yogurt | | status_message_fake_text | I am eating yogurt |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page And I go to the aspects page
Then "I am eating yogurt" should be post 1 Then "I am eating yogurt" should be post 1
@ -33,13 +32,11 @@ Feature: posting from the main page
When I fill in the following: When I fill in the following:
| status_message_fake_text | The World needs more Cats. | | status_message_fake_text | The World needs more Cats. |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
Given I expand the publisher Given I expand the publisher
When I fill in the following: When I fill in the following:
| status_message_fake_text | The World needs more Cats. | | status_message_fake_text | The World needs more Cats. |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page 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
@ -47,7 +44,6 @@ Feature: posting from the main page
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"
And I wait for 1 second
And I click the publisher and post "hello there" And I click the publisher and post "hello there"
Then I should see "hello there" as the first post in my stream Then I should see "hello there" as the first post in my stream
@ -56,9 +52,8 @@ Feature: posting from the main page
And I expand the publisher And I expand the publisher
And I fill in the following: And I fill in the following:
| status_message_fake_text | I am eating a yogurt | | status_message_fake_text | I am eating a yogurt |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
When I am on the aspects page When I am on the aspects page
And I select only "PostingTo" aspect And I select only "PostingTo" aspect
@ -70,11 +65,10 @@ Feature: posting from the main page
Scenario: post a photo with text Scenario: post a photo with text
Given I expand the publisher Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
When I fill in the following: When I fill in the following:
| status_message_fake_text | Look at this dog | | status_message_fake_text | Look at this dog |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page And I go to the aspects 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"
And I should see "Look at this dog" within ".stream_element" And I should see "Look at this dog" within ".stream_element"
@ -86,11 +80,9 @@ Feature: posting from the main page
Scenario: post a photo without text Scenario: post a photo without text
Given I expand the publisher Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone Then I should see an uploaded image within the photo drop zone
When I press "Share" When I press "Share"
And I wait for the ajax to finish
And I go to the aspects page And I go to the aspects 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
@ -102,12 +94,10 @@ Feature: posting from the main page
Given I expand the publisher Given I expand the publisher
And I have turned off jQuery effects And I have turned off jQuery effects
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload" When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I preemptively confirm the alert And I confirm the alert
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone
Scenario: back out of uploading a picture to a post with text Scenario: back out of uploading a picture to a post with text
@ -115,10 +105,8 @@ Feature: posting from the main page
And I have turned off jQuery effects And I have turned off jQuery effects
When I fill in the following: When I fill in the following:
| status_message_fake_text | I am eating a yogurt | | status_message_fake_text | I am eating a yogurt |
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone
And the publisher should be expanded And the publisher should be expanded
@ -127,11 +115,9 @@ Feature: posting from the main page
And I have turned off jQuery effects And I have turned off jQuery effects
When I fill in the following: When I fill in the following:
| status_message_fake_text | I am eating a yogurt | | status_message_fake_text | I am eating a yogurt |
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone Then I should see an uploaded image within the photo drop zone
And the publisher should be expanded And the publisher should be expanded
@ -141,21 +127,17 @@ Feature: posting from the main page
When I fill in the following: When I fill in the following:
| status_message_fake_text | Here is a post for you to hide | | status_message_fake_text | Here is a post for you to hide |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I log out And I log out
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I hover over the ".stream_element" And I hover over the ".stream_element"
And I preemptively confirm the alert
And I click to delete the first post And I click to delete the first post
And I wait for the ajax to finish And I confirm the alert
And I go to "bob@bob.bob"'s page And I go to "bob@bob.bob"'s page
And I wait for the ajax to finish
Then I should not see "Here is a post for you to hide" Then I should not see "Here is a post for you to hide"
When I am on the aspects page When I am on the aspects page
And I wait for the ajax to finish
Then I should not see "Here is a post for you to hide" Then I should not see "Here is a post for you to hide"
Scenario: delete one of my posts Scenario: delete one of my posts
@ -163,12 +145,9 @@ Feature: posting from the main page
When I fill in the following: When I fill in the following:
| status_message_fake_text | I am eating a yogurt | | status_message_fake_text | I am eating a yogurt |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page And I go to the aspects page
And I hover over the ".stream_element" And I hover over the ".stream_element"
And I preemptively confirm the alert
And I click to delete the first post And I click to delete the first post
And I wait for the ajax to finish
And I go to the aspects page And I go to the aspects page
Then I should not see "I am eating a yogurt" Then I should not see "I am eating a yogurt"
@ -178,7 +157,6 @@ Feature: posting from the main page
And I toggle the aspect "PostingTo" And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher And I append "I am eating a yogurt" to the publisher
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I am on the aspects page And I am on the aspects page
And I select only "PostingTo" aspect And I select only "PostingTo" aspect
@ -193,14 +171,12 @@ Feature: posting from the main page
And I toggle the aspect "PostingTo" And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher And I append "I am eating a yogurt" to the publisher
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I expand the publisher And I expand the publisher
And I press the aspect dropdown And I press the aspect dropdown
And I toggle the aspect "Besties" And I toggle the aspect "Besties"
And I append "And cornflakes also" to the publisher And I append "And cornflakes also" to the publisher
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I am on the aspects page And I am on the aspects page
And I select only "PostingTo" aspect And I select only "PostingTo" aspect
@ -219,9 +195,8 @@ Feature: posting from the main page
When I fill in the following: When I fill in the following:
| status_message_fake_text | I am eating a yogurt | | status_message_fake_text | I am eating a yogurt |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
And I hover over the ".stream_element" And I hover over the ".stream_element"
And I preemptively reject the alert And I prepare the deletion of the first post
And I click to delete the first post And I reject the alert
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"

View file

@ -9,7 +9,7 @@ Feature: posting from the mobile main page
| username | | username |
| bob | | bob |
| alice | | alice |
And I visit the mobile home page And I visit the mobile home page
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"
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:
@ -28,12 +28,10 @@ Feature: posting from the mobile main page
Scenario: post a photo without text Scenario: post a photo without text
Given I publisher mobile page Given I publisher mobile page
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload-publisher" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload-publisher"
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone Then I should see an uploaded image within the photo drop zone
And I should see "button.png completed" And I should see "button.png completed"
When I press "Share" When I press "Share"
And I wait for the ajax to finish
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
@ -44,22 +42,18 @@ Feature: posting from the mobile main page
Scenario: back out of posting a photo-only post Scenario: back out of posting a photo-only post
Given I publisher mobile page Given I publisher mobile page
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload-publisher" When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload-publisher"
And I preemptively confirm the alert And I confirm the alert
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload-publisher" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload-publisher"
And I wait for the ajax to finish
And I should see "button.png completed" And I should see "button.png completed"
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone
Scenario: back out of uploading a picture when another has been attached Scenario: back out of uploading a picture when another has been attached
Given I publisher mobile page Given I publisher mobile page
And I append "I am eating yogurt" to the publisher mobile And I append "I am eating yogurt" to the publisher mobile
And I attach the file "spec/fixtures/button.gif" to hidden element "file" within "#file-upload-publisher" And I attach the file "spec/fixtures/button.gif" to hidden "file" within "#file-upload-publisher"
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload-publisher" And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload-publisher"
And I wait for the ajax to finish
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone Then I should see an uploaded image within the photo drop zone
And the text area wrapper mobile should be with attachments And the text area wrapper mobile should be with attachments

View file

@ -19,7 +19,6 @@ Feature: posting from own profile page
And I select "Family" on the aspect dropdown And I select "Family" on the aspect dropdown
And I press "Share" And I press "Share"
And I wait for the ajax to finish
Then I should see "I want to understand people" Then I should see "I want to understand people"
@ -29,19 +28,18 @@ Feature: posting from own profile page
When I am on the aspects page When I am on the aspects 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 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
Given I expand the publisher Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
When I fill in the following: When I fill in the following:
| status_message_fake_text | who am I? | | status_message_fake_text | who am I? |
And I press "Share" And I press "Share"
And I wait for the ajax to finish
When I am on the home page When I am on the home 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"
And I should see "who am I?" within ".stream_element" And I should see "who am I?" within ".stream_element"
@ -49,8 +47,6 @@ Feature: posting from own profile page
Scenario: back out of posting a photo-only post Scenario: back out of posting a photo-only post
Given I expand the publisher Given I expand the publisher
And I have turned off jQuery effects And I have turned off jQuery effects
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone Then I should not see an uploaded image within the photo drop zone

View file

@ -17,23 +17,17 @@ Feature: reactions mobile post
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"
And I click on selector "span.show_comments" And I click on selector "span.show_comments"
And I wait for the ajax to finish
And I preemptively confirm the alert
And I click on selector "a.image_link.like_action.inactive" And I click on selector "a.image_link.like_action.inactive"
And I wait for the ajax to finish
Then I go to the stream page Then I go to the stream page
And I should see "1 reaction" within ".show_comments" And I should see "1 reaction" within ".show_comments"
And I click on selector "a.show_comments" And I click on selector "a.show_comments"
And I should see "1" within ".like_count" And I should see "1" within ".like_count"
Scenario: comment a mobile post Scenario: comment a mobile post
When I preemptively confirm the alert When I click on selector "a.image_link.comment_action.inactive"
And I click on selector "a.image_link.comment_action.inactive"
And I wait for the ajax to finish
And I fill in the following: And I fill in the following:
| text | is that a poodle? | | text | is that a poodle? |
And I press "Comment" And I press "Comment"
And I wait for the ajax to finish
Then I go to the stream page Then I go to the stream page
And I should see "1 reaction" within ".show_comments" And I should see "1 reaction" within ".show_comments"
And I click on selector "a.show_comments" And I click on selector "a.show_comments"

View file

@ -18,9 +18,8 @@ Feature: public repost
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I follow "Last Post" And I follow "Last Post"
And I preemptively confirm the alert
And I click on selector "a.reshare" And I click on selector "a.reshare"
And I wait for the ajax to finish And I confirm the alert
Then I should see a flash message indicating success Then I should see a flash message indicating success
And I should see a flash message containing "successfully" And I should see a flash message containing "successfully"
@ -31,9 +30,8 @@ Feature: public repost
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I follow "Last Post" And I follow "Last Post"
And I preemptively confirm the alert
And I click on selector "a.reshare" And I click on selector "a.reshare"
And I wait for the ajax to finish And I confirm the alert
Then I should see a flash message indicating success Then I should see a flash message indicating success
And I should see a flash message containing "successfully" And I should see a flash message containing "successfully"
@ -43,9 +41,8 @@ Feature: public repost
Given "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
And I wait for the ajax to finish And I confirm the alert
Then I should see a flash message indicating success Then I should see a flash message indicating success
And I should see a flash message containing "successfully" And I should see a flash message containing "successfully"
And I should not see a ".reshare" within ".feedback" And I should not see a ".reshare" within ".feedback"

View file

@ -16,29 +16,27 @@ Feature: resharing from the mobile
Scenario: Resharing a post from a single post page Scenario: Resharing a post from a single post page
When I toggle the mobile view When I toggle the mobile view
And I preemptively confirm the alert
And I click on selector "a.image_link.reshare_action.inactive" And I click on selector "a.image_link.reshare_action.inactive"
And I wait for the ajax to finish And I confirm the alert
Then I go to the stream page Then I should see a "a.image_link.reshare_action.active"
And I should see "reshared via" within ".reshare_via" When I go to the stream page
Then I should see "reshared via" within ".reshare_via"
Scenario: Resharing a post from a single post page that is reshared Scenario: Resharing a post from a single post page that is reshared
Given the post with text "reshare this!" is reshared by "eve@eve.eve" Given the post with text "reshare this!" is reshared by "eve@eve.eve"
And a user with email "alice@alice.alice" is connected with "eve@eve.eve" And a user with email "alice@alice.alice" is connected with "eve@eve.eve"
When I toggle the mobile view When I toggle the mobile view
And I preemptively confirm the alert
And I click on the first selector "a.image_link.reshare_action.inactive" And I click on the first selector "a.image_link.reshare_action.inactive"
And I wait for the ajax to finish And I confirm the alert
Then I go to the stream page Then I should see "reshared via"
And I should see "reshared via" within ".reshare_via" When I go to the stream page
Then I should see "reshared via" within ".reshare_via"
Scenario: Delete original reshared post Scenario: Delete original reshared post
Given "alice@alice.alice" has a public post with text "Don't reshare this!" Given "alice@alice.alice" has a public post with text "Don't reshare this!"
And the post with text "Don't reshare this!" is reshared by "bob@bob.bob" And the post with text "Don't reshare this!" is reshared by "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I preemptively confirm the alert
When I click to delete the first post When I click to delete the first post
And I wait for the ajax to finish
And I log out And I log out
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"
And I toggle the mobile view And I toggle the mobile view

View file

@ -15,32 +15,31 @@ Feature: new user registration
Scenario: new user goes through the setup wizard Scenario: new user goes through the setup wizard
When I fill in the following: When I fill in the following:
| profile_first_name | O | | profile_first_name | O |
And I preemptively confirm the alert
And I follow "awesome_button" And I follow "awesome_button"
And I confirm the alert
Then I should be on the stream page Then I should be on the stream page
And I should not see "awesome_button" And I should not see "awesome_button"
Scenario: new user does not add any tags in setup wizard and cancel the alert Scenario: new user does not add any tags in setup wizard and cancel the alert
When I fill in the following: When I fill in the following:
| profile_first_name | some name | | profile_first_name | some name |
And I preemptively reject the alert
And I follow "awesome_button" And I follow "awesome_button"
And I reject the alert
Then I should be on the getting started page Then I should be on the getting started page
And I should see a flash message containing "Alright, I'll wait." And I should see a flash message containing "Alright, I'll wait."
Scenario: new user skips the setup wizard Scenario: new user skips the setup wizard
When I preemptively confirm the alert When I follow "awesome_button"
And I follow "awesome_button" And I confirm the alert
Then I should be on the stream page Then I should be on the stream page
Scenario: closing a popover clears getting started Scenario: closing a popover clears getting started
When I preemptively confirm the alert When I follow "awesome_button"
And I follow "awesome_button" And I confirm the alert
Then I should be on the stream page Then I should be on the stream page
And I have turned off jQuery effects And I have turned off jQuery effects
And I wait for the popovers to appear And I wait for the popovers to appear
And I click close on all the popovers And I click close on all the popovers
And I wait for 3 seconds
And I go to the home page And I go to the home page
Then I should not see "Welcome to Diaspora" Then I should not see "Welcome to Diaspora"

View file

@ -9,32 +9,19 @@ When /^I select only "([^"]*)" aspect$/ do |aspect_name|
within('#aspect_nav') do within('#aspect_nav') do
click_link 'Aspects' click_link 'Aspects'
click_link 'Select all' if has_link? 'Select all' click_link 'Select all' if has_link? 'Select all'
click_link 'Deselect all'
end end
step %Q(I select "#{aspect_name}" aspect as well)
step %{I wait for the ajax to finish}
within('#aspect_nav') do
click_link 'Deselect all' if has_link? 'Deselect all'
end
step %{I wait for the ajax to finish}
within('#aspect_nav') do
click_link aspect_name
end
step %{I wait for the ajax to finish}
end end
When /^I select "([^"]*)" aspect as well$/ do |aspect_name| When /^I select "([^"]*)" aspect as well$/ do |aspect_name|
within('#aspect_nav') do within('#aspect_nav') do
click_link aspect_name click_link aspect_name
end end
step %Q(I should see "#{aspect_name}" aspect selected)
step %{I wait for the ajax to finish}
end end
When /^I should see "([^"]*)" aspect selected$/ do |aspect_name| Then /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do within("#aspect_nav") do
page.has_css?("li.active[data-aspect_id='#{aspect.id}']").should be_true page.has_css?("li.active[data-aspect_id='#{aspect.id}']").should be_true
@ -42,9 +29,24 @@ When /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
end end
end end
When /^I should see "([^"]*)" aspect unselected$/ do |aspect_name| Then /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do within("#aspect_nav") do
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active) .invisible").should be_true page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active) .invisible", visible: false).should be_true
end
end
When /^I check the first contact list button$/ do
find(".contact_list .button", match: :first).tap do |button|
button.click
button.parent.should have_css ".added"
end
end
When /^I uncheck the first contact list button$/ do
find(".contact_list .button", match: :first).tap do |button|
button.click
button.parent.should have_css ".add"
sleep 1 # The expectation above should wait for the request to finsh, but that doesn't work for some reason
end end
end end

View file

@ -7,7 +7,8 @@ Then /^the first comment field should be open/ do
end end
Then /^the first comment field should be closed$/ do Then /^the first comment field should be closed$/ do
find("#main_stream .stream_element .new_comment").should_not be_visible page.should have_css(".stream_element")
find("#main_stream .stream_element .new_comment", match: :first, visible: false).should_not be_visible
end end
When /^I comment "([^"]*)" on "([^"]*)"$/ do |comment_text, post_text| When /^I comment "([^"]*)" on "([^"]*)"$/ do |comment_text, post_text|

View file

@ -7,45 +7,40 @@ end
Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person| Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person|
step %(I am on the conversations page) step %(I am on the conversations page)
step %(I follow "New Message") step %(I follow "New Message")
step %(I wait for the ajax to finish)
step %(I fill in "contact_autocomplete" with "#{person}" in the modal window) step %(I fill in "contact_autocomplete" with "#{person}" in the modal window)
step %(I press the first ".as-result-item" within ".as-results" in the modal window) step %(I press the first ".as-result-item" within ".as-results" in the modal window)
step %(I fill in "conversation_subject" with "#{subject}" in the modal window) step %(I fill in "conversation_subject" with "#{subject}" in the modal window)
step %(I fill in "conversation_text" with "#{text}" in the modal window) step %(I fill in "conversation_text" with "#{text}" in the modal window)
step %(I press "Send" in the modal window) step %(I press "Send" in the modal window)
step %(I wait for the ajax to finish)
end end
When /^I reply with "([^"]*)"$/ do |text| When /^I reply with "([^"]*)"$/ do |text|
step %(I am on the conversations page) step %(I am on the conversations page)
step %(I press the first ".conversation" within ".conversations") step %(I press the first ".conversation" within ".conversations")
step %(I wait for the ajax to finish)
step %(I fill in "message_text" with "#{text}") step %(I fill in "message_text" with "#{text}")
step %(I press "Reply") step %(I press "Reply")
step %(I wait for the ajax to finish)
end end
Then /^I send a mobile message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person| Then /^I send a mobile message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person|
step %(I am on the conversations page) step %(I am on the conversations page)
step %(I follow "New Message") step %(I follow "New Message")
step %(I wait for the ajax to finish)
step %(I fill in "contact_autocomplete" with "#{person}") step %(I fill in "contact_autocomplete" with "#{person}")
step %(I press the first ".as-result-item" within ".as-results") step %(I press the first ".as-result-item" within ".as-results")
step %(I fill in "conversation_subject" with "#{subject}") step %(I fill in "conversation_subject" with "#{subject}")
step %(I fill in "conversation_text" with "#{text}") step %(I fill in "conversation_text" with "#{text}")
step %(I press "Send") step %(I press "Send")
step %(I wait for the ajax to finish)
end end
Then /^I should see the participants popover$/ do Then /^I should see the participants popover$/ do
step %(I should see "Participants" within ".popover-title") page.execute_script("$('.popover').css('position', 'static')")
page.should have_css ".popover"
end end
Then /^I should see "([^"]*)" as part of the participants popover$/ do |name| Then /^I should see "([^"]*)" as part of the participants popover$/ do |name|
find(".conversation_participants_popover img.avatar[title^='#{name}']").should_not be_nil find(".conversation_participants_popover img.avatar[data-original-title^='#{name}']").should_not be_nil
end end
Then /^I close the participants popover$/ do Then /^I close the participants popover$/ do
find('.popover-title .close').click find('.popover-title .close', visible: false).click
end end

View file

@ -57,7 +57,7 @@ When /^(.*) in the header$/ do |action|
end end
And /^I submit the form$/ do And /^I submit the form$/ do
click_button :submit find("input[type='submit']").click
end end
Then /^the "([^"]*)" field should have a validation error$/ do |field| Then /^the "([^"]*)" field should have a validation error$/ do |field|
@ -104,23 +104,18 @@ When /^I append "([^"]*)" to the publisher$/ do |stuff|
elem = find('#status_message_fake_text') elem = find('#status_message_fake_text')
elem.native.send_keys(' ' + stuff) elem.native.send_keys(' ' + stuff)
wait_until do find('#status_message_text', visible: false).value.should include(stuff)
find('#status_message_text').value.include?(stuff)
end
end end
When /^I append "([^"]*)" to the publisher mobile$/ do |stuff| When /^I append "([^"]*)" to the publisher mobile$/ do |stuff|
elem = find('#status_message_text') elem = find('#status_message_text')
elem.native.send_keys(' ' + stuff) elem.native.send_keys(' ' + stuff)
wait_until do find('#status_message_text').value.should include(stuff)
find('#status_message_text').value.include?(stuff)
end
end end
And /^I want to mention (?:him|her) from the profile$/ do And /^I want to mention (?:him|her) from the profile$/ do
click_link("Mention") click_link("Mention")
wait_for_ajax_to_finish
within('#facebox') do within('#facebox') do
click_publisher click_publisher
end end
@ -130,16 +125,26 @@ And /^I hover over the "([^"]+)"$/ do |element|
page.execute_script("$(\"#{element}\").first().addClass('hover')") page.execute_script("$(\"#{element}\").first().addClass('hover')")
end end
When /^I prepare the deletion of the first post$/ do
within('.stream_element', match: :first) do
find('.remove_post', visible: false).click
end
end
When /^I click to delete the first post$/ do When /^I click to delete the first post$/ do
page.execute_script('$(".stream_element").first().find(".remove_post").first().click()') step "I prepare the deletion of the first post"
step "I confirm the alert"
end end
When /^I click to delete the first comment$/ do When /^I click to delete the first comment$/ do
find(".comment").find(".comment_delete").click() within("div.comment", match: :first) do
find(".comment_delete", visible: false).click
end
end end
When /^I click to delete the first uploaded photo$/ do When /^I click to delete the first uploaded photo$/ do
page.execute_script('$("#photodropzone").find(".x").first().click()') page.execute_script("$('#photodropzone .x').css('display', 'block');")
find("#photodropzone .x", match: :first).click
end end
And /^I click "([^"]*)" button$/ do |arg1| And /^I click "([^"]*)" button$/ do |arg1|
@ -147,19 +152,19 @@ And /^I click "([^"]*)" button$/ do |arg1|
end end
And /^I click on selector "([^"]*)"$/ do |selector| And /^I click on selector "([^"]*)"$/ do |selector|
page.execute_script("$('#{selector}').click();") find(selector).click
end end
And /^I click on the first selector "([^"]*)"$/ do |selector| And /^I click on the first selector "([^"]*)"$/ do |selector|
page.execute_script("$('#{selector}').first().click();") find(selector, match: :first).click
end end
And /^I preemptively confirm the alert$/ do And /^I confirm the alert$/ do
page.evaluate_script("window.confirm = function() { return true; }") page.driver.browser.switch_to.alert.accept
end end
And /^I preemptively reject the alert$/ do And /^I reject the alert$/ do
page.evaluate_script("window.confirm = function() { return false; }") page.driver.browser.switch_to.alert.dismiss
end end
When /^(.*) in the modal window$/ do |action| When /^(.*) in the modal window$/ do |action|
@ -170,25 +175,25 @@ end
When /^I press the first "([^"]*)"(?: within "([^"]*)")?$/ do |link_selector, within_selector| When /^I press the first "([^"]*)"(?: within "([^"]*)")?$/ do |link_selector, within_selector|
with_scope(within_selector) do with_scope(within_selector) do
find(:css, link_selector).click current_scope.find(link_selector, match: :first).click
end end
end end
When /^I press the ([\d])(?:nd|rd|st|th) "([^\"]*)"(?: within "([^\"]*)")?$/ do |number, link_selector, within_selector| When /^I press the ([\d])(?:nd|rd|st|th) "([^\"]*)"(?: within "([^\"]*)")?$/ do |number, link_selector, within_selector|
with_scope(within_selector) do with_scope(within_selector) do
find(:css, link_selector+":nth-child(#{number})").click current_scope.find(:css, link_selector+":nth-child(#{number})").click
end end
end end
Then /^(?:|I )should see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector| Then /^(?:|I )should see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector|
with_scope(scope_selector) do with_scope(scope_selector) do
page.has_css?(selector).should be_true current_scope.should have_css selector
end end
end end
Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector| Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector|
with_scope(scope_selector) do with_scope(scope_selector) do
page.has_css?(selector, :visible => true).should be_false current_scope.has_css?(selector, :visible => true).should be_false
end end
end end
@ -196,38 +201,14 @@ Then /^page should (not )?have "([^\"]*)"$/ do |negate, selector|
page.has_css?(selector).should ( negate ? be_false : be_true ) page.has_css?(selector).should ( negate ? be_false : be_true )
end end
When /^I wait for the ajax to finish$/ do
wait_for_ajax_to_finish
end
When /^I have turned off jQuery effects$/ do When /^I have turned off jQuery effects$/ do
evaluate_script("$.fx.off = true") page.execute_script("$.fx.off = true")
end
When /^I attach the file "([^\"]*)" to hidden element "([^\"]*)"(?: within "([^\"]*)")?$/ do |path, field, selector|
page.execute_script <<-JS
$("#{selector || 'body'}").find("input[name=#{field}]").css({opacity: 1});
JS
if selector
step "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\" within \"#{selector}\""
else
step "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\""
end
page.execute_script <<-JS
$("#{selector || 'body'}").find("input[name=#{field}]").css({opacity: 0});
JS
end
Then /^I should get download alert$/ do
page.evaluate_script("window.alert = function() { return true; }")
end end
When /^I search for "([^\"]*)"$/ do |search_term| When /^I search for "([^\"]*)"$/ do |search_term|
fill_in "q", :with => search_term fill_in "q", :with => search_term
find_field("q").native.send_key(:enter) find_field("q").native.send_key(:enter)
sleep(2) find(".tags_people")
end end
Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value| Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|
@ -252,8 +233,7 @@ Then /^I should see (\d+) contacts$/ do |n_posts|
end end
And /^I scroll down$/ do And /^I scroll down$/ do
evaluate_script("window.scrollBy(0,3000000)") page.execute_script("window.scrollBy(0,3000000)")
step "I wait for the ajax to finish"
end end
Then /^the notification dropdown should be visible$/ do Then /^the notification dropdown should be visible$/ do
@ -281,22 +261,19 @@ Then 'I press the attached image' do
end end
And "I wait for the popovers to appear" do And "I wait for the popovers to appear" do
wait_until(30) { evaluate_script('$(".popover").length') == 3 } page.should have_selector(".popover", count: 3)
end end
And /^I click close on all the popovers$/ do And /^I click close on all the popovers$/ do
page.execute_script("var time = 400; $('.popover .close').each( all(".popover .close", visible: false).each(&:click)
function(index, element){ setTimeout(function(){ $(element).click()},time);
time += 800;
});")
end end
Then /^I should see first post deletion link$/ do Then /^I should see first post deletion link$/ do
page.evaluate_script("$('.stream_element .delete').first().css('display')").should == "inline" page.should have_selector '.stream_element .delete', match: :first
end end
Then /^I should not see ajax loader on deletion link place$/ do Then /^I should not see ajax loader on deletion link place$/ do
page.evaluate_script("$('.hide_loader').first().css('display')").should == "none" page.should_not have_selector '.hide_loader'
end end
Then /^I should see a flash message indicating success$/ do Then /^I should see a flash message indicating success$/ do

View file

@ -1,7 +1,7 @@
module DebuggingCukeHelpers module DebuggingCukeHelpers
def start_debugging def start_debugging
require 'debug' require 'pry'
debugger binding.pry
true true
end end
end end

View file

@ -1,9 +1,11 @@
When /^I press the "([^\"]*)" key somewhere$/ do |key| When /^I press the "([^\"]*)" key somewhere$/ do |key|
find("div.stream_element").native.send_keys(key) within("#main_stream") do
find("div.stream_element", match: :first).native.send_keys(key)
end
end end
When /^I press the "([^\"]*)" key in the publisher$/ do |key| When /^I press the "([^\"]*)" key in the publisher$/ do |key|
find("#status_message_fake_text").native.send_keys(key) find("#status_message_fake_text", visible: false).native.send_keys(key)
end end
Then /^post (\d+) should be highlighted$/ do |position| Then /^post (\d+) should be highlighted$/ do |position|
@ -15,6 +17,8 @@ And /^I should have navigated to the highlighted post$/ do
end end
When /^I scroll to post (\d+)$/ do |position| When /^I scroll to post (\d+)$/ do |position|
page.driver.browser.execute_script("var element = $('div.stream_element')[" + position + " - 1]; page.should have_css("div.stream_element")
window.scrollTo(window.pageXOffset, element.offsetTop-50);") page.driver.browser.execute_script("
window.scrollTo(window.pageXOffset, $('div.stream_element')[#{position}-1].offsetTop-50);
")
end end

View file

@ -5,7 +5,7 @@ Then 'I should see the photo lightbox' do
end end
Then 'I should not see the photo lightbox' do Then 'I should not see the photo lightbox' do
step %{I should not see a "img" within "#lightbox-imageset"} step %{I should not see a "#lightbox-imageset" within "body"}
step %{I should not see a "#lightbox-backdrop" within "body"} step %{I should not see a "#lightbox-backdrop" within "body"}
step %{I should not see a "#lightbox-image" within "body"} step %{I should not see a "#lightbox-image" within "body"}
end end

View file

@ -11,5 +11,5 @@ And /^I mention Alice in the publisher$/ do
end end
And /^I click on the first user in the mentions dropdown list$/ do And /^I click on the first user in the mentions dropdown list$/ do
find('.mentions-autocomplete-list li:first').click find('.mentions-autocomplete-list li', match: :first).click
end end

View file

@ -123,10 +123,12 @@ Given /^I have several oEmbed data in cache$/ do
end end
Then /^I should see a video player$/ do Then /^I should see a video player$/ do
page.has_css?('object') visit aspects_path
find('.post-content .oembed')
find('.stream_container').should have_css('.post-content .oembed img')
end end
Then /^I should not see a video player$/ do Then /^I should not see a video player$/ do
page.has_no_css?('object') find('.stream_container').should_not have_css('.post-content .oembed img')
end end

View file

@ -11,11 +11,11 @@ Then /^the post should be expanded$/ do
end end
Then /^I should see an uploaded image within the photo drop zone$/ do Then /^I should see an uploaded image within the photo drop zone$/ do
find("#photodropzone img")["src"].should include("uploads/images") find("#photodropzone img", visible: false)["src"].should include("uploads/images")
end end
Then /^I should not see an uploaded image within the photo drop zone$/ do Then /^I should not see an uploaded image within the photo drop zone$/ do
all("#photodropzone img").should be_empty page.should_not have_css "#photodropzone img"
end end
Then /^I should not see any posts in my stream$/ do Then /^I should not see any posts in my stream$/ do
@ -43,7 +43,7 @@ When /^The user deletes their first post$/ do
end end
When /^I click on the first block button/ do When /^I click on the first block button/ do
find(".block_user").click find(".block_user", visible: false).click
end end
When /^I expand the post$/ do When /^I expand the post$/ do

View file

@ -11,11 +11,11 @@ Then /^"([^"]*)" should be post (\d+)$/ do |post_text, position|
end end
When /^I toggle nsfw posts$/ do When /^I toggle nsfw posts$/ do
find(".toggle_nsfw_state").click find(".toggle_nsfw_state", match: :first).click
end end
Then /^I should have (\d+) nsfw posts$/ do |num_posts| Then /^I should have (\d+) nsfw posts$/ do |num_posts|
all(".nsfw-shield").size.should == num_posts.to_i page.should have_css(".nsfw-shield", count: num_posts.to_i)
end end
When /^I click the show page link for "([^"]*)"$/ do |post_text| When /^I click the show page link for "([^"]*)"$/ do |post_text|

View file

@ -31,7 +31,7 @@ Given /^(?:|[tT]hat )?following user[s]?(?: exist[s]?)?:$/ do |table|
if hash.has_key? "username" and hash.has_key? "email" if hash.has_key? "username" and hash.has_key? "email"
step %{a user named "#{hash['username']}" with email "#{hash['email']}"} step %{a user named "#{hash['username']}" with email "#{hash['email']}"}
elsif hash.has_key? "username" elsif hash.has_key? "username"
step %{a user with username "#{hash['username']}"} step %{a user with username "#{hash['username']}"}
elsif hash.has_key? "email" elsif hash.has_key? "email"
step %{a user with email "#{hash['email']}"} step %{a user with email "#{hash['email']}"}
end end
@ -119,9 +119,9 @@ Then /^I should have (\d) contacts? in "([^"]*)"$/ do |n_contacts, aspect_name|
end end
When /^I (?:add|remove) the person (?:to|from) my "([^\"]*)" aspect$/ do |aspect_name| When /^I (?:add|remove) the person (?:to|from) my "([^\"]*)" aspect$/ do |aspect_name|
aspects_dropdown = find(".aspect_membership .toggle.button:first") aspects_dropdown = find(".aspect_membership .toggle.button", match: :first)
aspects_dropdown.click aspects_dropdown.click
find(".dropdown.active .dropdown_list li:contains('#{aspect_name}')").click find(".dropdown.active .dropdown_list li", text: aspect_name).click
aspects_dropdown.click aspects_dropdown.click
end end

View file

@ -8,7 +8,13 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "pat
module WithinHelpers module WithinHelpers
def with_scope(locator) def with_scope(locator)
locator ? within(locator) { yield } : yield if locator
within(locator, match: :first) do
yield
end
else
yield
end
end end
end end
World(WithinHelpers) World(WithinHelpers)
@ -23,9 +29,7 @@ end
When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector|
with_scope(selector) do with_scope(selector) do
silence_warnings { click_button(button)
sleep 1 if button == "Share"
click_button(button) } # ruby 1.9 produces a warning about UTF8 from rack-util
end end
end end
@ -90,9 +94,10 @@ When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector|
end end
end end
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector| When /^(?:|I )attach the file "([^"]*)" to (?:hidden )?"([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector|
with_scope(selector) do with_scope(selector) do
attach_file(field, path) page.execute_script("$(\"input[name='#{field}']\").css('opacity', '1');")
attach_file(field, Rails.root.join(path).to_s)
end end
end end
@ -103,14 +108,10 @@ Then /^(?:|I )should see JSON:$/ do |expected_json|
expected.should == actual expected.should == actual
end end
Then /^(?:|I )should see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars,selector| Then /^(?:|I )should see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars, selector|
vars.scan(/"([^"]+?)"/).flatten.each do |text| vars.scan(/"([^"]+?)"/).flatten.each do |text|
with_scope(selector) do with_scope(selector) do
if page.respond_to? :should current_scope.should have_content(text)
page.should have_content(text)
else
assert page.has_content?(text)
end
end end
end end
end end
@ -196,16 +197,8 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |
end end
Then /^(?:|I )should be on (.+)$/ do |page_name| Then /^(?:|I )should be on (.+)$/ do |page_name|
wait_until(3) do current_path = URI.parse(current_url).path
current_path = URI.parse(current_url).path current_path.should == path_to(page_name)
current_path == path_to(page_name)
end
if current_path.respond_to? :should
current_path.should == path_to(page_name)
else
assert_equal path_to(page_name), current_path
end
end end
Then /^(?:|I )should have the following query string:$/ do |expected_pairs| Then /^(?:|I )should have the following query string:$/ do |expected_pairs|

View file

@ -21,7 +21,7 @@ Feature: Unfollowing
Then I should have 0 contacts in "Besties" Then I should have 0 contacts in "Besties"
Then I go to the destroy user session page Then I sign out
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
@ -33,16 +33,13 @@ Feature: Unfollowing
And I follow "Besties" And I follow "Besties"
And I follow "add contacts to Besties" And I follow "add contacts to Besties"
And I wait for the ajax to finish
And I preemptively confirm the alert
And I press the first ".added" within "#facebox .contact_list ul > li:first-child" And I press the first ".added" within "#facebox .contact_list ul > li:first-child"
And I wait for the ajax to finish
When I follow "My Contacts" When I follow "My Contacts"
Then I should have 0 contacts in "Besties" Then I should have 0 contacts in "Besties"
When I go to the destroy user session page When I sign out
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
Then I should not see "is sharing with you." Then I should not see "is sharing with you."

View file

@ -13,7 +13,7 @@ module ApplicationCukeHelpers
def flash_message(selector=".message") def flash_message(selector=".message")
selector = "#flash_#{selector}" unless selector == ".message" selector = "#flash_#{selector}" unless selector == ".message"
find(selector) find(selector, match: :first)
end end
end end

View file

@ -2,7 +2,7 @@ module PublishingCukeHelpers
def make_post(text) def make_post(text)
fill_in 'status_message_fake_text', :with => text fill_in 'status_message_fake_text', :with => text
find(".creation").click find(".creation").click
wait_for_ajax_to_finish page.should have_content text unless page.has_css? '.nsfw-shield'
end end
def click_and_post(text) def click_and_post(text)
@ -12,29 +12,31 @@ module PublishingCukeHelpers
def click_publisher def click_publisher
page.execute_script(' page.execute_script('
$("#publisher").removeClass("closed"); $("#publisher").removeClass("closed");
$("#publisher").find("#status_message_fake_text").focus(); $("#publisher").find("#status_message_fake_text").focus();
') ')
end end
def expand_first_post def expand_first_post
find(".stream_element:first .expander").click within(".stream_element", match: :first) do
wait_until{ !find(".expander").visible? } find(".expander").click
find(".expander", visible: false).should_not be_visible
end
end end
def first_post_collapsed? def first_post_collapsed?
find(".stream_element:first .collapsible").should have_css(".expander") find(".stream_element .collapsible", match: :first).should have_css(".expander")
find(".stream_element:first .collapsible").has_selector?(".collapsed") find(".stream_element .collapsible", match: :first).has_selector?(".collapsed")
end end
def first_post_expanded? def first_post_expanded?
find(".stream_element:first .expander").should_not be_visible find(".stream_element .expander", match: :first, visible: false).should_not be_visible
find(".stream_element:first .collapsible").has_no_selector?(".collapsed") find(".stream_element .collapsible", match: :first).has_no_selector?(".collapsed")
find(".stream_element:first .collapsible").has_selector?(".opened") find(".stream_element .collapsible", match: :first).has_selector?(".opened")
end end
def first_post_text def first_post_text
stream_element_numbers_content(1).text() find(".stream_element .post-content", match: :first).text
end end
def frame_numbers_content(position) def frame_numbers_content(position)
@ -50,14 +52,13 @@ module PublishingCukeHelpers
end end
def find_post_by_text(text) def find_post_by_text(text)
find(".stream_element:contains('#{text}')") find(".stream_element", text: text)
end end
def like_post(post_text) def like_post(post_text)
within_post(post_text) do within_post(post_text) do
click_link 'Like' click_link 'Like'
end end
wait_for_ajax_to_finish
end end
def within_post(post_text) def within_post(post_text)
@ -75,7 +76,7 @@ module PublishingCukeHelpers
focus_comment_box focus_comment_box
make_comment(comment_text) make_comment(comment_text)
end end
wait_for_ajax_to_finish step %Q(I should see "#{comment_text}" within ".comment")
end end
def comment_on_show_page(comment_text) def comment_on_show_page(comment_text)
@ -83,24 +84,17 @@ module PublishingCukeHelpers
focus_comment_box(".label.comment") focus_comment_box(".label.comment")
make_comment(comment_text, "new-comment-text") make_comment(comment_text, "new-comment-text")
end end
wait_for_ajax_to_finish
end end
def make_comment(text, elem="text") def make_comment(text, elem="text")
fill_in elem, :with => text fill_in elem, :with => text
click_button :submit click_button "Comment"
end end
def focus_comment_box(elem="a.focus_comment_textarea") def focus_comment_box(elem="a.focus_comment_textarea")
find(elem).click find(elem).click
end end
def wait_for_ajax_to_finish(wait_time=30)
wait_until(wait_time) do
evaluate_script("$.active") == 0
end
end
def assert_nsfw(text) def assert_nsfw(text)
post = find_post_by_text(text) post = find_post_by_text(text)
post.find(".nsfw-shield").should be_present post.find(".nsfw-shield").should be_present

View file

@ -25,14 +25,14 @@ module UserCukeHelpers
def login_as(user, pass) def login_as(user, pass)
fill_in 'user_username', :with=>user fill_in 'user_username', :with=>user
fill_in 'user_password', :with=>pass fill_in 'user_password', :with=>pass
click_button :submit click_button "Sign in"
end end
# create a new @me user, if not present, and log in using the # create a new @me user, if not present, and log in using the
# integration_sessions controller (automatic) # integration_sessions controller (automatic)
def automatic_login def automatic_login
@me ||= FactoryGirl.create(:user_with_aspect, :getting_started => false) @me ||= FactoryGirl.create(:user_with_aspect, :getting_started => false)
page.driver.visit(new_integration_sessions_path(:user_id => @me.id)) visit(new_integration_sessions_path(:user_id => @me.id))
click_button "Login" click_button "Login"
end end
@ -44,7 +44,7 @@ module UserCukeHelpers
# checks the page content to see, if the login was successful # checks the page content to see, if the login was successful
def confirm_login def confirm_login
wait_until { page.has_content?("#{@me.first_name} #{@me.last_name}") } page.has_content?("#{@me.first_name} #{@me.last_name}")
end end
# delete all cookies, destroying the current session # delete all cookies, destroying the current session

View file

@ -5,7 +5,6 @@ Feature: Issue #3382 The comments under postings are missing when using the #tag
Given a user named "Bob Jones" with email "bob@bob.bob" Given a user named "Bob Jones" with email "bob@bob.bob"
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"
When I post "This is a post with a #tag" When I post "This is a post with a #tag"
And I wait for 1 second
And I am on the homepage And I am on the homepage
Scenario: Scenario:
@ -15,7 +14,6 @@ Feature: Issue #3382 The comments under postings are missing when using the #tag
Scenario: Scenario:
When I comment "this is a comment on my post" on "This is a post with a #tag" When I comment "this is a comment on my post" on "This is a post with a #tag"
And I wait for the ajax to finish
And I search for "#tag" And I search for "#tag"
Then I should be on the tag page for "tag" Then I should be on the tag page for "tag"
And I should see "this is a comment on my post" And I should see "this is a comment on my post"