itemengine-cypress-automation 1.0.242-saveAsYouGoChanges-98cd8cd.0 → 1.0.243-addedConsoleErrorsScript-2ce0702.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,9 +5,20 @@ import './helpers/cypressUtilities';
5
5
  import './helpers/accessibility';
6
6
  import './helpers/selectText';
7
7
 
8
- Cypress.on('uncaught:exception', () => {
9
- return false
10
- });
8
+ let windowConsoleError;
9
+
10
+ if (Cypress.env('consoleErrors')) {
11
+ Cypress.on('window:before:load', (win) => {
12
+ windowConsoleError = cy.spy(win.console, 'error');
13
+ })
14
+ afterEach(() => {
15
+ expect(windowConsoleError).to.not.be.called;
16
+ })
17
+ } else {
18
+ Cypress.on('uncaught:exception', () => {
19
+ return false
20
+ });
21
+ }
11
22
 
12
23
  const registerCypressGrep = require('@cypress/grep')
13
24
  registerCypressGrep()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.242-saveAsYouGoChanges-98cd8cd.0",
3
+ "version": "1.0.243-addedConsoleErrorsScript-2ce0702.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -45,6 +45,7 @@ function setCommandLineEnvArgs() {
45
45
  let theme = envArgs.theme ? `theme=${envArgs.theme}` : '';
46
46
  let tags;
47
47
  let fileConfig;
48
+ //let consoleErrors = envArgs.consoleErrors ? `consoleErrors=${envArgs.consoleErrors}` : '';
48
49
 
49
50
  if (env === 'dev') {
50
51
  fileConfig = 'fileConfig=ildev'
@@ -67,6 +68,7 @@ function setCommandLineEnvArgs() {
67
68
  }
68
69
 
69
70
  return `--env ${fileConfig}` + (theme ? `,${theme}` : '') + (tags ? `,${tags}` : '')
71
+ //return `--env ${fileConfig}` + (theme ? `,${theme}` : '') + (tags ? `,${tags}` : '') + (consoleErrors ? `,${consoleErrors}` : '')
70
72
  }
71
73
 
72
74
  /**
@@ -118,7 +120,7 @@ export function runSorryCypressSpinnakerSmoke() {
118
120
  startTime = process.env.START_TIME;
119
121
  ciBuildId = setCiBuildId("spinnaker", startTime);
120
122
  const envArgs = setCommandLineEnvArgs()
121
- let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs} --spec "cypress/e2e/ILC/**/*.smoke.js"`;
123
+ let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs},consoleErrors=true --spec "cypress/e2e/ILC/**/*.smoke.js"`;
122
124
  console.log(`command: ${command}`);
123
125
  execSync(command, { stdio: "inherit" });
124
126
  }