Skip to content

Commit

Permalink
Merge branch 'master' into 8412-death-report-e2e-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dianabarsan committed Jul 30, 2023
2 parents 42ade33 + b8519be commit 0005e27
Show file tree
Hide file tree
Showing 13 changed files with 498 additions and 409 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,27 @@ jobs:

tests:
needs: build
name: ${{ matrix.grunt-cmd }}
name: ${{ matrix.grunt-cmd }}-${{ matrix.suite ||'' }}
runs-on: ubuntu-22.04
env:
NODE: 16.x

strategy:
fail-fast: false
matrix:
grunt-cmd: ['ci-webdriver-default', 'ci-webdriver-standard', 'ci-e2e-integration', 'ci-webdriver-default-mobile']
grunt-cmd: ['ci-webdriver-standard', 'ci-e2e-integration', 'ci-webdriver-default-mobile']
suite: [all]
include:
- grunt-cmd: ci-webdriver-default
suite: core
- grunt-cmd: ci-webdriver-default
suite: data
- grunt-cmd: ci-webdriver-default
suite: enketo
- grunt-cmd: ci-webdriver-default
suite: lowLevel
- grunt-cmd: ci-webdriver-default
suite: workflows

steps:
- name: Login to Docker Hub
Expand Down Expand Up @@ -159,9 +171,10 @@ jobs:
- name: Copy allure history
run: |
mkdir -p allure-results/history
cp -r build-history-data/cht-core/allure/${{ matrix.grunt-cmd }}/allure-report/history allure-results | true
- name: Run tests
run: node --stack_size=10000 `which grunt` ${{ matrix.grunt-cmd }}
cp -r build-history-data/cht-core/allure/${{ matrix.grunt-cmd }}-${{ matrix.suite}}/allure-report/history allure-results | true
- name: Run tests ${{ matrix.grunt-cmd }}-${{ matrix.suite}}
run: node --stack_size=10000 `which grunt` "${{ matrix.grunt-cmd }}" --suite=${{ matrix.suite}}

- name: Fetch allure history
if: always()
uses: actions/checkout@v3
Expand All @@ -172,8 +185,8 @@ jobs:
- name: Copy new allure history
if: always()
run: |
mkdir -p build-history-data-new/cht-core/allure/${{ matrix.grunt-cmd }}/history
cp -r allure-report/history build-history-data-new/cht-core/allure/${{ matrix.grunt-cmd }}/allure-report | true
mkdir -p build-history-data-new/cht-core/allure/${{ matrix.grunt-cmd }}-${{ matrix.suite }}/history
cp -r allure-report/history build-history-data-new/cht-core/allure/${{ matrix.grunt-cmd }}-${{ matrix.suite }}allure-report | true
- name: Upload allure report history
if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master
uses: actions-js/push@master
Expand All @@ -192,8 +205,8 @@ jobs:
- name: Copy new report
if: always()
run: |
mkdir -p build-history/cht-core/allure/${{ matrix.grunt-cmd }}
cp -r allure-report build-history/cht-core/allure/${{ matrix.grunt-cmd }} | true
mkdir -p build-history/cht-core/allure/${{ matrix.grunt-cmd }}-${{ matrix.suite }}
cp -r allure-report build-history/cht-core/allure/${{ matrix.grunt-cmd }}-${{ matrix.suite }} | true
- name: Upload allure report
if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master
uses: actions-js/push@master
Expand All @@ -205,7 +218,7 @@ jobs:
- name: Archive Results
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.grunt-cmd }}
name: ${{ matrix.grunt-cmd }}-${{ matrix.suite || ''}}
path: |
allure-results
allure-report
Expand All @@ -214,7 +227,7 @@ jobs:
if: ${{ failure() }}

publish:
needs: [tests,config-tests]
needs: [tests, config-tests]
name: Publish branch build
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ module.exports = function(grunt) {
},
'wdio-run-default': {
cmd: [
'npm run wdio'
'npm run wdio -- --suite=' + grunt.option('suite')
].join(' && '),
stdio: 'inherit', // enable colors!
},
'wdio-run-standard': {
cmd: [
'npm run standard-wdio'
'npm run standard-wdio -- --suite=' + grunt.option('suite')
].join(' && '),
stdio: 'inherit', // enable colors!
},
'wdio-run-default-mobile': {
cmd: [
'npm run default-wdio-mobile'
'npm run default-wdio-mobile -- --suite=' + grunt.option('suite')
].join(' && '),
stdio: 'inherit', // enable colors!
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
],
"scripts": {
"test": "grunt eslint && grunt unit && grunt test-api-integration",
"wdio-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/default/wdio.conf.js",
"standard-wdio-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/standard/wdio.conf.js",
"default-wdio-mobile-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/default-mobile/wdio.conf.js",
"e2e-integration-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup &&mocha --config tests/integration/.mocharc.js ",
"wdio-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/default/wdio.conf.js --suite=all",
"standard-wdio-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/standard/wdio.conf.js --suite=all",
"default-wdio-mobile-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup && wdio run ./tests/e2e/default-mobile/wdio.conf.js --suite=all",
"e2e-integration": "mocha --config tests/integration/.mocharc.js ",
"e2e-integration-local": "export VERSION=$(node ./scripts/build/get-version.js) && grunt e2e-env-setup &&mocha --config tests/integration/.mocharc.js ",
"wdio": "wdio run ./tests/e2e/default/wdio.conf.js",
"upgrade-wdio": "wdio run ./tests/e2e/upgrade/wdio.conf.js",
"standard-wdio": "wdio run ./tests/e2e/standard/wdio.conf.js",
Expand Down
2 changes: 1 addition & 1 deletion tests/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ module.exports = {
DOWNLOAD_DIRECTORY: 'tempDownload',

USERNAME,
PASSWORD
PASSWORD,
};
19 changes: 10 additions & 9 deletions tests/e2e/default-mobile/wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
const wdioBaseConfig = require('../default/wdio.conf');
const wdioBaseConfig = require('../wdio.conf');

const chai = require('chai');
chai.use(require('chai-exclude'));

// Override specific properties from wdio base config
exports.config = Object.assign(wdioBaseConfig.config, {
specs: [
'**/*.wdio-spec.js',
[
'../default/login/login-logout.wdio-spec.js',
'../default/navigation/navigation.wdio-spec.js',
'../default/navigation/hamburger-menu.wdio-spec.js',
],
],
suites: {
all: [
'./**/*.wdio-spec.js',
[
'../default/login/login-logout.wdio-spec.js',
'../default/navigation/navigation.wdio-spec.js',
'../default/navigation/hamburger-menu.wdio-spec.js',
],
]},
beforeSuite: async () => {
// We tried the browser.emulateDevice('...') function but it's not stable enough,
// it looses the mobile view and switches back to desktop
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/default/purge/purge.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ const runPurging = async () => {
await utils.delayPromise(1000); // API has to pick up on purging completing
};

describe('purge', () => {
describe('purge', function() {
this.timeout(2 * 120000); //sometimes test takes a little longer than original timeout

afterEach(async () => {
await utils.deleteUsers([user]);
await utils.revertDb([/^form:/], true);
Expand Down
35 changes: 35 additions & 0 deletions tests/e2e/default/suites.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const SUITES = {
core: [
'./admin/**/*.wdio-spec.js',
'./login/**/*.wdio-spec.js',
'./translations/**/*.wdio-spec.js',
'./more-options-menu/**/*.wdio-spec.js',
'./users/**/*.wdio-spec.js',
'./about/**/*.wdio-spec.js',
'./navigation/**/*.wdio-spec.js',
'./privacy-policy/**/*.wdio-spec.js',
],
workflows: [
'./analytics/**/*.wdio-spec.js',
'./contacts/**/*.wdio-spec.js',
'./reports/**/*.wdio-spec.js',
'./targets/**/*.wdio-spec.js',
'./tasks/**/*.wdio-spec.js',
'./sms/**/*.wdio-spec.js',
],
data:[
'./db/**/*.wdio-spec.js',
'./purge/**/*.wdio-spec.js',
'./telemetry/**/*.wdio-spec.js'
],
lowLevel:[
'./pwa/**/*.wdio-spec.js',
'./service-worker/**/*.wdio-spec.js',
'./transitions/**/*.wdio-spec.js'
],
enketo: [
'./enketo/**/*.wdio-spec.js',
]};

exports.suites = SUITES;

Loading

0 comments on commit 0005e27

Please sign in to comment.