This function loads the all modules in the tests directory into testing environment. :param arguments: this is command line arguments for module name to which test suite will run :type arguments: dict :return module list: test module list :rtype: list
(arguments)
| 202 | |
| 203 | |
| 204 | def get_test_modules(arguments): |
| 205 | """ |
| 206 | This function loads the all modules in the tests directory into testing |
| 207 | environment. |
| 208 | |
| 209 | :param arguments: this is command line arguments for module name to |
| 210 | which test suite will run |
| 211 | :type arguments: dict |
| 212 | :return module list: test module list |
| 213 | :rtype: list |
| 214 | """ |
| 215 | |
| 216 | from pgadmin.utils.route import TestsGeneratorRegistry |
| 217 | |
| 218 | exclude_pkgs = [] |
| 219 | global driver, app_starter, handle_cleanup |
| 220 | |
| 221 | if not config.SERVER_MODE: |
| 222 | # following test cases applicable only for server mode |
| 223 | exclude_pkgs.extend([ |
| 224 | "browser.tests.test_change_password", |
| 225 | "browser.tests.test_gravatar_image_display", |
| 226 | "browser.tests.test_login", |
| 227 | "browser.tests.test_logout", |
| 228 | "browser.tests.test_reset_password", |
| 229 | "browser.tests.test_ldap_login", |
| 230 | "browser.tests.test_ldap_with_mocking", |
| 231 | ]) |
| 232 | if arguments['exclude'] is not None: |
| 233 | exclude_pkgs += arguments['exclude'].split(',') |
| 234 | |
| 235 | if 'feature_tests' not in exclude_pkgs and \ |
| 236 | (arguments['pkg'] is None or arguments['pkg'] == "all" or |
| 237 | arguments['pkg'] == "feature_tests"): |
| 238 | |
| 239 | if arguments['pkg'] == "feature_tests": |
| 240 | exclude_pkgs.extend(['resql']) |
| 241 | |
| 242 | if not test_utils.is_parallel_ui_tests(args): |
| 243 | driver = setup_webdriver_specification(arguments) |
| 244 | app_starter = AppStarter(driver, config) |
| 245 | app_starter.start_app() |
| 246 | |
| 247 | handle_cleanup = test_utils.get_cleanup_handler(test_client, app_starter) |
| 248 | # Register cleanup function to cleanup on exit |
| 249 | atexit.register(handle_cleanup) |
| 250 | |
| 251 | # Load Test modules |
| 252 | module_list = load_modules(arguments, exclude_pkgs) |
| 253 | return module_list |
| 254 | |
| 255 | |
| 256 | def setup_webdriver_specification(arguments): |
no test coverage detected