Skip to content

Commit

Permalink
Merge pull request #8418 from SuperTux88/switch-to-cuprite
Browse files Browse the repository at this point in the history
Switch from apparition to cuprite driver
  • Loading branch information
SuperTux88 committed Jun 8, 2023
2 parents 8ebfd48 + bb7e5a3 commit 87f17fe
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 27 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Expand Up @@ -47,6 +47,7 @@ We use yarn to install the frontend dependencies now, so you need to have that i
* Remove support for `therubyracer` [#8337](https://github.com/diaspora/diaspora/issues/8337)
* Replace `unicorn` with `puma` [#8392](https://github.com/diaspora/diaspora/pull/8392)
* Drop `strip_exif` flag and always remove exif data from uploaded images [#8417](https://github.com/diaspora/diaspora/pull/8417)
* Replace `apparition` with `cuprite` [#8418](https://github.com/diaspora/diaspora/pull/8418)

## Bug fixes
* Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655)
Expand Down Expand Up @@ -148,7 +149,7 @@ We use yarn to install the frontend dependencies now, so you need to have that i
* 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)
* Update comment counter when deleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
* Delete a user's invitation code during account deletion [#8202](https://github.com/diaspora/diaspora/pull/8202)
* Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -224,8 +224,8 @@ group :test do

# Cucumber (integration tests)

gem "apparition", "0.6.0"
gem "capybara", "3.35.3"
gem "cuprite", "0.14.3"
gem "database_cleaner-active_record", "2.0.1"

gem "cucumber-api-steps", "0.14", require: false
Expand Down
13 changes: 9 additions & 4 deletions Gemfile.lock
Expand Up @@ -74,9 +74,6 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.1.0)
apparition (0.6.0)
capybara (~> 3.13, < 4)
websocket-driver (>= 0.6.5)
asset_sync (2.15.2)
activemodel (>= 4.1.0)
fog-core
Expand Down Expand Up @@ -190,6 +187,9 @@ GEM
cucumber-wire (6.2.1)
cucumber-core (~> 10.1, >= 10.1.0)
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
cuprite (0.14.3)
capybara (~> 3.0)
ferrum (~> 0.13.0)
database_cleaner-active_record (2.0.1)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
Expand Down Expand Up @@ -280,6 +280,11 @@ GEM
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ferrum (0.13)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (>= 0.6, < 0.8)
ffi (1.15.5)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
Expand Down Expand Up @@ -773,7 +778,6 @@ DEPENDENCIES
acts-as-taggable-on (= 9.0.1)
acts_as_api (= 1.0.1)
addressable (= 2.8.0)
apparition (= 0.6.0)
asset_sync (= 2.15.2)
autoprefixer-rails (= 10.4.7.0)
babel-transpiler (= 0.7.0)
Expand All @@ -785,6 +789,7 @@ DEPENDENCIES
configurate (= 0.5.0)
cucumber-api-steps (= 0.14)
cucumber-rails (= 2.5.1)
cuprite (= 0.14.3)
database_cleaner-active_record (= 2.0.1)
devise (= 4.8.1)
devise-two-factor (= 4.0.2)
Expand Down
2 changes: 1 addition & 1 deletion app/views/registrations/_form.haml
Expand Up @@ -32,7 +32,7 @@
placeholder: t("registrations.new.username"),
title: t("registrations.new.enter_username"),
required: true,
pattern: "[A-Za-z0-9_.\-]+",
pattern: "[A-Za-z0-9_.\\-]+",
aria: {labelledby: "usernameLabel"}

- if mobile
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/_form.haml
Expand Up @@ -19,7 +19,7 @@
placeholder: t("registrations.new.username"),
class: "input-block-level form-control",
required: true,
pattern: "[A-Za-z0-9_.@\-]+",
pattern: "[A-Za-z0-9_.@\\-]+",
autocapitalize: "none",
autocorrect: "off",
autofocus: true,
Expand Down
2 changes: 1 addition & 1 deletion features/desktop/auto_follow_back.feature
Expand Up @@ -24,7 +24,7 @@ Feature: auto follow back a user
Scenario: When a user with auto follow back enabled is shared with by a user he's ignoring, he's not sharing back
When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page
And I click on the profile block button
And I confirm the alert after I click on the profile block button
And I sign out
When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page
Expand Down
2 changes: 1 addition & 1 deletion features/desktop/conversations.feature
Expand Up @@ -60,7 +60,7 @@ Feature: private conversations
When I sign in as "bob@bob.bob"
And I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome"
Then I should see "Greetings" within "#conversation-inbox"
When I click on selector ".hide_conversation"
When I confirm the prompt after I click on selector ".hide_conversation"
Then I should not see "Greetings" within "#conversation-inbox"
When I sign in as "alice@alice.alice"
Then I should have 1 unread private message
Expand Down
4 changes: 2 additions & 2 deletions features/desktop/mentions.feature
Expand Up @@ -52,8 +52,8 @@ Feature: Mentions
And I click on the first user in the mentions dropdown list
And I press "Share"
Then I should see "Bob Jones" within ".stream-element"
When I follow "Bob Jones"
Then I should see "Bob Jones"
When I follow "Bob Jones" within ".stream-element"
Then I should see "Bob Jones" within "#author_info"

Scenario: A user mentions another user in a comment and it displays correctly
Given following users exist:
Expand Down
1 change: 0 additions & 1 deletion features/desktop/post_with_a_poll.feature
Expand Up @@ -87,7 +87,6 @@ Feature: posting with a poll
| poll_question | What kind of yogurt do you like? |
And I fill in the following for the options:
| normal |
| |
And I click on selector "#poll_creator_container"
And I click on selector "#publisher button#submit"
Then I should see an element ".poll-answer input.error"
2 changes: 1 addition & 1 deletion features/mobile/edits_profile.feature
Expand Up @@ -40,7 +40,7 @@ Feature: editing the profile in the mobile view
And I should see "#starwars" within "ul#as-selections-tags"

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"
And I confirm the prompt after 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"

Expand Down
2 changes: 1 addition & 1 deletion features/mobile/getting_started.feature
Expand Up @@ -18,7 +18,7 @@ Feature: editing the getting started in the mobile view

Scenario: new user adds a profile photo and tags
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"
And I confirm the prompt after I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload"
Then I should see a "img" within "#profile_photo_upload"

When I fill in "follow_tags" with "#men"
Expand Down
1 change: 0 additions & 1 deletion features/step_definitions/auth_code_steps.rb
Expand Up @@ -22,7 +22,6 @@
end

When /^I parse the auth code and create a request to the token endpoint$/ do
current_url = page.driver.network_traffic.last.url # We get a redirect to example.org that we can't follow
code = current_url[/(?<=code=)[^&]+/]
expect(code).to be_present
post api_openid_connect_access_tokens_path, code: code,
Expand Down
10 changes: 5 additions & 5 deletions features/support/env.rb
Expand Up @@ -13,7 +13,7 @@
require "capybara/rails"
require "capybara/cucumber"
require "capybara/session"
require "capybara/apparition"
require "capybara/cuprite"

require "cucumber/api_steps"

Expand All @@ -24,15 +24,15 @@

Capybara.server = :webrick

Capybara.register_driver :apparition do |app|
Capybara.register_driver :cuprite do |app|
# Pass headless: false here if you need to see the browser
Capybara::Apparition::Driver.new(
Capybara::Cuprite::Driver.new(
app,
headless: true,
browser_options: %i[no_sandbox disable_setuid_sandbox disable_gpu]
browser_options: {'no-sandbox': nil}
)
end
Capybara.javascript_driver = :apparition
Capybara.javascript_driver = :cuprite

# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
Expand Down
10 changes: 4 additions & 6 deletions features/support/paths.rb
Expand Up @@ -70,12 +70,10 @@ def navigate_to(page_name)
end

def confirm_on_page(page_name)
page.driver.send(:retry_if_wrong_world) do
if page_name == "my profile page"
expect(page).to have_path_in([person_path(@me.person), user_profile_path(@me.username)])
else
expect(page).to have_path(path_to(page_name))
end
if page_name == "my profile page"
expect(page).to have_path_in([person_path(@me.person), user_profile_path(@me.username)])
else
expect(page).to have_path(path_to(page_name))
end
end
end
Expand Down

0 comments on commit 87f17fe

Please sign in to comment.