Ejemplo n.º 1
0
    def before_all(self, context):
        ProjectEnvironment.set_up()

        root_directory = os.path.join(OUTPUT_TEST_RESULTS_DIR, date_time())
        create_directory(root_directory)
        os.environ['REPORT_DIR'] = root_directory

        before_all()
Ejemplo n.º 2
0
    def before_scenario(self, context, scenario):
        self.current_scenario = scenario
        current_scenario_directory = os.path.join(
            os.getenv('CURRENT_FEATURE_DIR'), scenario.feature.name)
        create_directory(current_scenario_directory)
        os.environ['CURRENT_SCENARIO_DIR'] = current_scenario_directory

        self.obj_scenario_meta_info = ScenarioMetaInfo()
        self.obj_scenario_meta_info.startTime = current_timestamp()
    def scenario(self, scenario):
        self.finish_current_scenario()

        self.__current_scenario = scenario

        current_scenario_directory = os.path.join(
            os.getenv('CURRENT_FEATURE_DIR'), 'Scenario')
        create_directory(current_scenario_directory)
        os.environ['CURRENT_SCENARIO_DIR'] = current_scenario_directory

        Scenario(file_name=self.__current_scenario.name).errorTrace = ''

        self.__obj_scenario_meta_info = ScenarioMetaInfo()
        self.__obj_scenario_meta_info.startTime = current_timestamp()
    def feature(self, feature):
        self.finish_current_feature()

        self.__current_feature = feature

        current_feature_directory = os.path.join(os.getenv('REPORT_DIR'),
                                                 'json', feature.name)
        create_directory(current_feature_directory)
        os.environ['CURRENT_FEATURE_DIR'] = current_feature_directory

        ExecutionMetaInfo().add_test(feature.name)

        FeatureOverView().startTime = current_timestamp()
        FeatureOverView().add_class('Scenario')
    def before_feature(self, context, feature):
        current_feature_directory = os.path.join(
            os.getenv('REPORT_DIR'), 'json',
            re.sub('[^A-Za-z0-9]+', ' - ',
                   re.sub('.feature', '', feature.filename)))
        create_directory(current_feature_directory)
        os.environ['CURRENT_FEATURE_DIR'] = current_feature_directory

        ExecutionMetaInfo().add_test(
            re.sub('[^A-Za-z0-9]+', ' - ',
                   re.sub('.feature', '', feature.filename)))

        FeatureOverView().startTime = current_timestamp()
        FeatureOverView().add_class(feature.name)
    def __init__(self, stream_opener, config):
        super(QAFFormatter, self).__init__(stream_opener, config)

        self.split_text_into_lines = True

        root_directory = os.path.join(OUTPUT_TEST_RESULTS_DIR, date_time())
        create_directory(root_directory)
        os.environ['REPORT_DIR'] = root_directory

        self.__current_feature = None
        self.__current_scenario = None

        self.__obj_scenario_meta_info = None
        self.__steps = deque()
        before_all()
Ejemplo n.º 7
0
    def before_feature(self, context, feature):
        envInfoDetails = {
            "browser-desired-capabilities": {},
            "browser-actual-capabilities": {},
            "isfw-build-info": {},
            "run-parameters": {},
            "execution-env-info": {}
        }
        current_feature_directory = os.path.join(
            os.getenv('REPORT_DIR'), 'json',
            re.sub('[^A-Za-z0-9]+', ' - ',
                   re.sub('.feature', '', feature.filename)))
        create_directory(current_feature_directory)
        os.environ['CURRENT_FEATURE_DIR'] = current_feature_directory

        ExecutionMetaInfo().add_test(
            re.sub('[^A-Za-z0-9]+', ' - ',
                   re.sub('.feature', '', feature.filename)))

        FeatureOverView().startTime = current_timestamp()
        FeatureOverView().add_class(feature.name)
        # driver_name = str(ConfigurationsManager().get_str_for_key('driver.name'))
        # driver_name[:str(driver_name).lower().index('driver')]
        envInfoDetails["browser-desired-capabilities"][
            "browserName"] = BaseDriver().get_driver(
            ).capabilities['browserName']
        envInfoDetails["browser-desired-capabilities"][
            "cssSelectorsEnabled"] = "true"
        envInfoDetails["browser-desired-capabilities"][
            "javascriptEnabled"] = "true"
        envInfoDetails["browser-desired-capabilities"][
            "takesScreenshot"] = "true"
        envInfoDetails["browser-desired-capabilities"]["platform"] = str(
            ConfigurationsManager().get_str_for_key('platform'))
        envInfoDetails["browser-desired-capabilities"]["version"] = BaseDriver(
        ).get_driver().capabilities['browserVersion']
        json_object = BaseDriver().get_driver().capabilities
        pairs = json_object.items()
        for key, value in pairs:
            # print(str(value))
            envInfoDetails["browser-actual-capabilities"][key] = str(value)

        envInfoDetails["isfw-build-info"]["qaf-Type"] = "core"
        envInfoDetails["isfw-build-info"][
            "qaf-Build-Time"] = current_timestamp()
        envInfoDetails["isfw-build-info"]["qaf-Version"] = "3.0"

        envInfoDetails["run-parameters"]["resources"] = str(
            ConfigurationsManager().get_str_for_key('env.resources'))
        envInfoDetails["run-parameters"]["file.feature"] = "feature/" + str(
            ConfigurationsManager().get_str_for_key('platform'))
        envInfoDetails["run-parameters"]["baseurl"] = str(
            ConfigurationsManager().get_str_for_key('env.baseurl'))

        # envInfoDetails["execution-env-info"]["java.arch"] = "64"
        # envInfoDetails["execution-env-info"]["java.vendor"] = "Oracle Corporation 22"
        envInfoDetails["execution-env-info"][
            "python.version"] = platform.python_version()
        envInfoDetails["execution-env-info"]["os.arch"] = platform.processor()
        envInfoDetails["execution-env-info"]["host"] = platform.node()
        envInfoDetails["execution-env-info"]["os.name"] = platform.platform()
        envInfoDetails["execution-env-info"]["user.name"] = os.getlogin()
        envInfoDetails["execution-env-info"]["os.version"] = platform.version()

        # drivercap = json.loads(BaseDriver.__driver.capabilities)
        # print(BaseDriver().get_driver().capabilities['browserName'])
        FeatureOverView().add_envInfo(envInfoDetails)