mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 01:13:03 -04:00
Compare commits
3 Commits
no-js
...
playwright
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
561aa6cd75 | ||
|
|
49e24bb92b | ||
|
|
3165d8b5c2 |
18
.github/workflows/ci-features-admin.yml
vendored
18
.github/workflows/ci-features-admin.yml
vendored
@@ -68,10 +68,24 @@ jobs:
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-comments.yml
vendored
17
.github/workflows/ci-features-comments.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-conversations.yml
vendored
17
.github/workflows/ci-features-conversations.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-crops.yml
vendored
17
.github/workflows/ci-features-crops.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-gardens.yml
vendored
17
.github/workflows/ci-features-gardens.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-harvests.yml
vendored
17
.github/workflows/ci-features-harvests.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-home.yml
vendored
17
.github/workflows/ci-features-home.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-members.yml
vendored
17
.github/workflows/ci-features-members.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-places.yml
vendored
17
.github/workflows/ci-features-places.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
17
.github/workflows/ci-features-plantings.yml
vendored
17
.github/workflows/ci-features-plantings.yml
vendored
@@ -71,7 +71,22 @@ jobs:
|
||||
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
20
.github/workflows/ci-features-posts.yml
vendored
20
.github/workflows/ci-features-posts.yml
vendored
@@ -86,8 +86,24 @@ jobs:
|
||||
- name: Install required JS packages
|
||||
run: yarn install
|
||||
|
||||
- name: install chrome
|
||||
run: sudo apt-get install google-chrome-stable
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Prepare database for testing
|
||||
run: bundle exec rails db:prepare
|
||||
|
||||
20
.github/workflows/ci-features-seeds.yml
vendored
20
.github/workflows/ci-features-seeds.yml
vendored
@@ -86,8 +86,24 @@ jobs:
|
||||
- name: Install required JS packages
|
||||
run: yarn install
|
||||
|
||||
- name: install chrome
|
||||
run: sudo apt-get install google-chrome-stable
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Prepare database for testing
|
||||
run: bundle exec rails db:prepare
|
||||
|
||||
20
.github/workflows/ci-features-timeline.yml
vendored
20
.github/workflows/ci-features-timeline.yml
vendored
@@ -86,8 +86,24 @@ jobs:
|
||||
- name: Install required JS packages
|
||||
run: yarn install
|
||||
|
||||
- name: install chrome
|
||||
run: sudo apt-get install google-chrome-stable
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Prepare database for testing
|
||||
run: bundle exec rails db:prepare
|
||||
|
||||
20
.github/workflows/ci-features.yml
vendored
20
.github/workflows/ci-features.yml
vendored
@@ -86,8 +86,24 @@ jobs:
|
||||
- name: Install required JS packages
|
||||
run: yarn install
|
||||
|
||||
- name: install chrome
|
||||
run: sudo apt-get install google-chrome-stable
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Prepare database for testing
|
||||
run: bundle exec rails db:prepare
|
||||
|
||||
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -101,8 +101,24 @@ jobs:
|
||||
- name: Install required JS packages
|
||||
run: yarn install
|
||||
|
||||
- name: install chrome
|
||||
run: sudo apt-get install google-chrome-stable
|
||||
- name: Install required OS packages
|
||||
run: |
|
||||
sudo apt-get -y install libpq-dev
|
||||
|
||||
- name: Cache Playwright Chromium browser
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Chromium browser (with deps)
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: yarn run playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright Chromium browser deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: yarn run playwright install-deps chromium
|
||||
|
||||
- name: Prepare database for testing
|
||||
run: bundle exec rails db:prepare
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -195,7 +195,7 @@ group :test do
|
||||
gem "percy-capybara", "~> 5.0.0"
|
||||
gem 'rails-controller-testing'
|
||||
gem "rspec-rebound"
|
||||
gem 'selenium-webdriver'
|
||||
gem 'capybara-playwright-driver'
|
||||
gem 'timecop'
|
||||
gem 'vcr'
|
||||
end
|
||||
|
||||
@@ -194,6 +194,10 @@ GEM
|
||||
capybara-email (3.0.2)
|
||||
capybara (>= 2.4, < 4.0)
|
||||
mail
|
||||
capybara-playwright-driver (0.5.7)
|
||||
addressable
|
||||
capybara
|
||||
playwright-ruby-client (>= 1.16.0)
|
||||
capybara-screenshot (1.0.26)
|
||||
capybara (>= 1.0, < 4)
|
||||
launchy
|
||||
@@ -492,6 +496,9 @@ GEM
|
||||
heroics (~> 0.1.1)
|
||||
moneta (~> 1.0.0)
|
||||
rate_throttle_client (~> 0.1.0)
|
||||
playwright-ruby-client (1.57.0)
|
||||
concurrent-ruby (>= 1.1.6)
|
||||
mime-types (>= 3.0)
|
||||
popper_js (2.11.8)
|
||||
pp (0.6.3)
|
||||
prettyprint
|
||||
@@ -796,6 +803,7 @@ DEPENDENCIES
|
||||
cancancan
|
||||
capybara
|
||||
capybara-email
|
||||
capybara-playwright-driver
|
||||
capybara-screenshot
|
||||
chartkick
|
||||
coffee-rails
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
"csslint": "^1.0.5",
|
||||
"eslint": "^5.0.0",
|
||||
"eslint-config-google": "^0.9.1",
|
||||
"jshint": "^2.9.4"
|
||||
"jshint": "^2.9.4",
|
||||
"playwright": "1.57.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "Conversations" do
|
||||
describe "Conversations", :js do
|
||||
let(:sender) { create(:member) }
|
||||
let(:recipient) { create(:member, login_name: 'beyonce') }
|
||||
|
||||
@@ -18,7 +18,7 @@ describe "Conversations" do
|
||||
click_link 'Inbox'
|
||||
end
|
||||
|
||||
it_behaves_like 'is accessible'
|
||||
include_examples 'is accessible'
|
||||
|
||||
it { expect(page).to have_content 'something i want to say' }
|
||||
it { page.percy_snapshot(page, name: 'conversations#index') }
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "Conversations" do
|
||||
describe "Conversations", :js do
|
||||
let(:sender) { create(:member) }
|
||||
let(:recipient) { create(:member, login_name: 'beyonce') }
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
require 'rails_helper'
|
||||
require 'custom_matchers'
|
||||
|
||||
describe "Gardens" do
|
||||
describe "Gardens", :js do
|
||||
context 'signed in' do
|
||||
include_context 'signed in member'
|
||||
before { visit new_garden_path }
|
||||
|
||||
it_behaves_like 'is accessible'
|
||||
include_examples 'is accessible'
|
||||
|
||||
it "displays required and optional fields properly" do
|
||||
expect(page).to have_selector ".required", text: "Name"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require 'rails_helper'
|
||||
require 'custom_matchers'
|
||||
|
||||
describe "Gardens#index" do
|
||||
describe "Gardens#index", :js do
|
||||
context "Logged in as member" do
|
||||
include_context 'signed in member'
|
||||
let(:member) { FactoryBot.create(:member, login_name: 'shadow') }
|
||||
@@ -14,7 +14,7 @@ describe "Gardens#index" do
|
||||
visit member_gardens_path(member_slug: member.slug)
|
||||
end
|
||||
|
||||
it_behaves_like 'is accessible'
|
||||
include_examples 'is accessible'
|
||||
|
||||
it "displays each of the gardens" do
|
||||
member.gardens.each do |garden|
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "Changing locales" do
|
||||
describe "Changing locales", :js do
|
||||
after { I18n.locale = :en }
|
||||
|
||||
let(:member) { FactoryBot.create(:member) }
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "follows" do
|
||||
describe "follows", :js do
|
||||
context "when signed out" do
|
||||
let(:member) { create(:member) }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "member profile" do
|
||||
describe "member profile", :js do
|
||||
let(:member) { create(:member) }
|
||||
let(:other_member) { create(:member) }
|
||||
let(:admin_member) { create(:admin_member) }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require 'rails_helper'
|
||||
require 'capybara/email/rspec'
|
||||
|
||||
describe "Planting reminder email" do
|
||||
describe "Planting reminder email", :js do
|
||||
let(:member) { create(:member) }
|
||||
let(:mail) { NotifierMailer.planting_reminder(member) }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require "rails_helper"
|
||||
require 'custom_matchers'
|
||||
describe "Display a planting" do
|
||||
describe "Display a planting", :js do
|
||||
describe 'planting perennial' do
|
||||
let(:garden) { FactoryBot.create(:garden, location: 'Edinburgh') }
|
||||
let(:crop) { FactoryBot.create(:crop, name: 'feijoa', perennial: true) }
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe "timeline" do
|
||||
describe "timeline", :js do
|
||||
let(:member) { FactoryBot.create(:member) }
|
||||
let(:friend1) { FactoryBot.create(:member) }
|
||||
let(:friend2) { FactoryBot.create(:member) }
|
||||
|
||||
@@ -10,35 +10,36 @@ Rails.application.eager_load!
|
||||
|
||||
require 'capybara'
|
||||
require 'capybara/rspec'
|
||||
require 'selenium/webdriver'
|
||||
require 'capybara-screenshot/rspec'
|
||||
require 'axe-capybara'
|
||||
require 'axe-rspec'
|
||||
# require 'capybara-screenshot/rspec'
|
||||
# require 'axe-capybara'
|
||||
# require 'axe-rspec'
|
||||
|
||||
# Required for running in the dev container
|
||||
Capybara.register_driver :selenium_chrome_customised_headless do |app|
|
||||
options = Selenium::WebDriver::Options.chrome
|
||||
options.add_argument("--headless")
|
||||
options.add_argument("--no-sandbox")
|
||||
options.add_argument("--window-size=1920,1080")
|
||||
options.add_argument("--disable-dev-shm-usage")
|
||||
Capybara.register_driver :playwright_chrome_customised do |app|
|
||||
# options = Capybara::Playwright::Options.chrome
|
||||
# # options.add_argument("--headless")
|
||||
# options.add_argument("--no-sandbox")
|
||||
# options.add_argument("--window-size=1920,1080")
|
||||
# options.add_argument("--disable-dev-shm-usage")
|
||||
|
||||
# driver = Selenium::WebDriver.for :chrome, options: options
|
||||
|
||||
Capybara::Selenium::Driver.new(app, browser: :chrome, options:)
|
||||
Capybara::Playwright::Driver.new(app,
|
||||
browser_type: ENV["PLAYWRIGHT_BROWSER"]&.to_sym || :chromium,
|
||||
headless: true)
|
||||
end
|
||||
|
||||
|
||||
# Ability to pass in flags to
|
||||
if ENV["CAPYBARA_DRIVER"]
|
||||
Capybara.default_driver = ENV["CAPYBARA_DRIVER"].to_sym
|
||||
Capybara.javascript_driver = ENV["CAPYBARA_DRIVER"].to_sym
|
||||
else
|
||||
# Capybara.default_driver = :selenium_chrome_customised_headless
|
||||
Capybara.javascript_driver = :selenium_chrome_customised_headless
|
||||
Capybara.default_driver = :playwright_chrome_customised
|
||||
Capybara.javascript_driver = :playwright_chrome_customised
|
||||
end
|
||||
Capybara.enable_aria_label = true
|
||||
|
||||
Capybara::Screenshot.register_driver(:selenium_chrome_customised_headless) do |driver, path|
|
||||
Capybara::Screenshot.register_driver(:playwright_chrome_customised) do |driver, path|
|
||||
driver.browser.save_screenshot(path)
|
||||
end
|
||||
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
|
||||
@@ -50,7 +51,7 @@ Capybara.server_port = 8081
|
||||
|
||||
# TODO: Find a better home.
|
||||
shared_examples 'is accessible' do
|
||||
it "is accessible", :js do
|
||||
it "is accessible", pending: 'not compatible with playwright' do
|
||||
expect(page).to be_axe_clean.skipping('color-contrast', 'heading-order', 'aria-required-children').according_to :wcag2a
|
||||
end
|
||||
end
|
||||
@@ -122,15 +123,15 @@ RSpec.configure do |config|
|
||||
# TODO: Why are we setting this page size then straight afterwards, maximising?
|
||||
width = 1920
|
||||
height = 1080
|
||||
Capybara.current_session.driver.browser.manage.window.resize_to(width, height)
|
||||
# Capybara.current_session.driver.browser.manage.window.resize_to(width, height)
|
||||
|
||||
if page.driver.browser.respond_to?(:url_blacklist)
|
||||
page.driver.browser.url_blacklist = [
|
||||
'gravatar.com',
|
||||
'okfn.org',
|
||||
'googlecode.com'
|
||||
]
|
||||
end
|
||||
# if page.driver.browser.respond_to?(:url_blacklist)
|
||||
# page.driver.browser.url_blacklist = [
|
||||
# 'gravatar.com',
|
||||
# 'okfn.org',
|
||||
# 'googlecode.com'
|
||||
# ]
|
||||
# end
|
||||
|
||||
# Historically, we wanted to .maximize; but this actually undoes the resize_to step above
|
||||
# with chrome headless
|
||||
|
||||
19
yarn.lock
19
yarn.lock
@@ -801,6 +801,11 @@ fs.realpath@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
fsevents@2.3.2:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
||||
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
||||
|
||||
function-bind@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||
@@ -1298,6 +1303,20 @@ picomatch@^2.3.0, picomatch@^2.3.1:
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
playwright-core@1.57.0:
|
||||
version "1.57.0"
|
||||
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.57.0.tgz#3dcc9a865af256fa9f0af0d67fc8dd54eecaebf5"
|
||||
integrity sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==
|
||||
|
||||
playwright@1.57.0:
|
||||
version "1.57.0"
|
||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.57.0.tgz#74d1dacff5048dc40bf4676940b1901e18ad0f46"
|
||||
integrity sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==
|
||||
dependencies:
|
||||
playwright-core "1.57.0"
|
||||
optionalDependencies:
|
||||
fsevents "2.3.2"
|
||||
|
||||
prelude-ls@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||
|
||||
Reference in New Issue
Block a user