Comments (3)
Doing the following should work:
import pytest
@pytest.fixture(scope="session")
def browser_type_launch_args(browser_type_launch_args):
return {
**browser_type_launch_args,
"firefox_user_prefs": {
"pdfjs.disabled": False,
}
}
Have you tried that? (if you are using the pytest plugin's page/context/browser fixtures)
from playwright-python.
Thanks! I tried but it does not seem to work.
I think I'm using the right plugin, feel free to correct me 🤔
I'm trying to test a Streamlit component, here is an example of a test: https://github.com/lfoppiano/streamlit-pdf-viewer/blob/integration-tests/tests/test_template_embed.py
Moreover, if I block the execution with a breakpoint when the browser opens (using the --headed execution) and then I check about:config
and search for pdf.js, the flag is not set correctly.
I'm wondering, why scope="session"? I thought maybe to use scope='module' instead?
from playwright-python.
@mxschmitt sorry, my bad. This solution works fine.
from playwright-python.
Related Issues (20)
- [Bug]: Error running Playwright test in Windows runner in GitHub actions[Bug]: HOT 2
- [Confusion]: the page.click has misnamed argument, ie delay. HOT 1
- [Bug]: playwright must has no attribute '_playwright' error which playwright version >= 1.31.0 HOT 1
- [Bug]: Memory leak with any browsers and contexts used once HOT 2
- [Bug]: proxy not working using chromium HOT 2
- [Bug]: Starting with 1.41 expect_response method can't match the simplest glob patterns HOT 5
- [Bug]: cookie not load in browser.new_context(storage_state=cookies_path) HOT 2
- Exception: Connection closed while reading from the driver HOT 5
- chrome://flags or IPV6/IPV4 control HOT 3
- [Questions] :When I create a browser instance using `channel="chrome"`, is it the same as when I manually open the browser instance? HOT 1
- Can we set proxy in context not browser HOT 1
- [Docs]: The basic examples do not work HOT 2
- [Bug]: Playwright functions are getting stuck HOT 1
- [Ports]: Backport client side changes for 1.48
- [Bug]: wait_for_load_state doesn't work in headless mode HOT 4
- [Question]: Why do the same version of playwright and browser not behave the same way on linux and mac for video play? HOT 1
- [Question]: Why do the same version of playwright and browser not behave the same way on linux and mac for video play? HOT 1
- [Bug]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte HOT 3
- [Bug]: wait_for_url cause `unsupported operand type(s) for +: 'int' and 'str'` HOT 2
- [Bug]: 1.47.0 is not on pypi 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-python.