Unverified Commit 629e6382 authored by Steffen van Bergerem's avatar Steffen van Bergerem
Browse files

Use Poltergeist instead of Selenium

parent f1e296cc
......@@ -22,7 +22,13 @@ branches:
- 'stable'
- 'develop'
before_install: gem install bundler
before_install:
- gem install bundler
- mkdir travis-phantomjs
- wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
bundler_args: "--deployment --without development production --with mysql postgresql --jobs 3 --retry 3"
script: "./script/ci/build.sh"
......
......@@ -281,7 +281,7 @@ group :test do
gem "capybara", "2.7.1"
gem "database_cleaner", "1.5.3"
gem "selenium-webdriver", "2.47.1"
gem "poltergeist", "1.9.0"
gem "cucumber-api-steps", "0.13", require: false
gem "json_spec", "1.1.4"
......
......@@ -116,9 +116,8 @@ GEM
timers (>= 4.1.1)
celluloid-supervision (0.20.5)
timers (>= 4.1.1)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
chunky_png (1.3.5)
cliver (0.3.2)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
......@@ -579,6 +578,11 @@ GEM
pg (0.18.4)
phantomjs (2.1.1.0)
pkg-config (1.1.7)
poltergeist (1.9.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
pronto (0.6.0)
gitlab (~> 3.6, >= 3.4.0)
......@@ -781,11 +785,6 @@ GEM
rake (>= 0.9, < 12)
sass (~> 3.4.15)
securecompare (1.0.0)
selenium-webdriver (2.47.1)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
shellany (0.0.1)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
......@@ -902,7 +901,9 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket (1.2.3)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.0)
xml-simple (1.1.5)
xpath (2.0.0)
......@@ -982,6 +983,7 @@ DEPENDENCIES
open_graph_reader (= 0.6.1)
openid_connect (= 0.11.2)
pg (= 0.18.4)
poltergeist (= 1.9.0)
pronto (= 0.6.0)
pronto-eslint (= 0.6.1)
pronto-haml (= 0.6.0)
......@@ -1029,7 +1031,6 @@ DEPENDENCIES
ruby-oembed (= 0.10.1)
rubyzip (= 1.2.0)
sass-rails (= 5.0.4)
selenium-webdriver (= 2.47.1)
shoulda-matchers (= 3.1.1)
sidekiq (= 4.1.2)
sidekiq-cron (= 0.4.2)
......
......@@ -8,13 +8,13 @@ app.views.SinglePostCommentStream = app.views.CommentStream.extend({
},
highlightPermalinkComment: function() {
if(document.location.hash){
if (document.location.hash && $(document.location.hash).length > 0) {
var element = $(document.location.hash);
var headerSize = 50;
var headerSize = 60;
$(".highlighted").removeClass("highlighted");
element.addClass("highlighted");
var pos = element.offset().top - headerSize;
$("html").animate({scrollTop:pos});
window.scroll(0, pos);
}
},
......
......@@ -7,6 +7,7 @@
//= require jquery.charcount
//= require js-routes
//= require autosize
//= require keycodes
//= require jquery.autoSuggest.custom
//= require fileuploader-custom
//= require rails-timeago
......
......@@ -220,7 +220,7 @@
},
resetCommentBox: function(el){
var commentButton = el.find("input.comment-button").first();
var commentButton = $(el).find("input.comment-button").first();
commentButton.attr("value", commentButton.data("reset-with"));
commentButton.removeAttr("disabled");
commentButton.blur();
......
......@@ -74,7 +74,7 @@ $mobile-navbar-height: 46px;
}
.navbar-toggle {
display: unset;
display: block;
margin: 6px 15px;
}
......
%div
%select{name: 'user_aspects', class: 'user_aspects form-control', 'data-person-id' => @person.id}
%select.aspect_dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id}
%option{value: 'list_cover', class: 'list_cover', disabled: 'true', selected: 'true'}
= t("add_contact")
- contact = current_user.contact_for(@person)
......
......@@ -29,11 +29,12 @@
$('#file-upload').addClass("loading");
$("#profile_photo_upload").find(".avatar").addClass('loading');
$("#file-upload-spinner").removeClass("hidden");
$("#fileInfo").show();
},
onComplete: function(id, fileName, responseJSON){
$("#file-upload-spinner").addClass("hidden");
$('#fileInfo').text(fileName + ' completed').fadeOut(2000);
$("#fileInfo").text(Diaspora.I18n.t("photo_uploader.completed", {"file": fileName}));
$('#file-upload').removeClass("loading");
/* flash message prompt */
......
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
common: &common
# Try to kill mongrel after suite if tmp/pids/mongrel_selenium.pid exists
# kill_mongrel_after_suite: true
local: &local
<<: *common
test_framework: webrat
selenium_server_address: "127.0.0.1"
selenium_server_port: "4444"
selenium_browser_key: "*chrome /usr/bin/firefox"
application_address: "127.0.0.1"
application_port: "4000"
local_jsunit:
<<: *local
application_port: "8080"
# Possible Sauce Labs configurations as of 2009/11/19
# From: http://saucelabs.com/products/docs/sauce-ondemand/browsers
#
# saucelabs_browser_os saucelabs_browser saucelabs_browser_version (pick one)
#
# "Windows 2003" "iexplore" "6.", "7.", "8."
# "firefox" "2.", "3.0", "3.5"
# "safari" "3.", "4."
# "opera" "9."
# "googlechrome" ""
# "Linux" "firefox" "3."
saucelabs: &saucelabs
<<: *common
test_framework: webrat
# URL of Selenium RC server:
selenium_server_address: "saucelabs.com"
selenium_server_port: "4444"
# Saucelabs credentials / Browser to drive
saucelabs_username: "YOUR-SAUCELABS-USERNAME"
saucelabs_access_key: "YOUR-SAUCELABS-ACCESS-KEY"
saucelabs_browser_os: "Linux"
saucelabs_browser: "firefox"
saucelabs_browser_version: "3."
saucelabs_max_duration_seconds: 1800
# Selenium RC browser connects to and tests the app at this URL:
application_address: "testhost.com" # this will be ovewritten if tunnel_method == :saucetunnel
application_port: 80
# App host can actually be a tunnel that tunnels from <application_address>:<application_port> to localhost:<tunnel_to_localhost_port>
# There are 3 kinds of tunnels:
#
# tunnel_method: :saucetunnel
# tunnel_to_localhost_port: 4000 # Warning: application_port and tunnel_to_localhost_port must be identical if you are using Webrat
# tunnel_startup_timeout: 240
#
# tunnel_method: :sshtunnel
# application_address: proxy.mycompany.com
# application_port: 12345 # or can be a range XXXX-YYYY
# tunnel_to_localhost_port: 4000 # Warning: application_port and tunnel_to_localhost_port must be identical if you are using Webrat
# tunnel_username: fred
# tunnel_keyfile: "/Users/<%= ENV['USER'] %>/.ssh/id_rsa" # or tunnel_password: "password"
#
# tunnel_method: :othertunnel You're managing your tunnel independently
saucelabs_jsunit: &saucelabs_jsunit
<<: *saucelabs
# We are using the Jetty server for Saucelabs JsUnit selenium testing.
localhost_app_server_port: "8080"
saucelabs_jsunit_firefox:
<<: *saucelabs_jsunit
saucelabs_jsunit_ie:
<<: *saucelabs_jsunit
saucelabs_browser_os: "Windows 2003"
saucelabs_browser: "iexplore"
saucelabs_browser_version: "7."
jsunit_polling_interval_seconds: 300
saucelabs_jsunit_safari:
<<: *saucelabs_jsunit
saucelabs_browser_os: "Windows 2003"
saucelabs_browser: "safari"
saucelabs_browser_version: "4."
saucelabs_jsunit_chrome:
<<: *saucelabs_jsunit
saucelabs_browser_os: "Windows 2003"
saucelabs_browser: "googlechrome"
saucelabs_browser_version: ""
......@@ -16,8 +16,7 @@ Feature: The activity stream
And I should see "is that a poodle?"
When I am on "alice@alice.alice"'s page
And I click to delete the first comment
And I confirm the alert
And I confirm the alert after I click to delete the first comment
And I go to the activity stream page
Then I should not see "Look at this dog"
......
......@@ -11,15 +11,13 @@ Feature: Blocking a user from the stream
And I sign in as "bob@bob.bob"
Scenario: Blocking a user
When I click on the first block button
And I confirm the alert
When I confirm the alert after I click on the first block button
And I go to the home page
Then I should not see any posts in my stream
Scenario: Blocking a user from the profile page
When I am on "alice@alice.alice"'s page
When I click on the profile block button
And I confirm the alert
And I confirm the alert after I click on the profile block button
Then "All your base are belong to us!" should be post 1
When I go to the home page
Then I should not see any posts in my stream
......@@ -11,8 +11,7 @@ Feature: Close account
Then I should see a modal
And I should see "Hey, please don’t go!" within "#closeAccountModal"
When I put in my password in "close_account_password"
And I press "close_account_confirm"
And I confirm the alert
And I confirm the alert after I press "Close account" in the modal
Then I should be on the new user session page
When I try to sign in manually
......
......@@ -27,8 +27,7 @@ Feature: commenting
When "bob@bob.bob" has commented "is that a poodle?" on "Look at this dog"
And I am on "alice@alice.alice"'s page
Then I should see "is that a poodle?"
When I click to delete the first comment
And I confirm the alert
When I confirm the alert after I click to delete the first comment
Then I should not see "is that a poodle?"
Scenario: expand the comment form in the main stream and an individual aspect stream
......@@ -48,7 +47,7 @@ Feature: commenting
Then I should see "Look at this dog"
When I follow "less than a minute ago"
Then I should see "Look at this dog"
And I make a show page comment "I think that’s a cat"
When I make a show page comment "I think that’s a cat"
Then I should see "less than a minute ago" within "#comments"
When I go to "alice@alice.alice"'s page
Then I should see "I think that’s a cat"
......@@ -60,7 +59,8 @@ Feature: commenting
Then I should see "Look at this dog"
And I should see "I think that’s a cat" within ".comment:last-child"
When I follow "less than a minute ago" within ".comment:last-child"
Then I should see "I think that’s a cat" within ".comment .highlighted"
Then I should see "Look at this dog" within "#single-post-content"
And I should see "I think that’s a cat" within ".comment .highlighted"
And I should have scrolled down
Scenario: permalink to comment from a status show page
......
......@@ -25,7 +25,7 @@ Feature: editing your profile
And the "profile_gender" field should contain "Fearless"
And the "profile_first_name" field should contain "Boba"
And the "profile_last_name" field should contain "Fett"
And I should see "This is a bio"
And the "profile_bio" field should contain "This is a bio"
And the "profile_date_year" field should be filled with "1986"
And the "profile_date_month" field should be filled with "11"
And the "profile_date_day" field should be filled with "30"
......@@ -42,7 +42,10 @@ Feature: editing your profile
And I should see "#starwars" within "ul#as-selections-tags"
And the "#profile_public_details" bootstrap-switch should be on
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I confirm the alert
When I confirm the alert after I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
Then I should see "button.png completed"
And I should see a "img" within "#profile_photo_upload"
When I go to my edit profile page
Then I should see a "img" within "#profile_photo_upload"
......@@ -6,21 +6,19 @@ Feature: posting
Background:
Given following users exist:
| username |
| bob |
| alice |
When I sign in as "bob@bob.bob"
And I post a status with the text "I am da #boss"
When I sign out
And I sign in as "alice@alice.alice"
And I search for "#boss"
| username | email |
| Alice Smith | alice@alice.alice |
| Bob Jones | bob@bob.bob |
And "bob@bob.bob" has a public post with text "I am da #boss"
When I sign in as "alice@alice.alice"
And I go to the tag page for "boss"
And I press "Follow #boss"
Then I should see a ".tag-following-action .followed"
Scenario: can post a message from the tag page
Then I should see "#boss" within "#publisher"
And I click the publisher and post "#boss from the tag page"
And I search for "#boss"
When I click the publisher and post "#boss from the tag page"
And I go to the tag page for "boss"
Then I should see "#boss from the tag page"
Scenario: see a tag that I am following
......@@ -35,7 +33,7 @@ Feature: posting
Then I should see "#boss from the #boss tag page" within "body"
Scenario: can stop following a tag from the tag page
When I press "Stop following #boss"
When I press "Following #boss"
And I go to the followed tags stream page
Then I should not see "#boss" within "#tags_list"
......
......@@ -15,8 +15,7 @@ Feature: Invitations
And I fill in the following:
| profile_first_name | O |
And I follow "awesome_button"
And I confirm the alert
And I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
And I close the publisher
......@@ -31,8 +30,7 @@ Feature: Invitations
And I fill in the following:
| profile_first_name | O |
And I follow "awesome_button"
And I confirm the alert
And I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
And I close the publisher
And I log out
......
......@@ -36,8 +36,12 @@ Feature: Keyboard navigation
And I should have navigated to the highlighted post
Scenario: navigate upwards
When I scroll to post 3
And I press the "K" key somewhere
When I press the "J" key somewhere
And I press the "J" key somewhere
And I press the "J" key somewhere
Then post 3 should be highlighted
When I press the "K" key somewhere
Then post 2 should be highlighted
And I should have navigated to the highlighted post
......@@ -46,7 +50,7 @@ Feature: Keyboard navigation
When I press the "J" key somewhere
And I press the "C" key somewhere
Then the first comment field should be open
Scenario: navigate downwards on a profile page
When I am on "alice@alice.alice"'s page
And I press the "J" key somewhere
......
......@@ -15,10 +15,13 @@ Feature: Liking posts
Scenario: Liking and unliking a post from the stream
When I like the post "I like unicorns" in the stream
Then I should see a ".likes" within "#main_stream .stream_element"
Then I should see "Unlike" within ".stream_element .feedback"
And I should see a ".likes .media" within "#main_stream .stream_element"
When I unlike the post "I like unicorns" in the stream
Then I should not see a ".likes" within "#main_stream .stream_element"
Then I should see "Like" within ".stream_element .feedback"
And I should not see a ".likes .media" within "#main_stream .stream_element"
Scenario: Liking and unliking a post from a single post page
When I open the show page of the "I like unicorns" post
......
......@@ -7,7 +7,7 @@ Feature: User manages contacts
Scenario: creating an aspect from contacts index
Given I am signed in
And I am on the contacts page
And I follow "+ Add an aspect"
And I follow "Add an aspect"
And I fill in "aspect_name" with "Dorm Mates" in the aspect creation modal
And I click on selector ".btn-primary" in the aspect creation modal
Then I should see "Dorm Mates" within "#aspect_nav"
......@@ -18,15 +18,15 @@ Feature: User manages contacts
When I follow "Add an aspect"
And I fill in "aspect_name" with "losers" in the aspect creation modal
And I click on selector ".btn-primary" in the aspect creation modal
Then I should see "losers" within "#aspect_nav"
Then I should be on the contacts page
And I should see "losers" within "#aspect_nav"
Scenario: deleting an aspect from contacts index
Given I am signed in
And I have an aspect called "People"
When I am on the contacts page
And I follow "People"
And I click on selector "#delete_aspect"
And I confirm the alert
And I confirm the alert after I click on selector "#delete_aspect"
Then I should be on the contacts page
And I should not see "People" within "#aspect_nav"
......@@ -35,8 +35,7 @@ Feature: User manages contacts
And I have an aspect called "People"
When I am on the aspects page
And I click on "People" aspect edit icon
And I click on selector "#delete_aspect"
And I confirm the alert
And I confirm the alert after I click on selector "#delete_aspect"
Then I should be on the contacts page
And I should not see "People" within "#aspect_nav"
......@@ -81,7 +80,10 @@ Feature: User manages contacts
And I have an aspect called "People"
And I have an aspect called "Cat People"
When I am on the contacts page
And I have turned off jQuery effects
And I drag "Cat People" up
And I go to the contacts page
Then I should see "Cat People" as 2. aspect
And I should see "People" as 3. aspect
When I go to the contacts page
Then I should see "Cat People" as 2. aspect
And I should see "People" as 3. aspect
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment