Skip to content

Commit

Permalink
Merge pull request #3 from ZEISS/ci-tests
Browse files Browse the repository at this point in the history
Ci tests
  • Loading branch information
MariusAquarius authored Sep 29, 2023
2 parents fb7eac4 + 1c46a5a commit ff4cfdc
Show file tree
Hide file tree
Showing 17 changed files with 3,271 additions and 7,273 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build, Unit Test & Deploy

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

# define node version
strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

# setting up node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

# install
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci
# build
- name: Build
run: |
npm run build:prod
# unit tests (single run - headless chrome)
- name: Unit Tests
run: |
npm run test:ci
# deploy recent build and push it to branch 'gh-pages'
# this will trigger the action 'pages build & deployment' to host the recent build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/angular-redux-shop
publish_branch: gh-pages
27 changes: 27 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: E2E Testing

on: deployment

jobs:
test:
runs-on: ubuntu-latest

steps:
# checkout and setup node
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

# install dependencies
- name: Install
run: npm ci

# run wdio test on following url: 'https://zeiss.github.io/angular-styleguide/'
- name: WebdriverIO Test
run: npm run e2e:wdio:ci

# run playwright test on following url: 'https://zeiss.github.io/angular-styleguide/'
- name: Playwright Test
run: npm run e2e:playwright:ci
71 changes: 0 additions & 71 deletions .github/workflows/styleguide-with-test.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/webdriverio-ci.yml

This file was deleted.

16 changes: 4 additions & 12 deletions e2e-wdio/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const config = {
// First, you can define how many instances should be started at the same time. Let's
// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
// files and you set maxInstances to 10, all spec files will get tested at the same time
// files, and you set maxInstances to 10, all spec files will get tested at the same time
// and 30 processes will get spawned. The property handles how many capabilities
// from the same test should run tests.
//
Expand All @@ -62,7 +62,7 @@ export const config = {
maxInstances: 5,
//
browserName: 'chrome',
browserVersion: '110.0',
browserVersion: '117.0',
acceptInsecureCerts: true,
'goog:chromeOptions': {
args: ['--headless', '--disable-gpu', '--window-size:1920,1080'],
Expand Down Expand Up @@ -96,7 +96,7 @@ export const config = {
// '@wdio/applitools-service': 'info'
},
//
// If you only want to run your tests until a specific amount of tests have failed use
// If you only want to run your tests until a specific amount of tests has failed use
// bail (default is 0 - don't bail, run all tests).
bail: 0,
//
Expand All @@ -116,7 +116,6 @@ export const config = {
// Default request retries count
connectionRetryCount: 3,
//
// Test runner services
// Services take over a specific job you don't want to take care of. They enhance
// your test setup with almost no effort. Unlike plugins, they don't add new
// commands. Instead, they hook themselves up into the test process.
Expand All @@ -136,7 +135,7 @@ export const config = {
// Delay in seconds between the spec file retry attempts
// specFileRetriesDelay: 0,
//
// Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
// Whether retried specfiles should be retried immediately or deferred to the end of the queue
// specFileRetriesDeferred: false,
//
// Test reporter for stdout.
Expand All @@ -149,13 +148,6 @@ export const config = {
jasmineOpts: {
// Jasmine default timeout
defaultTimeoutInterval: 60000,
//
// The Jasmine framework allows interception of each assertion in order to log the state of the application
// or website depending on the result. For example, it is pretty handy to take a screenshot every time
// an assertion fails.
expectationResultHandler(passed, assertion) {
// do something
},
},

//
Expand Down
Loading

0 comments on commit ff4cfdc

Please sign in to comment.