Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI test environments #71

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ name: Deploy
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
push_to_rubygems:
name: Push to RubyGems
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_TAG
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Check Capybara::Playwright::VERSION
run: bundle exec ruby -e 'raise "invalid Capybara::Playwright::VERSION" unless Capybara::Playwright::VERSION == ENV["RELEASE_TAG"]'
- run: rake build
- name: setup API key
run: |
mkdir -p ~/.gem/
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials
chmod 600 ~/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- run: gem push pkg/capybara-playwright-driver-$RELEASE_TAG.gem
- name: Set RELEASE_TAG
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Check Capybara::Playwright::VERSION
run: bundle exec ruby -e 'raise "invalid Capybara::Playwright::VERSION" unless Capybara::Playwright::VERSION == ENV["RELEASE_TAG"]'
- run: rake build
- name: setup API key
run: |
mkdir -p ~/.gem/
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials
chmod 600 ~/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- run: gem push pkg/capybara-playwright-driver-$RELEASE_TAG.gem
60 changes: 49 additions & 11 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: RSpec
on: [pull_request]
jobs:
example_spec:
example_spec_legacy:
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.4.10
- 2.5.9
- 2.6.10
- '2.7'
- '3.0'
- '3.1'
- 2.7.8
name: (${{ matrix.ruby_version }}) Example
runs-on: ubuntu-latest
steps:
Expand All @@ -30,7 +28,47 @@ jobs:
export PLAYWRIGHT_CLI_VERSION=$(bundle exec ruby -e 'require "playwright"; puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION.strip')
npm install playwright@${PLAYWRIGHT_CLI_VERSION} || npm install playwright@next
./node_modules/.bin/playwright install
- run: bundle exec rspec spec/feature/
- run: bundle exec rspec spec/feature/example_spec.rb
env:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3
- run: bundle exec rspec spec/feature/ --exclude-pattern "spec/feature/example_spec.rb"
env:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3

example_spec:
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
name: (${{ matrix.ruby_version }}) Example
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
export PLAYWRIGHT_CLI_VERSION=$(bundle exec ruby -e 'require "playwright"; puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION.strip')
npm install playwright@${PLAYWRIGHT_CLI_VERSION} || npm install playwright@next
./node_modules/.bin/playwright install
- run: bundle exec rspec spec/feature/example_spec.rb
env:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3
- run: bundle exec rspec spec/feature/ --exclude-pattern "spec/feature/example_spec.rb"
env:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3
Expand All @@ -45,14 +83,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
Expand All @@ -71,19 +109,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup Allure
run: |
wget https://github.com/allure-framework/allure2/releases/download/2.14.0/allure_2.14.0-1_all.deb
sudo dpkg -i allure_2.14.0-1_all.deb
rm allure_2.14.0-1_all.deb
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
Expand Down
2 changes: 2 additions & 0 deletions spec/capybara/playwright_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module TestSessions
when /fill_in should handle carriage returns with line feeds in a textarea correctly/
# https://github.com/teamcapybara/capybara/commit/a9dd889b640759925bd04c4991de086160242fae#diff-b62b86ae4de5582bd37146266622e3debbdcab6bab6e95f522185c6a4269067dR82
pending "Not sure what firefox is doing here" if ENV['BROWSER'] == 'firefox'
when /#has_element\? should be true if the given element is on the page/
pending 'https://github.com/teamcapybara/capybara/pull/2751'
end

Capybara::SpecHelper.reset!
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
visit '/YusukeIwaki/capybara-playwright-driver'

page.driver.with_playwright_page do |page|
page.query_selector('get-repo').click
page.locator('button', hasText: 'Code').click
download = page.expect_download do
page.click('text=Download ZIP')
end
Expand Down
Loading