How to Run Tests in Playwright with the VS Code Extension

preview_player
Показать описание
In this video let's look at how to run tests in Playwright with the VS Code Extension and showcase how you can easily select which browsers known as projects, to run your tests on, how to run your setup tests, such as login tests, only once and how to switch between different configs.

Check out the docs on getting started with VS Code:

#playwrightdev #playwrightweb #playwright #vscode #endtoendtesting #testing
Рекомендации по теме
Комментарии
Автор

I appreciate the setup with selectable configurations, especially since we're using a monorepo (kudos to you all). The thing that I don't like, however, is setting the cwd in the opened workspace - in our case, root of the project (both in run debug and run test). This causes environment configurations from the root to be used, and as our project setup is done inside the project folder (as it should be), it leads to issues. Although this can be fixed by opening a workspace only in my project folder, I also have dependencies and utilities to update outside of it. What would be nice is if there's a toggle to choose which cwd to use (workspace or config folder). I have actually cloned the git repo and manually compiled a .vsix file, which I am using until this is fixed. I hope you can address this, as I want to have an updated extension with the cool features you are developing. You're doing some great things guys and I can't thank you enough 💙

redenjohnzarra
Автор

I'd like to hear more about storage state, I guess I can look it up. All my tests login fresh for a clean experience but I can see how they can become unmanageable.

qasurfer
Автор

thanks for the update! I just have a couple of questions:
- on your previous update, you talked about the new command to only execute failed tests. Is there any way we can configure this in our job in the build pipeline (azure).
- Do you have an example on HOW we can use multiple configurations (lets say one for test env and one for prd env) in the build pipeline? Because we might want to run a subset of tests with different data (that we specified in the config) on prd.

PDuimelaar
Автор

Cool video, BUT, it would be much more useful for this project to have the repo link on GitHub. I see lots of tests and settings on video, but we can not look into them to get a clear picture, would it be possible to share the link here?

Butterflywm
Автор

Hi, I have a test for clicking on disabled button, to expect no redirect, but test fails with timeout, even if I set noWaitAfter: true
await button.click({noWaitAfter: true});
Is this limitation/defect in Playwright? Why does it expect navigation on disabled button and fails with timeout error? Is there any work around it?
I know about button.dispatchEvent('click') will not wait for navigation, but that doesn't work with enabled button, I need to test that enabled button redirects on click and disabled doesn't redirect.

scottishfoldmocha
Автор

I wonder If you could make a video on how to write a test for Adobe Analytics and Google Analytics (dataLayer) requests, which fire on page load and clicks. How to verify the values in the payload of such requests.

hito
Автор

Thank you for your content. I have a question: in my vscode (win 10) an inline green triangle button to run individual tests is not showing. Simply does not appear in UI of VsCode. Did anybody come across the same issue? If yes, how did you resolve it? Feedback appreciated.

Acksakal