Skip to content

Commit

Permalink
Merge pull request #2 from testspace-com/update-packages
Browse files Browse the repository at this point in the history
Update packages
  • Loading branch information
munderseth authored Aug 23, 2023
2 parents bd27a6b + da3be13 commit 56098e7
Show file tree
Hide file tree
Showing 9 changed files with 2,324 additions and 1,942 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ npm install --save-dev jest-junit
```
"jest-junit": {
"suiteNameTemplate": "{filepath}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}",
"includeShortConsoleOutput": "true"
"addFileAttribute": "true",
"includeShortConsoleOutput": "true",
"reportTestSuiteErrors": "true"
},
```
15 changes: 8 additions & 7 deletions jest-puppeteer-custom-env.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// custom-environment.js
const PuppeteerEnvironment = require('jest-environment-puppeteer');
const JestPuppeteerEnvironment =
require("jest-environment-puppeteer").TestEnvironment;
const fs = require('fs');

/*
* Configurations
*/
const testDir = './tests'
const testDir = './tests'
// Used for "jest-image-shapshot"
const imageSnapshotsDir = testDir+'/__image_snapshots__';
const imageSnapshotsDiffOutputDir = imageSnapshotsDir+'/__diff_output__';
const imageSnapshotsDir = testDir+'/__image_snapshots__';
const imageSnapshotsDiffOutputDir = imageSnapshotsDir+'/__diff_output__';
// Use for Testspace client publishing
const screenshotsDir = 'screenshots';
const screenshotsListFile = './screenshots-list.txt';
const screenshotsDir = 'screenshots';
const screenshotsListFile = './screenshots-list.txt';

class CustomEnvironment extends PuppeteerEnvironment {
class CustomEnvironment extends JestPuppeteerEnvironment {

async handleTestEvent(event, state) { // eslint-disable-line no-unused-vars

Expand Down
2 changes: 1 addition & 1 deletion jest-puppeteer-custom-global-setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// jest-custom-global-setup.js
const { setup: setupPuppeteer } = require('jest-environment-puppeteer')
const setupPuppeteer = require('jest-environment-puppeteer/setup')

const fs = require('fs');
const screenshotsListFile = './screenshots-list.txt';
Expand Down
4 changes: 3 additions & 1 deletion jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
process.env.PUPPETEER_DISABLE_HEADLESS_WARNING = true;
module.exports = {
launch: {
args: [
'--window-size=1920,1080'
],
headless: process.env.HEADLESS !== 'false',
//slowMo: 300, // represents 300ms
}
},
browserContext: 'incognito' // all tests have a separate, isolated context
}
Loading

0 comments on commit 56098e7

Please sign in to comment.