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

chore: use playwright for e2e tests #3145

Closed
wants to merge 3 commits into from

Conversation

vicmeow
Copy link
Contributor

@vicmeow vicmeow commented Feb 10, 2022

Description

What to review

Notes for release

@vercel
Copy link

vercel bot commented Feb 10, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

studio-workshop – ./dev/workshop

🔍 Inspect: https://vercel.com/sanity-io/studio-workshop/4adC3cSrYmahoVq9UTUfCzovJiL8
✅ Preview: https://studio-workshop-git-chore-sc-13478improve-test-coverage.sanity.build

test-studio – ./

🔍 Inspect: https://vercel.com/sanity-io/test-studio/9QXa2G8zLQNvC116N6wSNhDmTuQr
✅ Preview: https://test-studio-git-chore-sc-13478improve-test-coverage.sanity.build

perf-studio – ./

🔍 Inspect: https://vercel.com/sanity-io/perf-studio/2ftRdz6BNhoMhAmRPzgVedKVaJJe
✅ Preview: https://perf-studio-git-chore-sc-13478improve-test-coverage.sanity.build

playwright.config.ts Outdated Show resolved Hide resolved
playwright/global-setup.ts Outdated Show resolved Hide resolved
playwright/global-setup.ts Outdated Show resolved Hide resolved
playwright/global-setup.ts Outdated Show resolved Hide resolved
Comment on lines +5 to +9
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(),
])
Copy link
Member

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/createUniqueDocument.ts Show resolved Hide resolved
Comment on lines 11 to 21
export async function deleteDocument(payload) {
return testSanityClient.delete(payload)
}
Copy link
Member

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?

Copy link
Contributor Author

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

playwright/tests/desk-tool/documentActions.spec.ts Outdated Show resolved Hide resolved
playwright/tests/desk-tool/documentActions.spec.ts Outdated Show resolved Hide resolved
playwright/tests/desk-tool/documentActions.spec.ts Outdated Show resolved Hide resolved
@rexxars
Copy link
Member

rexxars commented Feb 8, 2023

Closing this as #4143 has now landed, but will leave the branch around in case we might need it.

@rexxars rexxars closed this Feb 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants