pytest-dev / pytest-splinter

pytest splinter and selenium integration for anyone interested in browser interaction in tests
MIT License
254 stars 51 forks source link

Current github code fails tests on Linux #31

Closed OpenTrading closed 9 years ago

OpenTrading commented 9 years ago

A checkout of the current github code, on linux, Python 2.7.9, splinter-0.7.2 pytest-2.7.0 using firefox 37.0.2 fails the tests with:

=================================== FAILURES ===================================
_______________________________ test_status_code _______________________________

browser = <splinter.driver.webdriver.firefox.WebDriver object at 0xb3ecea2c>

    def test_status_code(browser):
        """Check the browser fixture."""
        assert 'status_code' not in browser.__dict__
        # fails here : property
>       assert browser.status_code == 200

test_plugin.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/t/lib/python2.7/site-packages/pytest_splinter-1.3.6-py2.7.egg/pytest_splinter/plugin.py:59: in _get_status_code
    return self.status_code
/t/lib/python2.7/site-packages/pytest_splinter-1.3.6-py2.7.egg/pytest_splinter/plugin.py:59: in _get_status_code
    return self.status_code
!!! Recursion detected (same locals & position)
==== 1 failed, 21 passed, 1 skipped, 1 warnings, 2 error in 399.84 seconds =====
bubenkoff commented 9 years ago

how do you run the tests? see how travis does

OpenTrading commented 9 years ago

I just checked the code out from github, ran "python setup.py install", and then ran "py.test tests" or "cd tests ; py.test" - it should run out-of-the-box. All the components like pytest-localserver, firefox, chromium, zope.testbrowser and splinter are up-to-date.

I'm having even more troubles with phantomjs and chrome - see https://github.com/pytest-dev/pytest-splinter/issues/35

Can you try checking the code out from github in a bare test login, and run "python setup.py install", and then run "cd tests ; py.test"? I'm looking forward to using this under pytest-bdd.

bubenkoff commented 9 years ago

preparation of the test environment is in the Makefile:

pip install -e . -r requirements-testing.txt tox coveralls

that's what you need to be able to run py.test tests

or just use tox command (from the root folder)