Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/playwright/src/smartui.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ async function smartuiSnapshot(page, snapshotName, options) {
}), {});

// Post the DOM to the snapshot endpoint with snapshot options and other info
await utils.postSnapshot({
let { body } = await utils.postSnapshot({
dom,
url: page.url(),
name: snapshotName,
options
}, pkgName);

log.info(`Snapshot captured: ${snapshotName}`);

if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
} catch (err) {
throw err;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/puppeteer/src/smartui.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ async function smartuiSnapshot(page, name, options = {}) {


// Post it to the SmartUI server.
await utils.postSnapshot({
let { body } = await utils.postSnapshot({
dom,
url,
name,
options
}, pkgName);

log.info(`Snapshot captured: ${name}`);

if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
} catch (error) {
throw new Error(error);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/testcafe/src/smartui.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ async function smartuiSnapshot(t, snapshotName, options) {
url: window.location.href || document.URL,
}), { boundTestRun: t, dependencies: {} });

await utils.postSnapshot({
let { body } = await utils.postSnapshot({
dom: dom,
url,
name: snapshotName,
options
}, pkgName);

log.info(`Snapshot captured: ${snapshotName}`);

if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
} catch (error) {
// Handle errors
throw error;
Expand Down