Comments (5)
We can also see whether the counter is increasing here: https://github.com/search?q=beforeEach%28async+%28%7B+mount+%7D%29&type=code (43 matches ATM).
Thank you for the link! Looking at the usages, some of them look totally fine to me. Maybe it's not that obvious a decision, and folks should decide for themselves 😄
from playwright.
@sand4rt I think ESLint rule and/or docs is the way to fix this, instead of arbitrarily restricting mount()
in some environments. There is always a way to introduce unmaintainable mess to the codebase 😄 We should have some "best practices" or "pitfalls" in the documentation describing this. Let me know what you think.
from playwright.
I agree that there will always be ways to introduce mess, but i don't think there is any benefit of using
test.beforeEach(async ({ mount })
ortest.afterEach(async ({ mount })
in component testing though.
That's right. I just don't want us to introduce special cases like this, at least for now, until we see a lot of users bumping into this particular issue.
Some "best practices" or "pitfalls" would definitly be nice anyway. What would be the right place for this?
I guess the same test-components.md
? We have not yet figured out a way to structure component testing docs alongside e2e docs, so let's pile up more content in that large guide for now.
from playwright.
That's alright. I might add a "best practices" section in test-components.md
later on.
I don't think there are many people who will report this, but let's see. Any chance the feature-components
tag could be added? We can also see whether the counter is increasing here: https://github.com/search?q=beforeEach%28async+%28%7B+mount+%7D%29&type=code (43 matches ATM).
from playwright.
Thank you for the link! Looking at the usages, some of them look totally fine to me. Maybe it's not that obvious a decision, and folks should decide for themselves 😄
Some of them look fine now, but will look terrible when they evolve, especially if different props are needed for a few tests. In my opinion, it's better to provide users the right handles rather than trying to support everything in component testing. This same mistake was made during the Enzyme days and was a painfull lesson learned. Might be interesting to save a few links and set a reminder to check in after a few months :D
I totally respect that you don't want to add an special case just for component testing tho!
from playwright.
Related Issues (20)
- [Docs]: python docs: pressSequentially should be press_sequentially
- [Feature]: undeprecate the dev tools option. HOT 1
- [Bug]: Click on visible element fails due to timeout in visibility check HOT 1
- [Bug]: UI Mode - 1 minute very slow at start of ui mode due to watcher watching excessive files (esp. on windows) HOT 1
- [Bug]: .NET: certificate authentication not working when running tests.
- Receiving following error message "AxiosError: Request failed with status code 401" on request HOT 1
- [Docs]: Playwright webkit screenshot configuration HOT 6
- [Bug]: Auth Setup File Not Being Found HOT 9
- [Bug]: `Error: Playwright Test did not expect test() to be called here.` HOT 5
- [Bug]: Headers set in context.route are sent by the browsers but not available in the network tab in trace view on redirects HOT 1
- [Bug] Reusable browser clock bug
- [Bug] Check if Invalid time before sending to server
- [Bug]: npm run build-android-driver ,print error log:"cd: src/server/android/driver: No such file or directory" HOT 1
- [Bug]: no trace, video and screenshot in case of failed test (Target page, context or browser has been closed) HOT 13
- [Bug]: Playwright cannot click on a link inside a disabled input label
- [Docs]: Component testing "best practices" or "pitfalls" HOT 1
- URL redirection issue HOT 2
- [Docs]: Svelte Component Testing Hooks
- [Feature]: debug with ability to step through code for API testing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.