Commit 7154fc3c authored by Jonne Haß's avatar Jonne Haß
Browse files

Port cukes from poltergeist to aparition

closes #8234
parent cd6eb3de
......@@ -2,6 +2,7 @@
## Refactor
* Replaced some `http://` links in the UI with their `https://` counterparts [#8207](https://github.com/diaspora/diaspora/pull/8207)
* Testing: Replaced phantomjs with headless Chrome/Chromium [#8234](https://github.com/diaspora/diaspora/pull/8234)
## Bug fixes
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
......
......@@ -280,9 +280,9 @@ group :test do
# Cucumber (integration tests)
gem "capybara", "3.15.0"
gem "database_cleaner", "1.8.3"
gem "poltergeist", "1.18.1"
gem "apparition", "0.6.0"
gem "capybara", "3.15.0"
gem "database_cleaner", "1.8.3"
gem "cucumber-api-steps", "0.14", require: false
......
......@@ -57,6 +57,9 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.0.1)
apparition (0.6.0)
capybara (~> 3.13, < 4)
websocket-driver (>= 0.6.5)
arel (9.0.0)
asset_sync (2.11.0)
activemodel (>= 4.1.0)
......@@ -116,7 +119,6 @@ GEM
websocket-driver (~> 0.6)
chunky_png (1.3.11)
citrus (3.0.2)
cliver (0.3.2)
coderay (1.1.2)
compass (1.0.3)
chunky_png (~> 1.2)
......@@ -470,10 +472,6 @@ GEM
ast (~> 2.4.0)
pg (1.2.3)
phantomjs (2.1.1.0)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
pronto (0.10.0)
gitlab (~> 4.0, >= 4.0.0)
httparty (>= 0.13.7)
......@@ -793,6 +791,7 @@ DEPENDENCIES
acts-as-taggable-on (= 6.5.0)
acts_as_api (= 1.0.1)
addressable (= 2.7.0)
apparition (= 0.6.0)
asset_sync (= 2.11.0)
autoprefixer-rails (= 8.6.5)
bootstrap-sass (= 3.4.1)
......@@ -854,7 +853,6 @@ DEPENDENCIES
open_graph_reader (= 0.7.0)
openid_connect (= 1.1.8)
pg (= 1.2.3)
poltergeist (= 1.18.1)
pronto (= 0.10.0)
pronto-eslint (= 0.10.0)
pronto-haml (= 0.10.0)
......
......@@ -9,7 +9,7 @@ screenshot_opts = "--require features --format pretty"
%>
# 'normal' test runs
default: <%= std_opts %> -r features --tags 'not @nophantomjs'
default: <%= std_opts %> -r features
wip: -r features --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip and not @screenshots'
......
......@@ -43,13 +43,6 @@ RUN addgroup --gid $DIA_GID diaspora && \
chown -R diaspora:diaspora $HOME /diaspora
RUN curl -L \
https://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
| tar -xj -C /usr/local/bin \
--transform='s#.*/##' \
phantomjs-2.1.1-linux-x86_64/bin/phantomjs
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_APP_CONFIG="/diaspora/.bundle"
......
......@@ -19,10 +19,12 @@ Feature: Change settings
Scenario: Change my email preferences
When I uncheck "user_email_preferences_mentioned"
And I scroll a bit
And I press "change_email_preferences"
Then I should see "Email notifications changed"
And the "user_email_preferences_mentioned" checkbox should not be checked
When I uncheck "user_email_preferences_mentioned_in_comment"
And I scroll a bit
And I press "change_email_preferences"
Then I should see "Email notifications changed"
And the "user_email_preferences_mentioned_in_comment" checkbox should not be checked
......
......@@ -19,7 +19,6 @@ Feature: commenting
When I focus the comment field
And I fill in the following:
| text | is that a poodle? |
And I reject the alert after I follow "My activity"
And I press "Comment"
Then I should see "is that a poodle?" within ".comment"
And I should see "less than a minute ago" within ".comment time"
......
......@@ -34,7 +34,6 @@ Feature: editing your profile
And the "#profile_public_details" bootstrap-switch should be off
When I fill in "profile_bio" with "This is a new awesome bio"
And I reject the alert after I follow "My activity"
Then I should be on my edit profile page
When I fill in "profile[tag_string]" with "#kamino"
......
......@@ -33,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 "Following #boss"
When I press "Stop following #boss"
And I go to the followed tags stream page
Then I should not see "#boss" within "#tags_list"
......
......@@ -11,10 +11,10 @@ Feature: new user registration
Scenario: new user goes through the setup wizard
When I fill in the following:
| profile_first_name | O |
And I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
And the publisher should be expanded
And I close the publisher
Then I wait until ajax requests finished
When I go to the stream page
Then the publisher should be expanded
When I close the publisher
Then I should not see "awesome_button"
And I should not see any posts in my stream
......
......@@ -12,12 +12,11 @@ Feature: Invitations
And I press "Create account"
Then I should be on the getting started page
And I should see "Well, hello there!"
And I fill in the following:
When I fill in the following:
| profile_first_name | O |
And I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
And I close the publisher
Then I wait until ajax requests finished
When I go to the stream page
Then I close the publisher
Scenario: accept invitation from user
Given I have been invited by "alice@alice.alice"
......@@ -27,11 +26,10 @@ Feature: Invitations
Then I should be on the getting started page
And I should see "Well, hello there!"
And I should be able to friend "alice@alice.alice"
And I fill in the following:
When I fill in the following:
| profile_first_name | O |
And I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
Then I wait until ajax requests finished
When I go to the stream page
And I close the publisher
And I log out
And I sign in as "alice@alice.alice"
......
# We can create a separate cucumber profile that will run these tests with Selenium
@nophantomjs
@javascript
Feature: oembed
In order to make videos easy accessible
......
......@@ -42,7 +42,7 @@ Feature: Mentions
Then I should see "Bob Jones" within ".tt-suggestion"
When I click on the first user in the mentions dropdown list
When I press the "A" key in the publisher
And I append "@Bob" to the publisher
And I type "@Bob" into the publisher
Then I should not see the mentions dropdown list
When I press "Share"
Then I should see "Bob Jones" within ".stream-element"
......@@ -80,8 +80,8 @@ Feature: Mentions
And I enter "@Bob" in the comment field
Then I should see "Bob Jones" within ".tt-suggestion"
When I click on the first user in the mentions dropdown list
And I press the "A" key in the publisher
And I append "@Bob" to the publisher
And I enter " A " in the comment field
And I enter "@Bob" in the comment field
Then I should not see the mentions dropdown list
When I press "Comment"
Then I should see "Bob Jones" within ".comments .comment:last-child"
......@@ -54,7 +54,7 @@ Feature: preview posts in the stream
Given I expand the publisher
And I mention Alice in the publisher
And I preview the post
And I confirm the alert after I follow "Alice Smith"
And I follow "Alice Smith"
Then I should see "Alice Smith"
Scenario: preview a post on tag page
......
......@@ -44,7 +44,7 @@
And I sign in as "alice@alice.alice"
And I open the show page of the "Here is a post to test with" post
And I confirm the alert after I click to report the post
And I confirm the prompt after I click to report the post
And I should see a flash message containing "The report has successfully been created"
......
......@@ -39,7 +39,7 @@ Feature: editing the profile in the mobile view
Then I should see "#kamino" within "ul#as-selections-tags"
And I should see "#starwars" within "ul#as-selections-tags"
When I confirm the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload"
When I accept the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload"
And I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload"
Then I should see "button.png completed"
And I should see a "img" within "#profile_photo_upload"
......
......@@ -17,7 +17,7 @@ Feature: editing the getting started in the mobile view
And I should not see "awesome_button"
Scenario: new user adds a profile photo and tags
When I confirm the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload"
When I accept the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload"
And I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload"
Then I should see a "img" within "#profile_photo_upload"
......
......@@ -43,7 +43,7 @@ Feature: posting from the mobile main page
Scenario: back out of posting a photo-only post
Given I visit the mobile publisher page
When I confirm the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload-publisher"
When I accept the alert after I attach the file "spec/fixtures/bad_urls.txt" to "qqfile" within "#file-upload-publisher"
Then I should not see an uploaded image within the photo drop zone
When I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload-publisher"
And I should see "button.png completed"
......
......@@ -119,6 +119,7 @@ When /^(.*) in the aspect creation modal$/ do |action|
end
When /^I drag "([^"]*)" (up|down)$/ do |aspect_name, direction|
expect(page).to have_js_defined("$('body').sortable")
page.execute_script("$('#aspect_nav .list-group').sortable('option', 'tolerance', 'pointer');")
aspect_id = @me.aspects.where(name: aspect_name).first.id
aspect = find(:xpath, "//div[@id='aspect_nav']/ul/a[@data-aspect-id='#{aspect_id}']")
......
......@@ -85,11 +85,23 @@ And /^I click on the first selector "([^"]*)"$/ do |selector|
end
And /^I confirm the alert after (.*)$/ do |action|
accept_confirm do
step action
end
end
And /^I accept the alert after (.*)$/ do |action|
accept_alert do
step action
end
end
And /^I confirm the prompt after (.*)$/ do |action|
accept_prompt do
step action
end
end
And /^I reject the alert after (.*)$/ do |action|
dismiss_confirm do
step action
......@@ -155,6 +167,10 @@ Then /^I should see (\d+) contacts$/ do |n_posts|
has_css?("#people-stream .stream-element", count: n_posts.to_i).should be true
end
When /^I scroll a bit$/ do
page.execute_script("window.scrollBy(0,200)")
end
And /^I scroll down$/ do
page.execute_script("window.scrollBy(0,3000000)")
end
......
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