Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code error #31

Open
useadmin-jany opened this issue Jun 13, 2024 · 0 comments
Open

Code error #31

useadmin-jany opened this issue Jun 13, 2024 · 0 comments

Comments

@useadmin-jany
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant