-
Notifications
You must be signed in to change notification settings - Fork 448
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
chore: use playwright for e2e tests #3145
Conversation
This pull request is being automatically deployed with Vercel (learn more). studio-workshop – ./dev/workshop🔍 Inspect: https://vercel.com/sanity-io/studio-workshop/4adC3cSrYmahoVq9UTUfCzovJiL8 test-studio – ./🔍 Inspect: https://vercel.com/sanity-io/test-studio/9QXa2G8zLQNvC116N6wSNhDmTuQr perf-studio – ./🔍 Inspect: https://vercel.com/sanity-io/perf-studio/2ftRdz6BNhoMhAmRPzgVedKVaJJe |
await Promise.all([ | ||
page.goto('test/desk/'), | ||
page.locator('data-testid=default-layout-global-create-button').click(), | ||
page.locator('data-testid=create-document-item-book-by-author').click(), | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the recommended way of doing this in playwright? I feel like all of these depend on eachother and that a sequence of await
would read better - but maybe this is slightly faster?
playwright/helpers/sanityClient.ts
Outdated
export async function deleteDocument(payload) { | ||
return testSanityClient.delete(payload) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we can just as well use testSanityClient.delete()
directly to get more control of the operation (second argument, for instance), or have this function do something more specific, eg function deleteDocumentsForRun(typeName: string)
, which could generate a GROQ query with the correct type name and run ID. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that, a more specific one! Will add
e67008e
to
fe2306d
Compare
2329225
to
7eb6574
Compare
Closing this as #4143 has now landed, but will leave the branch around in case we might need it. |
Description
What to review
Notes for release