The TestCafe team no longer maintains the testcafe-action repository. If you want to take over the project, we'll be happy to hand it over. To contact the team, create a new GitHub issue.
This action installs TestCafe from npm and runs tests.
- uses: actions/checkout@v1
- uses: DevExpress/testcafe-action@latestwith:
args: "chrome tests"In this example, the checkout action fetches the repository. Then testcafe-action installs the latest TestCafe version and runs tests from the tests folder in Google Chrome.
The args option specifies command line arguments passed to the testcafe command.
You can also use the version option to specify the TestCafe version.
Run the setup-node action before
testcafe-actionto install a specific Node.js version.
TestCafe command line arguments.
- uses: DevExpress/testcafe-action@latestwith:
args: "chrome fixture.js -s takeOnFails=true -q -c 3"Optional
The TestCafe version to install.
- uses: DevExpress/testcafe-action@latestwith:
version: "1.6.0"args: "chrome tests"Default value:latest
Optional
Whether to skip having this action install TestCafe. This is useful if you are managing TestCafe already in your package.json dependencies and want to use that version.
- uses: DevExpress/testcafe-action@latestwith:
skip-install: trueargs: "chrome tests"Default value:false
This section contains sample workflows that show how to use testcafe-action.
The following workflow demonstrates how to use testcafe-action in a basic scenario:
name: Basic TestCafe Workflowon: [push]jobs:
build:
name: Run TestCafe Testsruns-on: windows-lateststeps:
- uses: actions/checkout@v1
- name: Install TestCafe from 'npm' and Run Testsuses: DevExpress/testcafe-action@latestwith:
args: "chrome my-fixture.js"The checkout action fetches the repository. Then testcafe-action installs TestCafe and runs my-fixture.js in Chrome.
This workflow is triggered when you push changes to the repository. The job runs on a Windows virtual machine.
The following workflow demonstrates how to run TestCafe tests across Node.js versions and operating systems.
name: Target Multiple Node.js Versions and Operating Systemson: [push]jobs:
build:
name: Run Tests Across Node.js Versions and Operating Systemsruns-on: ${{ matrix.os }}strategy:
matrix:
os: [ubuntu-latest, windows-latest]node: [8, 10, 12]steps:
- uses: actions/setup-node@v1with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v1
- name: Run TestCafe Testsuses: DevExpress/testcafe-action@latestwith:
args: "chrome tests"This job contains a matrix strategy that duplicates it to run on Windows and Ubuntu virtual machines in three Node.js versions (8, 10, and 12).
The setup-node action installs the Node.js version defined in the matrix. Then checkout fetches the code and testcafe-action runs tests.