Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Aionitoaie Andrei
    @yozzz06_twitter
    or issues
    Anatoly Bubenkov
    @bubenkoff
    not related to pytest-splinter, let's not discuss it here
    Aionitoaie Andrei
    @yozzz06_twitter
    ok sry will try to find an appropiate channel
    David Borin
    @dborin
    any thoughts on why running pytest tests/selenium/test_attributes.py –-splinter-session-scoped-browser=true keeps giving me ERROR: file not found: –-splinter-session-scoped-browser=true
    Anatoly Bubenkov
    @bubenkoff
    pytest –-splinter-session-scoped-browser=true tests/selenium/test_attributes.py
    ?
    bralles
    @bralles
    What is the advantage of using splinter vs. pure selenium? Easier to interact with web elements?
    Anatoly Bubenkov
    @bubenkoff
    Yes, it is much more fun, i would say
    bralles
    @bralles
    Do I need to import the selenium package? Is splinter a wrapper to selenium?
    Anatoly Bubenkov
    @bubenkoff
    yes it's a wrapper, you don't need to directly import selenium nor splinter with pytest-splinter - just use the provided fixtures
    bralles
    @bralles
    Thanks
    bralles
    @bralles
    Do you guys know if pytest-splinter is compatible with services like saucelabs?
    Anatoly Bubenkov
    @bubenkoff
    yes, using remotedriver
    bralles
    @bralles
    Thanks @bubenkoff
    Aionitoaie Andrei
    @yozzz06_twitter
    hey guys...any ideas about how to automate cross-domain iframes?
    Anatoly Bubenkov
    @bubenkoff
    @yozzz06_twitter what do you mean exactly? pytest-splinter -> splinter -> selenium. So whatever selenium does, pytest-splinter does as well
    Shashi Kumar Raja
    @shashikumarraja
    Can any one help me in displaying the parameterized test data value in pytest terminal while the run is going on
    tests/test.py::test_dummy[test_data1] PASSED
    I want the value of test_data1 to be displayed here
    Anatoly Bubenkov
    @bubenkoff
    @shashikumarraja not related to pytest-splinter, please ask in pytest-dev/pytest
    Vic
    @Vic152
    hello
    John Boyes
    @johnboyes
    Hi, where can Chrome options be set when using pytest-splinter? It’s straightforward to set Chrome as the driver, but can’t see where to hook in the Chrome options.
    Anatoly Bubenkov
    @bubenkoff
    you should be able to pass them via splinter_driver_kwargs fixture
    John Boyes
    @johnboyes
    Thanks for the quick reply, @bubenkoff. That was the route I was going down, so that’s good to know. My basic example fails with this error message:
    ScopeMismatch: You tried to access the 'function' scoped fixture 'splinter_driver_kwargs' with a 'session' scoped request object, involved factories
    Probably something silly that I’m doing, very grateful if you could have a quick look at my gist: https://gist.github.com/johnboyes/6254c03fb31c422049c5c9f2d207a9e7
    ajinkyapande
    @ajinkyapande
    Hello is there any way using which i can add screenshot incase of failure in allure ? i am using pytest_runtest_makereport as hook but not sure how to get browser instance inside it so that i can add it to 'allure.attach ' function
    ajinkyapande
    @ajinkyapande
    Basically i am having trouble while accessing webdriver instance inside hook pytest_runtest_makereport
    Anatoly Bubenkov
    @bubenkoff

    @ajinkyapande but the screenshots are made automatically for you: --splinter-make-screenshot-on-failure
    pytest-splinter should take browser screenshots on test failure. Choices are 'true' or 'false' (default: 'true').

    --splinter-screenshot-dir
    pytest-splinter browser screenshot directory. Defaults to the current directory.

    @johnboyes sorry for the late reply, but your fixture just had to be session scoped
    ajinkyapande
    @ajinkyapande
    thank you for the response @bubenkoff but i am wondering if there is any way using which i can add screenshot into allure report after failure
    Anatoly Bubenkov
    @bubenkoff
    you can override those documented fixtures then
    splinter_screenshot_getter_html
    Function to get browser html screenshot. By default, it saves browser.html with given path and splinter_screenshot_encoding encoding.
    splinter_screenshot_getter_png
    Function to get browser image (png) screenshot. By default, it calls browser.save_sceenshot with given path.
    sureshvv
    @sureshvv
    hi... how can i get console log output?
    Anatoly Bubenkov
    @bubenkoff
    as browser has driver attr, you should be able to use it
    so sms like browser.driver.get_log('browser')
    Athul R T
    @athulvis
    Hello, is there anyway to extract png and html screenshot path from the console output? I tried to extract from pytest report, but it wasn't available there.
    Anatoly Bubenkov
    @bubenkoff
    @athulvis we're adding it to the report actually:
        if request.node.splinter_failure.longrepr:
            reprtraceback = request.node.splinter_failure.longrepr.reprtraceback
            reprtraceback.extraline = _screenshot_extraline(
                screenshot_png_path, screenshot_html_path
            )
    you can also have custom splinter_screenshot_getter_html and splinter_screenshot_getter_png fixtures and memoize the paths
    while calling the base fixtures to keep the functionality
    Athul R T
    @athulvis
    @bubenkoff Thank you for the reply. I tried to call it from report. I checked the longreprtext and couldn't found the path. Sorry for my lack of knowledge, can you tell me how can I call it from the report itself?
    Simply I just wanted to capture screenshot path of each test to a json file.
    Anatoly Bubenkov
    @bubenkoff
    but you can just make use of the naming schema:

    <splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.png

    <splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.html

    you can simply rely on the names and you don't need the json file
    or you can render the file by listing the files in the splinter-screenshot-dir
    Athul R T
    @athulvis
    Thank you. Let me try that approach.
    Athul R T
    @athulvis
    Hello.. I was able to access the screenshot directory from reprtraceback extraline, but it can't be stored because of limitations from pytest side. Anyway thanks @bubenkoff for the support.
    Anatoly Bubenkov
    @bubenkoff
    but why don't you simply access it using the suggested approach, so the failing test package/test name-browser.png
    Michał Pasternak
    @mpasternak
    Hello!
    @bubenkoff I'm working on passing tests (fixing the mouse_over patch), will have a PR soon