Exemple #1
0
 def get_wrapper(self):
     """
     Return a Lua wrapper for this object.
     """
     # FIXME: cache file contents
     splash_lua_code = get_script_source("splash.lua")
     self.lua.execute(splash_lua_code)
     wrapper = self.lua.globals()["Splash"]
     return wrapper(self)
Exemple #2
0
class EmulatedJsRedirectTest(Base.EmulationMixin,
                             test_redirects.JsRedirectTest):
    script = get_script_source("render_html.lua")

    # Overridden to return 400.
    @unittest.skipIf(NON_EXISTING_RESOLVABLE,
                     "non existing hosts are resolvable")
    def test_redirect_to_non_existing(self):
        r = self.request({
            "url": self.mockurl("jsredirect-non-existing"),
            "wait": 0.2,
        })
        self.assertStatusCode(r, 400)
Exemple #3
0
class EmulatedRenderPngTest(Base.EmulationMixin, test_render.RenderPngTest):
    script = get_script_source("render_png.lua")

    # TODO: default width and height are not applied
    @pytest.mark.xfail
    def test_ok(self):
        super(EmulatedRenderPngTest, self).test_ok()

    @pytest.mark.xfail
    def test_ok_https(self):
        super(EmulatedRenderPngTest, self).test_ok_https()

    # TODO: fix validation
    @pytest.mark.xfail
    def test_viewport_out_of_bounds(self):
        super(EmulatedRenderPngTest, self).test_viewport_out_of_bounds()

    @pytest.mark.xfail
    def test_viewport_invalid(self):
        super(EmulatedRenderPngTest, self).test_viewport_invalid()

    @pytest.mark.xfail
    def test_range_checks(self):
        super(EmulatedRenderPngTest, self).test_range_checks()
Exemple #4
0
 def get_example_script(self):
     return get_script_source("example.lua")
Exemple #5
0
class EmulatedRenderHarTest(Base.EmulationMixin, test_har.HarRenderTest):
    script = get_script_source("render_har.lua")
Exemple #6
0
class EmulatedMetaRedirectTest(Base.EmulationMixin,
                               test_redirects.MetaRedirectTest):
    script = get_script_source("render_html.lua")
Exemple #7
0
class EmulatedRenderHtmlTest(Base.EmulationMixin, test_render.RenderHtmlTest):
    script = get_script_source("render_html.lua")
Exemple #8
0
 def get_example_script(self):
     return get_script_source("example.lua")