@lambdatest/cypress-driver 1.0.8 → 1.0.9-beta.1
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 +3 -6
- package/src/utils/httpClient.js +0 -1
- package/src/utils/logger.js +0 -10
package/package.json
CHANGED
package/src/smartui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
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,10 +9,8 @@ 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
|
-
|
|
13
|
-
|
|
14
|
-
snapshot: name,
|
|
15
|
-
});
|
|
12
|
+
cy.task('log', log('info', 'SmartUI snapshot skipped in interactive mode; use "cypress run" instead of "cypress open"'));
|
|
13
|
+
return;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
let resp = await client.isSmartUIRunning()
|
|
@@ -34,7 +32,6 @@ function smartuiSnapshot(name, options = {}) {
|
|
|
34
32
|
if (resp.body.data.warnings.length) {
|
|
35
33
|
resp.body.data.warnings.map(e => cy.task('log', log('warn', e)));
|
|
36
34
|
}
|
|
37
|
-
cylog('smartuiSnapshot', `Snapshot captured: ${name}`);
|
|
38
35
|
cy.task('log', log('info', `Snapshot captured: ${name}`));
|
|
39
36
|
} else {
|
|
40
37
|
throw new Error(resp.body.error.message);
|
package/src/utils/httpClient.js
CHANGED
package/src/utils/logger.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const pkgName = require('../../package.json').name;
|
|
3
3
|
|
|
4
|
-
function cylog(name, message, meta = {}) {
|
|
5
|
-
return Cypress.log({
|
|
6
|
-
name,
|
|
7
|
-
message,
|
|
8
|
-
displayName: pkgName,
|
|
9
|
-
consoleProps: () => meta
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
4
|
function log(level, message) {
|
|
14
5
|
if (typeof message === 'object') {
|
|
15
6
|
message = JSON.stringify(message);
|
|
@@ -29,6 +20,5 @@ function log(level, message) {
|
|
|
29
20
|
}
|
|
30
21
|
|
|
31
22
|
module.exports = {
|
|
32
|
-
cylog,
|
|
33
23
|
log
|
|
34
24
|
}
|