Skip to content

Commit

Permalink
Add integration test in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Jun 18, 2022
1 parent deddb3b commit f10a44b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,18 @@ jobs:
run: |
saucectl run --config .sauce/config_mac.yml --runner-version "url: https://storage.googleapis.com/${{ secrets.GCS_RUNNER_BUCKET }}/sauce-cypress-macos-${{ github.run_id }}.zip"
working-directory: ./tests/sauce-connect/

run-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout runner
uses: actions/checkout@v2

- name: Use Node.js v14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: run integration test
run: |
node . -r tests/config-tests/sauce-runner.json -s default
1 change: 1 addition & 0 deletions tests/config-tests/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
supportFile: false,
},
});
11 changes: 4 additions & 7 deletions tests/config-tests/cypress/e2e/nested/config.cy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/// <reference types="cypress" />

context('Actions', function () {
beforeEach(function () {
cy.visit('https://example.cypress.io/commands/actions');
});

// https://on.cypress.io/interacting-with-elements

it('should use cypress.json', function () {
expect(Cypress.env('foo')).to.equal('bar');
it('.type() - type into a DOM element', function () {
// https://on.cypress.io/type
cy.get('.action-email')
.type('fake@email.com').should('have.value', 'fake@email.com');
});
});
4 changes: 3 additions & 1 deletion tests/config-tests/sauce-runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"cypress": {
"configFile": "cypress.config.js"
},
"rootDir": "./",
"suites": [
{
"name": "default",
"browser": "chrome",
"browserVersion": "",
"headless": true,
"config": {
"specPattern": [
"**/*.*"
"**/config.cy.js"
]
}
}
Expand Down

0 comments on commit f10a44b

Please sign in to comment.