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)
- How to Dynamically pass values inside this locator HOT 2
- Unable to pass Dynamic values inside a Locator picked using Playwright Inspector HOT 1
- [Bug]: Zombie thread problem HOT 2
- [Bug]: laywright._impl._errors.Error: Page.goto: Page crashed HOT 4
- How to get the error type Console in the browser? HOT 3
- [Bug]: set_checked() doesn't work on checkbox element of a slider HOT 7
- How to locate the chromewebstore's confirm dialog? HOT 1
- how to get Twitter cookie and login with headless chromium HOT 1
- [Bug]: `Download.failure()` raises `TypeError: expected string or bytes-like object, got 'NoneType'`
- [Bug]: Error: net::ERR_PROXY_CONNECTION_FAILED .... is of type playwright._impl._errors.Error HOT 1
- [Bug]: Future finished exception=TargetClosedError('Target page, context or browser has been closed')
- [Bug]: Using playwright browser to measure the FCP & LCP caused inaccuracy HOT 1
- [Feature]: allow reuse of JavaScript functions HOT 1
- What is the value list for local in Playwright? HOT 1
- [Bug]: use async api with threading moudle cause process hang forever HOT 2
- When I open the browser using playwright.chromium. launch_persistent_context, I use page. go to open a URL for example https://111.html To manually open a URL for the tag page https://222.html The tag page does not have a URL when calling context. pages https://222.html What is the reason for the page, and how can I obtain the second page? HOT 1
- [Question]The content.pages method cannot retrieve all pages HOT 2
- [Bug]: Apple App store link is not opening in a new tab while clicking a link [mobile: iPhone 13] HOT 1
- [Bug]: proxy not connect HOT 1
- [Bug]: In mac sonoma, browser the installed version and the using version are missmatching. 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.