Skip to content

Commit

Permalink
[DEVX-1323] CI: Test using sauce-connect (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel authored Nov 2, 2021
1 parent 01a2d2d commit 351abaf
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,40 @@ jobs:
working-directory: ./tests/kitchen-sink-tests
run: |
npx saucectl run --config .sauce/config_on_sauce.yml --runner-version "url: https://storage.googleapis.com/${{ secrets.GCS_RUNNER_BUCKET }}/sauce-cypress-runner-${{ github.run_id }}.zip"
run-bundle-with-sauce-connect:
runs-on: ubuntu-latest
needs: [build-windows-bundle-and-test]
steps:
- name: Checkout runner
uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.x'

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

- name: Install saucectl
run: npm install -g saucectl

- name: Run web-page
run: |
python -m http.server 8000 &
working-directory: ./tests/sauce-connect/www/

- name: Start sauce-connect
uses: saucelabs/sauce-connect-action@v2.0.0
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: github-cypress-sc-check-tunnel
scVersion: 4.7.1

- name: run saucectl
run: |
saucectl run --config .sauce/config.yml --runner-version "url: https://storage.googleapis.com/${{ secrets.GCS_RUNNER_BUCKET }}/sauce-cypress-runner-${{ github.run_id }}.zip"
working-directory: ./tests/sauce-connect/
21 changes: 21 additions & 0 deletions tests/sauce-connect/.sauce/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1alpha
kind: cypress
sauce:
metadata:
tags:
- sauce-connect
build: Pre-Release sauce-connect test
region: us-west-1
tunnel:
name: github-cypress-sc-check-tunnel
defaults:
mode: sauce
cypress:
configFile: cypress.json
version: 8.6.0

suites:
- name: "kitchen-sink on Sauce"
browser: "chrome"
config:
testFiles: [ "*.*" ]
2 changes: 2 additions & 0 deletions tests/sauce-connect/.sauceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
www
node_modules
1 change: 1 addition & 0 deletions tests/sauce-connect/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 9 additions & 0 deletions tests/sauce-connect/cypress/integration/sauce-connect.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
context('Sauce-Connect', function () {
beforeEach(function () {
cy.visit('http://127.0.0.1:8000/');
});

it('sc connection working', function () {
cy.title().should('eq', 'Simple Page');
});
});
16 changes: 16 additions & 0 deletions tests/sauce-connect/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple Page</title>
</head>
<body>
<div class="main-content">
<header>
<h1>Example</h1>
<p>This webpage is used as a sample.</p>
</header>
</div>
</body>
</html>

0 comments on commit 351abaf

Please sign in to comment.