Challenge - 5 Problems
GitHub Actions Cypress Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
GitHub Actions: Output of a Cypress test run step
You have a GitHub Actions workflow that runs Cypress tests using the command
npx cypress run. What is the expected output snippet when all tests pass successfully?Cypress
name: Run Cypress Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Cypress tests
run: npx cypress runAttempts:
2 left
💡 Hint
Look for the summary line that shows all tests passing with zero failures.
✗ Incorrect
When Cypress tests run successfully in GitHub Actions, the output includes a summary showing all tests passed with zero failures.
❓ Configuration
intermediate2:00remaining
Correct GitHub Actions step to cache Cypress dependencies
Which GitHub Actions step correctly caches Cypress dependencies to speed up workflow runs?
Attempts:
2 left
💡 Hint
Check the correct cache path and use of hashFiles for key.
✗ Incorrect
The correct cache path is ~/.cache/Cypress with actions/cache@v3 and the key should use hashFiles on package-lock.json to detect dependency changes.
🔀 Workflow
advanced2:00remaining
GitHub Actions workflow to run Cypress tests only on pull requests
You want to run Cypress tests only when a pull request is opened or updated. Which
on trigger configuration achieves this?Attempts:
2 left
💡 Hint
Pull request events include types like opened and synchronize.
✗ Incorrect
The pull_request event with types opened and synchronize triggers the workflow when a PR is opened or updated (synchronize).
❓ Troubleshoot
advanced2:00remaining
Diagnosing Cypress test failures in GitHub Actions logs
Your Cypress tests fail in GitHub Actions with the error:
Timed out waiting for the browser to connect. What is the most likely cause?Attempts:
2 left
💡 Hint
Consider the environment where the tests run and browser requirements.
✗ Incorrect
This error usually means Cypress cannot launch the browser because the runner lacks a display server or browser installation.
✅ Best Practice
expert2:00remaining
Best practice for storing Cypress test artifacts in GitHub Actions
Which GitHub Actions step correctly saves Cypress screenshots and videos as artifacts after test runs?
Attempts:
2 left
💡 Hint
Check the correct syntax for multiple paths in the upload-artifact action.
✗ Incorrect
The correct way is to list multiple paths separated by new lines under 'path' using a pipe (|) character.