Skip to content

Commit aa558a1

Browse files
committed
fix osc test - $ not defined app error
1 parent 6261ab0 commit aa558a1

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

cypress/support/index.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,33 @@ import './commands'
1818
import './phoenix_commands'
1919

2020
// Alternatively you can use CommonJS syntax:
21-
// require('./commands')
21+
// require('./commands')
22+
23+
/**
24+
* ****************************************************************************
25+
* *********************** custom code for ocCommerce *************************
26+
* ****************************************************************************
27+
*
28+
* We need this because a third-party JS code has not been loaded correctly,
29+
* so errors are blocking the testing process.
30+
*
31+
* We want to get over some errors, not all of them.
32+
*/
33+
Cypress.on('uncaught:exception', (err, runnable) => {
34+
/**
35+
* we expect a 3rd party library error with message 'google is not defined'
36+
* and don't want to fail the test so we return false
37+
*
38+
*/
39+
if (err.message.includes('$ is not defined')) {
40+
return false
41+
}
42+
/** if other libraries don't load, we skip these errors. */
43+
// if (err.message.includes('Cannot read properties')) {
44+
// return false
45+
// }
46+
/**
47+
* we still want to ensure there are no other unexpected
48+
* errors, so we let them fail the test
49+
*/
50+
});

0 commit comments

Comments
 (0)