コード例 #1
0
ファイル: main.py プロジェクト: E-b-creating/iris_firefox
    def pytest_sessionstart(self, session):
        global core_args
        core_args = get_core_args()
        global target_args
        BaseTarget.pytest_sessionstart(self, session)
        self.validate_config()
        try:
            port = core_args.port

            logger.info('Starting local web server on port %s for directory %s' % (port, self.local_web_root))
            web_server_process = Process(target=LocalWebServer, args=(self.local_web_root, port,))
            self.process_list.append(web_server_process)
            web_server_process.start()

            fx = self.args.firefox
            locale = core_args.locale
            app = FX_Collection.get(fx, locale)

            if not app:
                FX_Collection.add(fx, locale)
                app = FX_Collection.get(fx, locale)
            self.values = {'fx_version': app.version, 'fx_build_id': app.build_id, 'channel': app.channel}
        except IOError:
            logger.critical('Unable to launch local web server, aborting Iris.')
            exit(1)
        logger.info('Loading more test images...')
コード例 #2
0
ファイル: main.py プロジェクト: ranjit-exalt/iris_firefox
    def firefox(self, request):
        profile_type = request.node.own_markers[0].kwargs.get("profile")
        preferences = request.node.own_markers[0].kwargs.get("preferences")
        profile = FirefoxProfile.make_profile(profile_type, preferences)

        fx = target_args.firefox
        locale = get_core_args().locale
        app = FX_Collection.get(fx, locale)

        if not app:
            FX_Collection.add(fx, locale)
            app = FX_Collection.get(fx, locale)

        if target_args.update_channel:
            FirefoxUtils.set_update_channel_pref(app.path,
                                                 target_args.update_channel)

        is_rerun = False
        if len(Target.completed_tests):
            if Target.completed_tests[-1].file_name == request.node.fspath:
                logger.debug("Rerun detected:")
                logger.debug(Target.completed_tests[-1].file_name)
                logger.debug(request.node.fspath)
                is_rerun = True
        if not is_rerun:
            logger.debug("Incrementing index")
            Target.index += 1

        args = {
            "total": len(request.node.session.items),
            "current": Target.index,
            "title": os.path.basename(request.node.fspath),
        }

        return FXRunner(app, profile, args)
コード例 #3
0
ファイル: app.py プロジェクト: leshibily/iris2
    def firefox(self, request):
        profile_type = request.node.own_markers[0].kwargs.get('profile')
        preferences = request.node.own_markers[0].kwargs.get('preferences')
        profile = FirefoxProfile.make_profile(profile_type, preferences)

        fx = target_args.firefox
        locale = get_core_args().locale
        app = FX_Collection.get(fx, locale)

        if not app:
            FX_Collection.add(fx, locale)
            app = FX_Collection.get(fx, locale)

        if target_args.update_channel:
            FirefoxUtils.set_update_channel_pref(app.path,
                                                 target_args.update_channel)
        return FXRunner(app, profile)
コード例 #4
0
ファイル: main.py プロジェクト: E-b-creating/iris_firefox
    def firefox(self, request):
        profile_type = request.node.own_markers[0].kwargs.get('profile')
        preferences = request.node.own_markers[0].kwargs.get('preferences')
        profile = FirefoxProfile.make_profile(profile_type, preferences)

        fx = target_args.firefox
        locale = get_core_args().locale
        app = FX_Collection.get(fx, locale)

        if not app:
            FX_Collection.add(fx, locale)
            app = FX_Collection.get(fx, locale)

        if target_args.update_channel:
            FirefoxUtils.set_update_channel_pref(app.path, target_args.update_channel)

        args = {'total': len(request.node.session.items), 'current': Target.index,
                'title': os.path.basename(request.node.fspath)}

        return  FXRunner(app, profile, args)