Comments (1)
I tried to reproduce it by using a new Python Docker container, installing pytest
and playwright-pytest
and creating a small test file. Then running pytest
without calling python -m playwright install
before. It lead to the following output which is in my mind enough for the users who didn't install the browsers:
root@6468629fb07d:/# pytest test_foo.py
=========================================================================================== test session starts ============================================================================================
platform linux -- Python 3.9.0, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /
plugins: base-url-1.4.2, playwright-0.0.7
collected 1 item
test_foo.py E [100%]
================================================================================================== ERRORS ==================================================================================================
___________________________________________________________________________ ERROR at setup of test_example_is_working[chromium] ____________________________________________________________________________
self = <playwright.browser_type.BrowserType object at 0x7f4205b85f40>, executablePath = None, args = None, ignoreDefaultArgs = None, handleSIGINT = None, handleSIGTERM = None, handleSIGHUP = None
timeout = None, env = None, headless = None, devtools = None, proxy = None, downloadsPath = None, slowMo = None, chromiumSandbox = None, firefoxUserPrefs = None
async def launch(
self,
executablePath: Union[str, Path] = None,
args: List[str] = None,
ignoreDefaultArgs: Union[bool, List[str]] = None,
handleSIGINT: bool = None,
handleSIGTERM: bool = None,
handleSIGHUP: bool = None,
timeout: int = None,
env: Env = None,
headless: bool = None,
devtools: bool = None,
proxy: ProxyServer = None,
downloadsPath: Union[str, Path] = None,
slowMo: int = None,
chromiumSandbox: bool = None,
firefoxUserPrefs: Dict[str, Union[str, int, bool]] = None,
) -> Browser:
params = locals_to_params(locals())
normalize_launch_params(params)
try:
> return from_channel(await self._channel.send("launch", params))
usr/local/lib/python3.9/site-packages/playwright/browser_type.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <playwright.connection.Channel object at 0x7f4205b85fa0>, method = 'launch', params = {}
async def send(self, method: str, params: Dict = None) -> Any:
if params is None:
params = {}
callback = self._connection._send_message_to_server(self._guid, method, params)
> result = await callback.future
E playwright.helper.Error: Failed to launch chromium because executable doesn't exist at /root/.cache/ms-playwright/chromium-815036/chrome-linux/chrome
E Try re-installing playwright with "npm install playwright"
E Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
usr/local/lib/python3.9/site-packages/playwright/connection.py:39: Error
During handling of the above exception, another exception occurred:
launch_browser = <function launch_browser.<locals>.launch at 0x7f4205c6b310>
@pytest.fixture(scope="session")
def browser(launch_browser: Callable[[], Browser]) -> Generator[Browser, None, None]:
> browser = launch_browser()
usr/local/lib/python3.9/site-packages/pytest_playwright/pytest_playwright.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
usr/local/lib/python3.9/site-packages/pytest_playwright/pytest_playwright.py:98: in launch
browser = getattr(pw, browser_name).launch(**launch_options)
usr/local/lib/python3.9/site-packages/playwright/sync_api.py:6142: in launch
self._sync(
usr/local/lib/python3.9/site-packages/playwright/sync_base.py:107: in _sync
return future.result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <playwright.browser_type.BrowserType object at 0x7f4205b85f40>, executablePath = None, args = None, ignoreDefaultArgs = None, handleSIGINT = None, handleSIGTERM = None, handleSIGHUP = None
timeout = None, env = None, headless = None, devtools = None, proxy = None, downloadsPath = None, slowMo = None, chromiumSandbox = None, firefoxUserPrefs = None
async def launch(
self,
executablePath: Union[str, Path] = None,
args: List[str] = None,
ignoreDefaultArgs: Union[bool, List[str]] = None,
handleSIGINT: bool = None,
handleSIGTERM: bool = None,
handleSIGHUP: bool = None,
timeout: int = None,
env: Env = None,
headless: bool = None,
devtools: bool = None,
proxy: ProxyServer = None,
downloadsPath: Union[str, Path] = None,
slowMo: int = None,
chromiumSandbox: bool = None,
firefoxUserPrefs: Dict[str, Union[str, int, bool]] = None,
) -> Browser:
params = locals_to_params(locals())
normalize_launch_params(params)
try:
return from_channel(await self._channel.send("launch", params))
except Exception as e:
if f"{self.name}-" in str(e):
> raise not_installed_error(f'"{self.name}" browser was not found.')
E Exception:
E ================================================================================
E "chromium" browser was not found.
E Please complete Playwright installation via running
E
E "python -m playwright install"
E
E ================================================================================
usr/local/lib/python3.9/site-packages/playwright/browser_type.py:72: Exception
========================================================================================= short test summary info ==========================================================================================
ERROR test_foo.py::test_example_is_working[chromium] - Exception:
============================================================================================= 1 error in 0.59s =============================================================================================
Exception in callback SyncBase._sync.<locals>.callback(<Task finishe...=========\n')>) at /usr/local/lib/python3.9/site-packages/playwright/sync_base.py:100
handle: <Handle SyncBase._sync.<locals>.callback(<Task finishe...=========\n')>) at /usr/local/lib/python3.9/site-packages/playwright/sync_base.py:100>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.9/site-packages/playwright/sync_base.py", line 101, in callback
g_self.switch()
greenlet.GreenletExit
from playwright-pytest.
Related Issues (20)
- Setting locale for a test affects the local for other tests HOT 1
- Coverage support HOT 1
- [BUG] Error when installing in Python 3.12 HOT 2
- Pytest.ini set --screenshot="only-on-failure" --video="retain-on-failure" Screenshots and recorded videos will also be generated after the use case is successfully executed.
- pytest-playwright--parameterization, cases order Not what I expected HOT 8
- playwright._impl._api_types.Error: net::ERR_CONNECTION_TIMED_OUT at https://www.google.com HOT 2
- [FEATURE] Support connecting to remote browsers HOT 1
- Request: `async` support HOT 4
- [FEATURE] Support pytest 8.x HOT 3
- [BUG]The execution sequence is incorrect when use parametrize HOT 1
- Request: extending `browser_type_launch_args` to work with `request`
- [FEATURE] Support for multiple browser contexts in a single test HOT 1
- [FR] Support for working with pytest-rerunfailures to only create --output on true failure
- Allow extending playwright capabilities HOT 2
- run with --video on --screenshot on how to set screenshot dir and how to get videoname and screenshot name? HOT 1
- pytest-playwirght uses --video="on" to record video,the recorded video only records the newly opened tab page HOT 5
- Move creation of artifacts_folder into a fixture HOT 2
- [BUG]PermissionError: [WinError 5]
- [FEATURE] Implement steps for Trace Viewer HOT 1
- [Feature]: Expose output_dir as a fixture HOT 3
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-pytest.