Skip to content

Commit

Permalink
Merge pull request #57 from DEFRA/workflow-refinement
Browse files Browse the repository at this point in the history
Separate bstack run
  • Loading branch information
hughfdjackson authored Dec 9, 2024
2 parents da74219 + 3b24368 commit 9bcc036
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 84 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Start docker compose
run: |
docker compose up --wait-timeout 300 -d --quiet-pull
- name: Journey tests
- name: Browserstack initial tests
run: |
npm run user-journey-test
npm run user-journey-test:bs
- name: cleanup
if: always()
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run-tests-browserstack.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Browserstack tests

on:
workflow_dispatch:
push:
branches:
- main
workflow_run:
workflows: [ "Publish" ]
types:
- completed

env:
AWS_REGION: eu-west-2
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Browserstack tests
run: |
npm ci
npm run user-journey-test:bs
npm run user-journey-test:bs-extended
env:
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"user-journey-test": "npm run user-journey-test:js && npm run user-journey-test:nojs",
"user-journey-test:js": "wdio run ./user-journey-tests/wdioJS.conf.js",
"user-journey-test:nojs": "wdio run ./user-journey-tests/wdioNoJS.conf.js",
"user-journey-test:bs": "wdio run ./user-journey-tests/wdio.browserstack.conf.js"
"user-journey-test:bs": "wdio run ./user-journey-tests/wdio.browserstack.conf.js",
"user-journey-test:bs-extended": "wdio run ./user-journey-tests/wdio.browserstack.extended.conf.js"
},
"author": "Defra DDTS",
"license": "OGL-UK-3.0",
Expand Down
75 changes: 1 addition & 74 deletions user-journey-tests/wdio.browserstack.conf.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import merge from 'deepmerge'
import { config as wdioConf } from './wdio.conf.js'

// These capabilites should run as part of the publish yaml as an initial check before publishing
export const config = merge(wdioConf, {
specs: ['./specs/**/*.js'],
exclude: ['./specs/noJavascript/**/*.spec.js'],
user: process.env.BROWSERSTACK_USER,
key: process.env.BROWSERSTACK_KEY,
maxInstances: 7,
capabilities: [
{
browserName: 'Chrome',
'bstack:options': {
browserVersion: 'latest',
os: 'Windows',
osVersion: '10',
sessionName: 'windows-chrome'
}
},
{
browserName: 'Edge',
'bstack:options': {
Expand All @@ -26,15 +18,6 @@ export const config = merge(wdioConf, {
sessionName: 'windows-edge'
}
},
{
browserName: 'Firefox',
'bstack:options': {
browserVersion: 'latest',
os: 'Windows',
osVersion: '10',
sessionName: 'windows-firefox'
}
},
{
browserName: 'Safari',
'bstack:options': {
Expand All @@ -43,63 +26,7 @@ export const config = merge(wdioConf, {
osVersion: 'Monterey',
sessionName: 'osx-safari'
}
},
{
browserName: 'Chrome',
'bstack:options': {
browserVersion: 'latest',
os: 'OS X',
osVersion: 'Monterey',
sessionName: 'osx-chrome'
}
},
{
browserName: 'Firefox',
'bstack:options': {
browserVersion: 'latest',
os: 'OS X',
osVersion: 'Monterey',
sessionName: 'osx-firefox'
}
}
// {
// browserName: 'Safari',
// 'bstack:options': {
// os: 'iOS',
// osVersion: '15.6',
// deviceName: 'iPhone 13',
// realMobile: true,
// sessionName: 'ios-safari'
// }
// },
// {
// browserName: 'Chrome',
// 'bstack:options': {
// os: 'iOS',
// osVersion: '15.6',
// deviceName: 'iPhone 13',
// realMobile: true,
// sessionName: 'ios-chrome'
// }
// }
// {
// browserName: 'Chrome',
// 'bstack:options': {
// os: 'Android',
// osVersion: '12.0',
// deviceName: 'Samsung Galaxy S21',
// realMobile: true
// }
// },
// {
// browserName: 'Samsung Internet',
// 'bstack:options': {
// os: 'Android',
// osVersion: '12.0',
// deviceName: 'Samsung Galaxy S21',
// realMobile: true
// }
// }
],
services: [
[
Expand Down
83 changes: 83 additions & 0 deletions user-journey-tests/wdio.browserstack.extended.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { config as browserstackBaseConfig } from './wdio.browserstack.conf.js'

// These capabilities should run as an extended test after publishing
export const config = {
...browserstackBaseConfig,
maxInstances: 7,
capabilities: [
{
browserName: 'Chrome',
'bstack:options': {
browserVersion: 'latest',
os: 'Windows',
osVersion: '10',
sessionName: 'windows-chrome'
}
},
{
browserName: 'Firefox',
'bstack:options': {
browserVersion: 'latest',
os: 'Windows',
osVersion: '10',
sessionName: 'windows-firefox'
}
},
{
browserName: 'Chrome',
'bstack:options': {
browserVersion: 'latest',
os: 'OS X',
osVersion: 'Monterey',
sessionName: 'osx-chrome'
}
},
{
browserName: 'Firefox',
'bstack:options': {
browserVersion: 'latest',
os: 'OS X',
osVersion: 'Monterey',
sessionName: 'osx-firefox'
}
},
{
browserName: 'Safari',
'bstack:options': {
os: 'iOS',
osVersion: '15.6',
deviceName: 'iPhone 13',
realMobile: true,
sessionName: 'ios-safari'
}
},
{
browserName: 'Chrome',
'bstack:options': {
os: 'iOS',
osVersion: '15.6',
deviceName: 'iPhone 13',
realMobile: true,
sessionName: 'ios-chrome'
}
}
// {
// browserName: 'Chrome',
// 'bstack:options': {
// os: 'Android',
// osVersion: '12.0',
// deviceName: 'Samsung Galaxy S21',
// realMobile: true
// }
// },
// {
// browserName: 'Samsung Internet',
// 'bstack:options': {
// os: 'Android',
// osVersion: '12.0',
// deviceName: 'Samsung Galaxy S21',
// realMobile: true
// }
// }
]
}
1 change: 0 additions & 1 deletion user-journey-tests/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const config = {
// and 30 processes will get spawned. The property handles how many capabilities
// from the same test should run tests.
//
maxInstances: debug ? 1 : 3,
//
// If you have trouble getting all important capabilities together, check out the
// Sauce Labs platform configurator - a great tool to configure your capabilities:
Expand Down
1 change: 1 addition & 0 deletions user-journey-tests/wdioJS.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { config as wdioConf } from './wdio.conf.js'
export const config = merge(wdioConf, {
specs: ['./specs/**/*.js'],
exclude: ['./specs/noJavascript/**/*.js'],
maxInstances: 3,
capabilities: [
{
browserName: 'chrome',
Expand Down
1 change: 1 addition & 0 deletions user-journey-tests/wdioNoJS.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { config as wdioConf } from './wdio.conf.js'

export const config = merge(wdioConf, {
specs: ['./specs/noJavascript/**/*.js'],
maxInstances: 3,
capabilities: [
{
browserName: 'chrome',
Expand Down

0 comments on commit 9bcc036

Please sign in to comment.