-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add example showing usePackageLock (#56)
* Add example demonstrating test time dependencies * Add link to external dep repo * Add new example to test workflow * apply best practice for usePackageLock * no chrome tests until fixed upstream * Remove packages from README
- Loading branch information
Showing
8 changed files
with
5,731 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: v1alpha | ||
kind: testcafe | ||
sauce: | ||
region: us-west-1 | ||
concurrency: 2 | ||
metadata: | ||
tags: | ||
- e2e | ||
- release team | ||
- other tag | ||
testcafe: | ||
version: 3.6.2 | ||
configFile: .testcaferc.js | ||
# Controls what files are available in the context of a test run (unless explicitly excluded by .sauceignore). | ||
rootDir: ./ | ||
suites: | ||
- name: "testcafe react example - firefox" | ||
browserName: "firefox" | ||
src: | ||
- "tests/*.test.ts" | ||
platformName: "Windows 11" | ||
|
||
# Controls what artifacts to fetch when the suites have finished. | ||
artifacts: | ||
download: | ||
when: always | ||
match: | ||
- console.log | ||
directory: ./artifacts/ | ||
|
||
reporters: | ||
spotlight: # Prints an overview of failed or otherwise interesting jobs. | ||
enabled: true | ||
|
||
npm: | ||
usePackageLock: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
disableNativeAutomation: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# saucectl TestCafe & React Example | ||
|
||
This example demonstrates how to use a test time dependency when running your | ||
TestCafe tests with saucectl. | ||
|
||
## What You'll Need | ||
|
||
The steps below illustrate one of the quickest ways to get set up. If you'd like | ||
a more in-depth guide, please check out our | ||
[documentation](https://docs.saucelabs.com/dev/cli/saucectl/#installing-saucectl). | ||
|
||
### Install `saucectl` | ||
|
||
```sh | ||
npm install -g saucectl | ||
``` | ||
|
||
### Set Your Sauce Labs Credentials | ||
|
||
```sh | ||
saucectl configure | ||
``` | ||
|
||
## Running The Examples | ||
|
||
Simply check out this repo, navigate into `examples/react` and run the | ||
command below :rocket: | ||
|
||
```sh | ||
saucectl run | ||
``` | ||
|
||
## Configuration | ||
|
||
The test in this example requires the | ||
[testcafe-react-selectors](https://github.com/DevExpress/testcafe-react-selectors) | ||
package so it needs to be available in the test environment. We can define a | ||
list of packages to install before test execution in the saucectl configuration | ||
file. | ||
|
||
```yaml | ||
npm: | ||
usePackageLock: true | ||
``` | ||
Enabling the `usePackageLock` option ensures that the project's package.json and | ||
package-lock.json are used during package installation. In most cases, this will | ||
reduce the time needed for package installation. |
Oops, something went wrong.