def is_headless(pytestconfig):
    """
    Handles running tests in headless browser

    :param pytestconfig: pytest configuration options
    :param request: pytest fixture
    :return: bool
    """
    # Set defaults when --headless is specified
    if pytestconfig.getoption('--headless'):
        return True
    return False