You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// auto can query data
// In this case, the result is plain-text contents of the header
const headerText = await auto(
"get the header text",
{ page, test },
);
// auto can perform actions
// In this case, auto will find and fill in the search text input
await auto( type "${headerText}" in the search box,
{ page, test },
);
// auto can assert the state of the website
// In this case, the result is a boolean outcome
const searchInputHasHeaderText = await auto( is the contents of the search box equal to "${headerText}"?,
{ page, test },
);
expect(searchInputHasHeaderText).toBe(true);
});
ERROR:
TypeError: Cannot read properties of undefined (reading 'defaults')
at sanitizeHtml (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/sanitizeHtml.js:23:46)
at getSnapshot (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/getSnapshot.js:7:46)
at runTask (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/auto.js:37:19)
at auto-playwright/node_modules/auto-playwright/dist/auto.js:17:24
at auto-playwright/tests/ttt.spec.ts:9:22
The text was updated successfully, but these errors were encountered:
My code :
import { expect, test } from "@playwright/test";
import { auto } from "auto-playwright";
test("executes query, action and assertion", async ({ page }) => {
await page.goto("/");
//
auto
can query data// In this case, the result is plain-text contents of the header
const headerText = await auto(
"get the header text",
{ page, test },
);
//
auto
can perform actions// In this case, auto will find and fill in the search text input
await auto(
type "${headerText}" in the search box
,{ page, test },
);
//
auto
can assert the state of the website// In this case, the result is a boolean outcome
const searchInputHasHeaderText = await auto(
is the contents of the search box equal to "${headerText}"?
,{ page, test },
);
expect(searchInputHasHeaderText).toBe(true);
});
ERROR:
TypeError: Cannot read properties of undefined (reading 'defaults')
at sanitizeHtml (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/sanitizeHtml.js:23:46)
at getSnapshot (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/getSnapshot.js:7:46)
at runTask (/Users/jiangjiangbing/Documents/AutoPlaywright/auto-playwright/node_modules/auto-playwright/dist/auto.js:37:19)
at auto-playwright/node_modules/auto-playwright/dist/auto.js:17:24
at auto-playwright/tests/ttt.spec.ts:9:22
The text was updated successfully, but these errors were encountered: