Skip to content
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
17 changes: 13 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,25 @@ jobs:
- run: yarn
- name: Set up @percy/cli from git
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
BRANCH: ${{ github.event.inputs.branch }}
run: |
cd /tmp
git clone --branch ${{ github.event.inputs.branch }} --depth 1 https://github.com/percy/cli
git clone --branch "$BRANCH" --depth 1 https://github.com/percy/cli
cd cli
PERCY_PACKAGES=`find packages -mindepth 1 -maxdepth 1 -type d | sed -e 's/packages/@percy/g' | tr '\n' ' '`
git log -1
yarn
yarn build
yarn global:link
cd ${{ github.workspace }}
yarn remove @percy/cli && yarn link `echo $PERCY_PACKAGES`
npx percy --version
# Expose the freshly built `percy` on PATH. yarn link symlinks the
# package but not its bin, so `npx percy` would miss it and download
# the unrelated public `percy`. Link is best-effort; PATH is what
# makes percy resolvable.
echo "$(yarn global bin)" >> "$GITHUB_PATH"
export PATH="$(yarn global bin):$PATH"
cd ${{ github.workspace }}
yarn remove @percy/cli >/dev/null 2>&1 || true
yarn link `echo $PERCY_PACKAGES` >/dev/null 2>&1 || true
percy --version
- run: npx percy exec --testing -- bundle exec rspec
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
Capybara.default_driver = :selenium_headless
Capybara.javascript_driver = :selenium_headless

# Capybara's built-in :selenium_headless driver still passes `options:` to
# driver init, which newer selenium-webdriver logs as a [DEPRECATION]
# [:browser_options] warning on first use. The suite asserts exact stdout
# via `output(...).to_stdout`, so any example that first boots the driver
# inside such a block fails on that extra line (seed-dependent). Silence
# just that deprecation id.
if Selenium::WebDriver.logger.respond_to?(:ignore)
Selenium::WebDriver.logger.ignore(:browser_options)
end

# Setup for Capybara to test Jekyll static files served by Rack
Capybara.server_port = 3003
Capybara.server = :puma, { Silent: true }
Expand Down
Loading