Comments (6)
Make sure you are using the same version of Playwright in your packages. Npm will perform all the necessary deduplication. You can find the source of the problem via examining package-lock. Most likely you pinned different playwright versions in your package.json deps.
from playwright.
Make sure you are using the same version of Playwright in your packages. Npm will perform all the necessary deduplication. You can find the source of the problem via examining package-lock. Most likely you pinned different playwright versions in your package.json deps.
In my "base" packageA i added in package.json dependencies:
so once i install packageA in packageB (packageB have packageA in dependencies) and later install packageB in testing Project it is using those dependencies so versions are for sure the same. I am able to import everything correctly.
However i have still this error when im trying to run my tests...
Error: Requiring @playwright/test second time,
Maybe my playwright.config.ts is in wrong package/place ? It should be only in testing project ?
from playwright.
Looking at the package-lock.json should usually give a clue on if multiple @playwright/test
versions are installed or not. We need something we can clone and reproduce locally in order to triage this further. Thanks for your understanding!
It also depends on how you distribute your util package etc. (esbuild or pure TypeScript etc.)
from playwright.
I used TSUP to build package.
I added now @playwright/test
as a dev dependencies in all 3 projects.
Ive added packageA and package B to my testing project using yarn add -D //relative-pathto-GZ-tarball
(before that i used yarn pack
) i checked yarn lock and it seems that its installted only once (as expected as it is in dev dependencies) but still have this issue however...
from playwright.
Would it be possible to share a reproduction? Otherwise we are not able to act on it, unfortunately. Thank you!
from playwright.
I'll close it in the meantime while we don't have a reproduction. The issue is usually that you have multiple @playwright/test versions in your project. Ideally the utils package should not depend on @playwright/test at all, and only your main project should do. Feel free to re-file with a repro.
from playwright.
Related Issues (20)
- [Feature]: Playwright Beta/Canary Test for VS Code HOT 1
- [Bug]: Can't select multiple select option with webkit HOT 3
- Some of the script are running fine on local but getting failed on github action pipeline. It is giving timeout exceed error in logs
- The addLocatorHandler method can be triggered in the test environment, but it does not trigger when using the library. why this is happening? HOT 1
- [Feature]: --only-changed - run the global set up/teardown files in addition to changed tests HOT 1
- Hello, if the URL jump occurs by clicking on the event on the page, which method is better recommended? I see two methods in the official documentation, waitForURL and waitForNavigation. According to our usage habits, we prefer to use waitForNavigation, but the document mark says that it has been abandoned, and it also says that this method is inherently dangerous. Could you explain the reason? Because we do not pay attention to the url of the click event, if we use waitForURL, it will increase our workload. Thank you!
- [Bug]: waitForURL and waitForNavigation
- How to automate Save/save as Modal using playwright HOT 1
- [Bug]: Incorrect user agent HOT 1
- [Bug]: Symlinked directories inside testDir are ignored in MacOS
- [Bug]: window.resizeTo/resizeBy and window.moveTo/moveBy do not work in Chromium
- [Bug]: Unable to capture full page snapshot of some sites with Chromium and Firefox HOT 1
- [Bug]: Credential scanning tool flags shipped private key HOT 3
- [Bug]: playwright randomly skipping tests once failure is encountered, it sort of terminating the run HOT 3
- [Bug]: Screenshot not recorded/shown in timeline for Webkit HOT 3
- [Bug]: HOT 3
- [Feature]: Add current page URL to Playwright screenshots and videos (eg. render the mock browser chrome) HOT 3
- [Chore]: Set up React StrictMode for tests
- [Feature]: Allow `--only-changed` to work with `--list`
- How can I open a full-screen browser in playwright codegen mode? HOT 1
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.