Giter Site home page Giter Site logo

Comments (4)

arjunattam avatar arjunattam commented on May 23, 2024

Thanks @akozyreva. I'm assuming this is related to the Playwright plugin for Pytest. You can modify the default context options fixture, which is used to launch new contexts.

@pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
    iphone_11 = playwright.devices['iPhone 11 Pro']
    return {** browser_context_args, **iphone_11}

Let me know if I got this right.

from playwright-pytest.

akozyreva avatar akozyreva commented on May 23, 2024

@arjunattam when I try to execute your code, I get the following error

    @pytest.fixture(scope="session")
    def browser_context_args(browser_context_args):
>       iphone_11 = playwright.devices['iPhone 11 Pro']
E       AttributeError: module 'playwright' has no attribute 'devices'

test_with_pytest_iphone.py:5: AttributeError

from playwright-pytest.

mxschmitt avatar mxschmitt commented on May 23, 2024

Moved it over to the pytest repo since there is currently no way to use device emulation afaik. Will fix it later.

from playwright-pytest.

mxschmitt avatar mxschmitt commented on May 23, 2024

@akozyreva I've fixed it and published a new version of playwright-pytest (0.0.8). A full example how to use it you can see here: https://github.com/microsoft/playwright-pytest#device-emulation

from playwright-pytest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.