def METHOD_NAME(cls):
    # Newer releases of Ubuntu package Firefox as a Snap, meaning that it comes with
    # sandboxing restrictions that prevent it writing temporary profiles into the
    # default system tmpdir. We workaround this by changing TMPDIR to point to a
    # directory in the project root (which we assume is within the currently running
    # user's home directory). See:
    # https://github.com/mozilla/geckodriver/releases/tag/v0.32.0
    tmpdir = Path(settings.REPO_ROOT) / "tmp"
    tmpdir.mkdir(exist_ok=True)
    orig_tmp = os.environ.get("TMPDIR")
    os.environ["TMPDIR"] = str(tmpdir)
    try:
        return webdriver.Firefox(
            log_path="%s/logs/webdriver.log" % settings.REPO_ROOT
        )
    finally:
        if orig_tmp is not None:
            os.environ["TMPDIR"] = orig_tmp
        else:
            del os.environ["TMPDIR"]