Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you close the browser page the whole test suite crashes #4

Open
oleksandrPJ opened this issue Jul 19, 2021 · 3 comments
Open

If you close the browser page the whole test suite crashes #4

oleksandrPJ opened this issue Jul 19, 2021 · 3 comments

Comments

@oleksandrPJ
Copy link

oleksandrPJ commented Jul 19, 2021

if you delete the "--screenshot=on" then after closing the browser the test will restart

command: python -m pytest -v -q --reruns 2 --screenshot=on --alluredir=allure-results

requirement.txt:
allure-pytest==2.9.43
allure-python-commons==2.9.43
attrs==21.2.0
certifi==2021.5.30
chardet==4.0.0
helium==3.0.7
idna==2.10
iniconfig==1.1.1
mysql-connector-python==8.0.25
packaging==20.9
pluggy==0.13.1
protobuf==3.17.3
py==1.10.0
pyparsing==2.4.7
pytest==6.2.4
pytest-base-url==1.4.2
pytest-failed-screenshot==1.0.2
pytest-html==3.1.1
pytest-metadata==1.11.0
pytest-rerunfailures==10.0
pytest-selenium==2.0.1
pytest-variables==1.9.0
requests==2.25.1
selenium==3.141.0
six==1.16.0
tenacity==6.3.1
toml==0.10.2
urllib3==1.26.5

@oleksandrPJ oleksandrPJ changed the title If you close the browser page, the whole test suite crashes If you close the browser page the whole test suite crashes Jul 19, 2021
@fungaegis
Copy link
Owner

I'm sorry I didn't get what you mean. Do you mean that if you close the browser without using '--screenshot=on', it will wake up again?

@oleksandrPJ
Copy link
Author

I mean if you close the browser while using —screenshot=on, the whole suit fails without restarting. If you do not use —screenshot=on, then the running test will fail, but it will restart

@fungaegis
Copy link
Owner

fungaegis commented Jul 20, 2021

I tried selenium and helium, but they won't happen as you said. You can try the following example

cmd: pytest -s -v --screenshot on --reruns 2

import pytest
from helium import start_chrome, kill_browser


@pytest.fixture()
def helium():

    start_chrome("https://www.google.com")
    yield
    kill_browser()


class TestHelium:

    @pytest.mark.usefixtures("helium")
    def test_helium(self):
        assert False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants