Skip to content

Commit 6c84682

Browse files
authored
Merge pull request #20 from Shahnawaz-Sk/stage
warnings
2 parents 8da9aa5 + 70661f8 commit 6c84682

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/playwright/src/smartui.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ async function smartuiSnapshot(page, snapshotName, options) {
2222
}), {});
2323

2424
// Post the DOM to the snapshot endpoint with snapshot options and other info
25-
await utils.postSnapshot({
25+
let { body } = await utils.postSnapshot({
2626
dom,
2727
url: page.url(),
2828
name: snapshotName,
2929
options
3030
}, pkgName);
3131

3232
log.info(`Snapshot captured: ${snapshotName}`);
33+
34+
if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
3335
} catch (err) {
3436
throw err;
3537
}

packages/puppeteer/src/smartui.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ async function smartuiSnapshot(page, name, options = {}) {
2424

2525

2626
// Post it to the SmartUI server.
27-
await utils.postSnapshot({
27+
let { body } = await utils.postSnapshot({
2828
dom,
2929
url,
3030
name,
3131
options
3232
}, pkgName);
3333

3434
log.info(`Snapshot captured: ${name}`);
35+
36+
if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
3537
} catch (error) {
3638
throw new Error(error);
3739
}

packages/testcafe/src/smartui.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ async function smartuiSnapshot(t, snapshotName, options) {
2323
url: window.location.href || document.URL,
2424
}), { boundTestRun: t, dependencies: {} });
2525

26-
await utils.postSnapshot({
26+
let { body } = await utils.postSnapshot({
2727
dom: dom,
2828
url,
2929
name: snapshotName,
3030
options
3131
}, pkgName);
3232

3333
log.info(`Snapshot captured: ${snapshotName}`);
34+
35+
if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
3436
} catch (error) {
3537
// Handle errors
3638
throw error;

0 commit comments

Comments
 (0)