webfp / tor-browser-selenium

Tor Browser automation with Selenium.
MIT License
556 stars 99 forks source link

test_noscript_webgl_enabled broken w/ TBB 6.5 #78

Closed psivesely closed 7 years ago

psivesely commented 7 years ago
===================================================== FAILURES =====================================================
_____________________________________ NoScriptTest.test_noscript_webgl_enabled _____________________________________

self = <tbselenium.test.test_addons.NoScriptTest testMethod=test_noscript_webgl_enabled>

    @pytest.mark.skipif(cm.TRAVIS, reason="CI doesn't support WebGL")
    def test_noscript_webgl_enabled(self):
        """Make sure that when we disable NoScript's WebGL blocking,
            WebGL becomes available. This is to the test method we
            use in test_noscript is sane.
            """
        disable_NS_webgl_pref = {"noscript.forbidWebGL": False}
        with TBDriverFixture(TBB_PATH,
                             pref_dict=disable_NS_webgl_pref) as driver:
            driver.load_url_ensure(cm.CHECK_TPO_URL, wait_for_page_body=True)
            webgl_support = driver.execute_script(self.WEBGL_CHECK_JS)
>           self.assertIn("getSupportedExtensions", webgl_support)
E           TypeError: argument of type 'NoneType' is not iterable

/home/fowlslegs/src/fowlslegs/tor-browser-selenium/tbselenium/test/test_addons.py:67: TypeError
====================================== 1 failed, 45 passed in 287.04 seconds =======================================
gunesacar commented 7 years ago

@fowlslegs thanks for reporting the issue, it seems execute_script returns an empty string.

I couldn't reproduce the issue with TBB 6.5, though. The CI tests pass as well: https://travis-ci.org/webfp/tor-browser-selenium/builds/199167351

Could it be about the selenium version being used? I use 2.53.6.

psivesely commented 7 years ago

The CI tests pass as well: https://travis-ci.org/webfp/tor-browser-selenium/builds/199167351

You don't test this method in Travis: https://github.com/webfp/tor-browser-selenium/blob/v0.2.1/tbselenium/test/test_addons.py#L56.

Could it be about the selenium version being used? I use 2.53.6.

Same here.

gunesacar commented 7 years ago

You don't test this method in Travis: https://github.com/webfp/tor-browser-selenium/blob/v0.2.1/tbselenium/test/test_addons.py#L56.

Oops, sorry about that :smile_cat:

We disabled the test because the Travis containers didn't seem to support WebGL. Could that be the culprit here as well? Does http://webglreport.com/ say your machine/container support WebGL?

Are we sure that the failing test passes with the previous stable (6.0.8)? I assume you use TB's default security slider setting while running the tests(?)

psivesely commented 7 years ago

This browser supports WebGL 1, but it is disabled or unavailable.

Not sure it passes on 6.0.8.

Security Slider is set to low (although I feel like this is something you might want to explicitly set/ control for the tests).

psivesely commented 7 years ago

I'll try to test w/ 6.0.8 when I have the time.

gunesacar commented 7 years ago

Thanks, then I suspect the failure is due to lack of WebGL support.

I think we need to rewrite this test. When the test fails we can't tell if it's a genuine failure or it's due to lack of WebGL support.

Security Slider is set to low (although I feel like this is something you might want to explicitly set/ control for the tests).

That makes sense, noted.

gunesacar commented 7 years ago

Closing this issue. Please reopen if the 6.0.8 test passes on the same machine. Otherwise it should be due to missing WebGL support.