Skip to content

Commit

Permalink
Updated code reference tags in testrunner config doc (#40)
Browse files Browse the repository at this point in the history
* updated reference tags in testrunner-toolkit/configuration.md

* updated reference tags

* updated deploy.yml to include `npm` commands instead of `yarn`
  • Loading branch information
Tacktician authored Dec 10, 2020
1 parent ae4958b commit 9ad8bf0
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 124 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}

- uses: borales/actions-yarn@v2.0.0
- name: Install Dependencies
if: steps.cache-npm-packages.outputs.cache-hit != 'true'
with:
cmd: install
run: |
npm install
- uses: actions/cache@v2
id: cache-build
Expand All @@ -42,10 +42,10 @@ jobs:
build
key: ${{ runner.os }}-${{ github.sha }}

- uses: borales/actions-yarn@v2.0.0
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: build
run: |
npm run build
test:
runs-on: ubuntu-latest
Expand All @@ -64,15 +64,15 @@ jobs:
build
key: ${{ runner.os }}-${{ github.sha }}

- uses: borales/actions-yarn@v2.0.0
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: install
- name: Install Dependencies
if: steps.cache-npm-packages.outputs.cache-hit != 'true'
run: |
npm install
- uses: borales/actions-yarn@v2.0.0
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: build
run: |
npm run build
- name: install saucectl
run: |
Expand Down Expand Up @@ -115,15 +115,15 @@ jobs:
build
key: ${{ runner.os }}-${{ github.sha }}

- uses: borales/actions-yarn@v2.0.0
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: install
- name: Install Dependencies
if: steps.cache-npm-packages.outputs.cache-hit != 'true'
run: |
npm install
- uses: borales/actions-yarn@v2.0.0
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: build
run: |
npm run build
- name: Deploy to Bucket
run: |-
Expand Down Expand Up @@ -155,15 +155,15 @@ jobs:
build
key: ${{ runner.os }}-${{ github.sha }}

- uses: borales/actions-yarn@v2.0.0
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: install
- name: Install Dependencies
if: steps.cache-npm-packages.outputs.cache-hit != 'true'
run: |
npm install
- uses: borales/actions-yarn@v2.0.0
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
with:
cmd: build
run: |
npm run build
- name: Deploy to Bucket
run: |-
Expand Down
9 changes: 9 additions & 0 deletions docs/ClientOnly.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function ClientOnly({children}) {
if (typeof window === 'undefined') {
return null;
}

return children;
}

export default ClientOnly;
105 changes: 17 additions & 88 deletions docs/dev/testrunner-toolkit/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,100 +61,29 @@ Below are framework-specific configuration examples that exist in the [Testrunne

<TabItem value="puppeteer">

```yaml
apiVersion: v1
# type of object, there could be theoretically other types
# of "orchestration" in the future, e.g. network config maps etc.
kind: Test
# meta data to the test
metadata:
name: Feature XYZ
tags:
- e2e
- release team
- other tag
build: "Build #$BUILD_ID in $BUILD_ENV"
# Every file defined in this list will be bundled into a zip and
# uploaded to Sauce Labs.
files:
- ./tests/puppeteer/demo.test.js
# - ./tests/puppeteer/sauce-swag-checkout.test.js
# - ./tests/puppeteer/sauce-swag-login.test.js
# Define a test runner image (e.g. an image to run WebdriverIO tests)
# Like in Docker, these images can be developed as Open Source projects
# and maintained by our teams, while at the same time, customers can
# build their own images as well
image:
# while a set of properties are defined by our Yaml format
base: saucelabs/stt-puppeteer-jest-node
version: latest
```yaml reference
https://github.com/saucelabs/testrunner-toolkit/blob/master/.sauce/puppeteer.yml
```

</TabItem>
<TabItem value="playwright">

```yaml
apiVersion: v1
# type of object, there could be theoretically other types
# of "orchestration" in the future, e.g. network config maps etc.
kind: Test
# meta data to the test
metadata:
name: Feature XYZ
tags:
- e2e
- release team
- other tag
build: "Build #$BUILD_ID in $BUILD_ENV"
# Every file defined in this list will be bundled into a zip and
# uploaded to Sauce Labs.
files:
- ./tests/playwright/demo.test.js
# Define a test runner image (e.g. an image to run WebdriverIO tests)
# Like in Docker, these images can be developed as Open Source projects
# and maintained by our teams, while at the same time, customers can
# build their own images as well
image:
# while a set of properties are defined by our Yaml format
base: saucelabs/stt-playwright-jest-node
version: latest
```yaml reference
https://github.com/saucelabs/testrunner-toolkit/blob/master/.sauce/playwright.yml
```

</TabItem>
<TabItem value="testcafe">

```yaml
apiVersion: v1
metadata:
name: Feature XYZ
tags:
- e2e
- release team
- other tag
build: Release $CI_COMMIT_SHORT_SHA
files:
- ./tests/testcafe/*.js
image:
base: saucelabs/stt-testcafe-node
version: latest
```yaml reference
https://github.com/saucelabs/testrunner-toolkit/blob/master/.sauce/testcafe.yml
```

</TabItem>
<TabItem value="cypress">

```yaml
apiVersion: v1
metadata:
name: Feature XYZ
tags:
- e2e
- release team
- other tag
files:
- ./tests/cypress/example.test.js
image:
base: saucelabs/stt-cypress-mocha-node
version: latest
```yaml reference
https://github.com/saucelabs/testrunner-toolkit/blob/master/.sauce/cypress.yml
```

</TabItem>
Expand All @@ -164,25 +93,25 @@ image:

Saucectl offers the possibility to set up your tests environment before executing any of your suites using `beforeExec`:

<!--https://github.com/saucelabs/saucectl/blob/master/.sauce/puppeteer_before_exec.yml#L14-L15
-->
```yaml
beforeExec:
- npm install --save chai

```yaml reference
https://github.com/saucelabs/saucectl/blob/master/.sauce/puppeteer_before_exec.yml#L14-L15
```

## Parallelization

Saucectl is capable of running tests in parallel by utilizing multiple CI machines. _This feature requires a Sauce Labs account_, so don't forget to set the environment variables `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`!

Parallelization can be turned on either via the config:
<!--https://github.com/saucelabs/saucectl/blob/master/.sauce/puppeteer_parallel.yml#L21
-->
```yaml
parallel: true


```yaml reference
https://github.com/saucelabs/saucectl/blob/master/.sauce/puppeteer_parallel.yml#L21
```


or the CLI

```bash
saucectl run --parallel
```
Expand Down
16 changes: 8 additions & 8 deletions docs/dev/testrunner-toolkit/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Also, with the `suites` field you can specify groups of tests, as well as the pr

<TabItem value="puppeteer">

```sh
```yaml
apiVersion: v1alpha
metadata:
name: Testing Puppeteer Support
Expand All @@ -58,7 +58,7 @@ sauce:
</TabItem>
<TabItem value="playwright">
```sh
```yaml
apiVersion: v1alpha
metadata:
name: Testing Playwright Support
Expand All @@ -84,7 +84,7 @@ sauce:
</TabItem>
<TabItem value="testcafe">
```sh
```yaml
apiVersion: v1alpha
metadata:
name: Testing TestCafe Support
Expand All @@ -110,7 +110,7 @@ sauce:
</TabItem>
<TabItem value="cypress">
```sh
```yaml
apiVersion: v1alpha
metadata:
name: Testing Cypress Support
Expand Down Expand Up @@ -353,7 +353,7 @@ In the examples below, the environment variables (`env`) equate to the values co

<TabItem value="puppeteer">

```sh
```yaml
name: Puppeteer Pipeline Browser Tests
on:
pull_request:
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
</TabItem>
<TabItem value="playwright">

```sh
```yaml
name: Playwright Pipeline Browser Tests
on:
pull_request:
Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
</TabItem>
<TabItem value="testcafe">

```sh
```yaml
name: TestCafe Pipeline Browser Tests
on:
pull_request:
Expand Down Expand Up @@ -449,7 +449,7 @@ jobs:
</TabItem>
<TabItem value="cypress">

```sh
```yaml
name: Cypress Pipeline Browser Tests
on:
pull_request:
Expand Down

0 comments on commit 9ad8bf0

Please sign in to comment.