Blazemeter / taurus

@@ -993,7 +993,11 @@
Loading
993 993
            options = self._get_chrome_options()
994 994
        elif browser == 'remote':
995 995
            if 'firefox' == self.capabilities.get('browserName'):
996 +
                browser = 'firefox'
996 997
                options = self._get_firefox_options()
998 +
            elif 'chrome' == self.capabilities.get('browserName'):
999 +
                browser = 'chrome'
1000 +
                options = self._get_chrome_options()
997 1001
            else:
998 1002
                options = [ast.Assign(targets=[ast_attr("options")], value=ast_attr("None"))]
999 1003
        else:
@@ -1100,21 +1104,21 @@
Loading
1100 1104
        if selenium_version < LooseVersion('4'):
1101 1105
            old_version = True
1102 1106
            if browser != 'firefox' and browser != 'chrome':
1103 -
                self.log.warning("Selenium options are not supported. "
1104 -
                                 "Browser "+browser+". Selenium version "+selenium.__version__)
1107 +
                self.log.warning(f'Selenium options are not supported. '
1108 +
                                 f'Browser {browser}. Selenium version {selenium.__version__}')
1105 1109
                return []
1106 1110
        else:
1107 1111
            old_version = False
1108 1112
            if browser != 'firefox' and browser != 'chrome':
1109 1113
                self.log.debug(
1110 -
                    "Generating selenium options. Browser "+browser+". Selenium version "+selenium.__version__)
1114 +
                    f'Generating selenium options. Browser {browser}. Selenium version {selenium.__version__}')
1111 1115
                options.extend([ast.Assign(
1112 1116
                    targets=[ast.Name(id="options")],
1113 1117
                    value=ast_call(
1114 1118
                        func=ast_attr("webdriver.ArgOptions")))])
1115 1119
1116 1120
        for opt in self.executor.settings.get(self.OPTIONS):
1117 -
            self.log.debug("Option "+opt+". Browser "+browser+". Selenium version "+selenium.__version__)
1121 +
            self.log.debug(f'Option {opt}. Browser {browser}. Selenium version {selenium.__version__}')
1118 1122
1119 1123
            if opt == "ignore_proxy":
1120 1124
                options.extend(self._get_ignore_proxy(old_version))
@@ -1125,7 +1129,7 @@
Loading
1125 1129
            elif opt == "preferences":
1126 1130
                options.extend(self._get_preferences(browser))
1127 1131
            else:
1128 -
                self.log.warning("Unknown option " + opt)
1132 +
                self.log.warning(f'Unknown option {opt}')
1129 1133
1130 1134
        return options
1131 1135
@@ -1133,15 +1137,13 @@
Loading
1133 1137
        ignore_proxy = "ignore_proxy"
1134 1138
1135 1139
        if old_version:
1136 -
            self.log.warning("Option "+ignore_proxy+" is not supported for this selenium version")
1140 +
            self.log.warning(f'Option {ignore_proxy} is not supported for this selenium version')
1137 1141
            return []
1138 -
1139 1142
        if self.executor.settings.get(self.OPTIONS).get(ignore_proxy) is not True:
1140 1143
            return []
1141 1144
1142 -
        else:
1143 -
            return [ast.Expr(
1144 -
                ast_call(func=ast_attr("options.ignore_local_proxy_environment_variables")))]
1145 +
        return [ast.Expr(
1146 +
            ast_call(func=ast_attr("options.ignore_local_proxy_environment_variables")))]
1145 1147
1146 1148
    def _get_arguments(self):
1147 1149
        args = []
@@ -1159,40 +1161,34 @@
Loading
1159 1161
        experimental_options = "experimental_options"
1160 1162
1161 1163
        if browser != "chrome":
1162 -
            self.log.warning("Option "+experimental_options+" is not supported for "+browser)
1164 +
            self.log.warning(f'Option {experimental_options} is not supported for {browser}')
1163 1165
            return []
1164 1166
1165 -
        else:
1166 -
            exp_opts = []
1167 -
            keys = sorted(self.executor.settings.get(self.OPTIONS).get(experimental_options))
1168 -
            for key in keys:
1169 -
                value = self.executor.settings.get(self.OPTIONS).get(experimental_options)[key]
1170 -
                exp_opts.append(ast.Expr(ast_call(
1171 -
                    func=ast_attr("options.add_experimental_option"),
1172 -
                    args=[
1173 -
                        [ast.Str(key, kind="")],
1174 -
                        [ast.Str(value, kind="")]])))
1175 -
            return exp_opts
1167 +
        exp_opts = []
1168 +
        for key, value in self.executor.settings.get(self.OPTIONS).get(experimental_options).items():
1169 +
            exp_opts.append(ast.Expr(ast_call(
1170 +
                func=ast_attr("options.add_experimental_option"),
1171 +
                args=[
1172 +
                    [ast.Str(key, kind="")],
1173 +
                    [ast.Str(value, kind="")]])))
1174 +
        return exp_opts
1176 1175
1177 1176
    def _get_preferences(self, browser):
1178 1177
        preferences = "preferences"
1179 1178
1180 1179
        if browser != "firefox":
1181 -
            self.log.warning("Option "+preferences+" is not supported for "+browser)
1180 +
            self.log.warning(f'Option {preferences} is not supported for {browser}')
1182 1181
            return []
1183 1182
1184 -
        else:
1185 -
            prefers = []
1186 -
            keys = sorted(self.executor.settings.get(self.OPTIONS).get(preferences))
1187 -
            for key in keys:
1188 -
                value = self.executor.settings.get(self.OPTIONS).get(preferences)[key]
1189 -
                prefers.append(ast.Expr(ast_call(
1190 -
                    func=ast_attr("options.set_preference"),
1191 -
                    args=[
1192 -
                        [ast.Str(key, kind="")],
1193 -
                        [ast.Str(value, kind="")]])))
1183 +
        prefers = []
1184 +
        for key, value in self.executor.settings.get(self.OPTIONS).get(preferences).items():
1185 +
            prefers.append(ast.Expr(ast_call(
1186 +
                func=ast_attr("options.set_preference"),
1187 +
                args=[
1188 +
                    [ast.Str(key, kind="")],
1189 +
                    [ast.Str(value, kind="")]])))
1194 1190
1195 -
            return prefers
1191 +
        return prefers
1196 1192
1197 1193
    @staticmethod
1198 1194
    def _gen_impl_wait(timeout):
Files Coverage
bzt 90.25%
Project Totals (70 files) 90.25%
9234.2
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: yes
4

5
coverage:
6
  round: up
7

8
ignore:
9
  - bzt/resources
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading