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

[🐛 Bug]: Metamask fixture can't be used on beforeAll because of using 'page' and 'context' #1258

Open
3 of 4 tasks
Mouse-Coach opened this issue Feb 6, 2025 · 0 comments
Labels
bug 🐛 Something isn't working needs triaging ⏳

Comments

@Mouse-Coach
Copy link

🔎 Have you searched existing issues to avoid duplicates?

  • I have made sure that my issue is not a duplicate.

🧪 Have you tested your code using latest version of Synpress?

💡 Are you able to provide enough information to be able to reproduce your issue locally?

  • I can provide enough details to reproduce my issue on local environment.

Synpress version

4.0.3

Node.js version

18.20.0

Operating system

macOS Monterey 12.4

Run mode

Playwright + Synpress (as plugin)

CI platform (if applicable)

GitHub Actions (It reproduces locally as well)

Are you running your tests inside docker? (if applicable)

  • This issue could be related to docker.

What happened?

The 'metamask' fixture can't be used on 'beforeAll' hook because it uses 'page' and 'context'. If the fixture is implemented myself, it will fail too because of 'extensionId' and 'context' fixtures - they also use context. It happens because the Playwright prohibits using them on the beforeAll level because it is created automatically on the beforeEach level - to create an isolated context for each test.

What is your expected behavior?

To give an opportunity to create a browser context ourselves to manage it there. I see that as an opportunity to do an implementation of your default 'context' fixture in the separate function/s (to remove it from fixtures that can block the hooks usages), it allows to await chromium.launchPersistentContext wherever you want.

How to reproduce the bug.

Use the 'metamask' fixture on the 'beforeAll' hook.

Relevant log output

@Mouse-Coach Mouse-Coach added bug 🐛 Something isn't working needs triaging ⏳ labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working needs triaging ⏳
Projects
None yet
Development

No branches or pull requests

1 participant