-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for cypress.json and cypress.env.json (plus add tes…
…ts) (#4)
- Loading branch information
Showing
22 changed files
with
157 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js v${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install dependencies | ||
run: npm ci --production | ||
- name: Run integration tests | ||
run: bash tests/integration/integration-tests.sh | ||
|
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 |
---|---|---|
|
@@ -108,3 +108,5 @@ cypress | |
|
||
# saucectl configuration folder | ||
.sauce | ||
|
||
results/ |
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,12 @@ | ||
# CONTRIBUTING | ||
|
||
## Run tests | ||
|
||
### Integration tests | ||
`npm run test-integration` triggers the [integration tests script](/tests/integration/integration-tests.sh). Which triggers the tests in (/tests/integration/fixtures/cypress-tests) and runs them through `cypress-runner.js`. | ||
|
||
## Publishing to Docker Hub | ||
To publish the Docker image: | ||
* Create a [new release](https://github.com/saucelabs/sauce-cypress-runner/releases) | ||
* Tag it with an appropriate version, based on semantic versioning | ||
* Update the changelog and list the frameworks and browsers. If the frameworks and browsers didn't change, then copy and paste them from the previous release |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,10 @@ | ||
const path = require('path'); | ||
|
||
function getAbsolutePath(pathToDir) { | ||
if (path.isAbsolute(pathToDir)) { | ||
return pathToDir; | ||
} | ||
return path.join(process.cwd(), pathToDir); | ||
} | ||
|
||
module.exports.getAbsolutePath = getAbsolutePath; |
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,14 @@ | ||
/// <reference types="cypress" /> | ||
|
||
context('Actions', () => { | ||
beforeEach(() => { | ||
cy.visit('https://example.cypress.io/commands/actions') | ||
}) | ||
|
||
// https://on.cypress.io/interacting-with-elements | ||
|
||
it('should use .env.json', () => { | ||
expect(Cypress.env('foo')).to.equal('bar'); | ||
}) | ||
}) | ||
|
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,6 @@ | ||
rootDir: ./tests/fixtures/cypress-tests/ | ||
targetDir: ./tests/fixtures/cypress-tests/config-tests/ | ||
reportsDir: ./results | ||
execCommand: | ||
- npm | ||
- test |
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,5 @@ | ||
{ | ||
"env": { | ||
"foo": "bar" | ||
} | ||
} |
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,6 @@ | ||
rootDir: ./tests/fixtures/cypress-tests/ | ||
targetDir: ./tests/fixtures/cypress-tests/env-tests/ | ||
reportsDir: ./results | ||
execCommand: | ||
- npm | ||
- test |
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 @@ | ||
{ | ||
"foo": "BAR" | ||
} |
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,12 @@ | ||
/// <reference types="cypress" /> | ||
|
||
context('Actions', () => { | ||
beforeEach(() => { | ||
cy.visit('https://example.cypress.io/commands/actions') | ||
}) | ||
|
||
it('should use .env.json', () => { | ||
expect(Cypress.env('foo')).to.equal('BAR'); | ||
}) | ||
}) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
rootDir: ./tests/fixtures/cypress-tests/ | ||
targetDir: ./tests/fixtures/cypress-tests/kitchen-sink/ | ||
reportsDir: ./results | ||
execCommand: | ||
- npm | ||
- test |
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
export SAUCE_USERNAME='' | ||
export SAUCE_ACCESS_KEY='' | ||
export CONFIG_FILE=./tests/fixtures/cypress-tests/config-tests/config.yaml && node . | ||
export CONFIG_FILE=./tests/fixtures/cypress-tests/kitchen-sink/config.yaml && node . |