# Path: tests/helpers.py
# def convert_sec_to_ms(timeout):
#     return timeout * 1000


import os
from tests.helpers import convert_sec_to_ms
        self._timeout = timeout

    def load_in(self, driver):
        driver.get(EMPTY_PAGE_URL)
        return LoadedHtmlPage(driver).render_body(self._body, self._timeout)


class LoadedHtmlPage:
    def __init__(self, driver):
        self._driver = driver

    def render_body(self, body, timeout=0):
        self._driver.execute_script(
            'setTimeout(function() { document.getElementsByTagName("body")[0].innerHTML = "'
            + body.replace('\n', ' ').replace('"', '\\"')
            + '";}, '
            + str(convert_sec_to_ms(timeout))
            + ');'
        )
        return self

    def execute_script(self, script):
        self._driver.execute_script(script)
        return self

    def execute_script_with_timeout(self, script, timeout):
        self._driver.execute_script(
            "setTimeout(function() { "
            + script.replace("\n", " ")
            + " }, "

# Path: tests/helpers.py
# def convert_sec_to_ms(timeout):
#     return timeout * 1000


# Path: tests/acceptance/helpers/givenpage.py
import os
from tests.helpers import convert_sec_to_ms

        self._timeout = timeout

    def load_in(self, driver):
        driver.get(EMPTY_PAGE_URL)
        return LoadedHtmlPage(driver).render_body(self._body, self._timeout)


class LoadedHtmlPage:
    def __init__(self, driver):
        self._driver = driver

    def render_body(self, body, timeout=0):
        self._driver.execute_script(
            'setTimeout(function() { document.getElementsByTagName("body")[0].innerHTML = "'
            + body.replace('\n', ' ').replace('"', '\\"')
            + '";}, '
            + str(convert_sec_to_ms(timeout))
            + ');'
        )
        return self

    def execute_script(self, script):
        self._driver.execute_script(script)
        return self

    def execute_script_with_timeout(self, script, timeout):
        self._driver.execute_script(
            "setTimeout(function() { "
            + script.replace("\n", " ")
            + " }, "

            + str(convert_sec_to_ms(timeout))