@lambdatest/cypress-driver 1.0.9-beta.1 → 1.0.9-beta.3
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.
- package/package.json +1 -1
- package/src/smartui.js +10 -8
- package/src/utils/logger.js +0 -20
- package/src/utils/utils.js +1 -1
package/package.json
CHANGED
package/src/smartui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { log } = require('./utils/logger');
|
|
1
|
+
// const { log } = require('./utils/logger');
|
|
2
2
|
const client = require('./utils/httpClient');
|
|
3
3
|
const testType = 'cypress-driver';
|
|
4
4
|
const CY_TIMEOUT = 30 * 1000 * 1.5;
|
|
@@ -9,7 +9,7 @@ function smartuiSnapshot(name, options = {}) {
|
|
|
9
9
|
|
|
10
10
|
return cy.then({ timeout: CY_TIMEOUT }, async () => {
|
|
11
11
|
if (Cypress.config('isInteractive') && !Cypress.config('enableSmartUIInteractiveMode')) {
|
|
12
|
-
cy.task('log', log('info', 'SmartUI snapshot skipped in interactive mode; use "cypress run" instead of "cypress open"'));
|
|
12
|
+
// cy.task('log', log('info', 'SmartUI snapshot skipped in interactive mode; use "cypress run" instead of "cypress open"'));
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -29,16 +29,18 @@ function smartuiSnapshot(name, options = {}) {
|
|
|
29
29
|
options
|
|
30
30
|
}, testType).then(resp => {
|
|
31
31
|
if (resp.status >= 200 && resp.status < 300) {
|
|
32
|
-
if (resp.body.data.warnings.length) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
// if (resp.body.data.warnings.length) {
|
|
33
|
+
// resp.body.data.warnings.map(
|
|
34
|
+
// // cy.task('log', log('warn', e))
|
|
35
|
+
// );
|
|
36
|
+
// }
|
|
37
|
+
// cy.task('log', log('info', `Snapshot captured: ${name}`));
|
|
36
38
|
} else {
|
|
37
39
|
throw new Error(resp.body.error.message);
|
|
38
40
|
}
|
|
39
41
|
}).catch(error => {
|
|
40
|
-
cy.task('log', log('error', `SmartUI snapshot failed "${name}"`));
|
|
41
|
-
cy.task('log', log('error', error.message));
|
|
42
|
+
// cy.task('log', log('error', `SmartUI snapshot failed "${name}"`));
|
|
43
|
+
// cy.task('log', log('error', error.message));
|
|
42
44
|
});
|
|
43
45
|
});
|
|
44
46
|
});
|
package/src/utils/logger.js
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const pkgName = require('../../package.json').name;
|
|
3
3
|
|
|
4
|
-
function log(level, message) {
|
|
5
|
-
if (typeof message === 'object') {
|
|
6
|
-
message = JSON.stringify(message);
|
|
7
|
-
}
|
|
8
|
-
switch (level) {
|
|
9
|
-
case 'debug':
|
|
10
|
-
message = chalk.blue(message);
|
|
11
|
-
break;
|
|
12
|
-
case 'warn':
|
|
13
|
-
message = chalk.yellow(`Warning: ${message}`);
|
|
14
|
-
break;
|
|
15
|
-
case 'error':
|
|
16
|
-
message = chalk.red(`Error: ${message}`);
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
return `[${pkgName}] ${message}`;
|
|
20
|
-
}
|
|
21
4
|
|
|
22
|
-
module.exports = {
|
|
23
|
-
log
|
|
24
|
-
}
|
package/src/utils/utils.js
CHANGED