SeleniumBase Dashboard Processing
(self, has_exception, init=False)
| 16656 | self.__process_dashboard(has_exception, init) |
| 16657 | |
| 16658 | def __process_dashboard(self, has_exception, init=False): |
| 16659 | """SeleniumBase Dashboard Processing""" |
| 16660 | if ( |
| 16661 | self.is_pytest |
| 16662 | and "--pdb" in sys.argv |
| 16663 | and has_exception |
| 16664 | ): |
| 16665 | sb_config._pdb_failure = True |
| 16666 | elif ( |
| 16667 | self.is_pytest |
| 16668 | and getattr(sb_config, "_pdb_failure", None) |
| 16669 | and not has_exception |
| 16670 | ): |
| 16671 | return # Handle case where "pytest --pdb" marks failures as Passed |
| 16672 | if self._multithreaded: |
| 16673 | existing_res = sb_config._results # For recording "Skipped" tests |
| 16674 | abs_path = os.path.abspath(".") |
| 16675 | dash_json_loc = constants.Dashboard.DASH_JSON |
| 16676 | dash_jsonpath = os.path.join(abs_path, dash_json_loc) |
| 16677 | if not init and os.path.exists(dash_jsonpath): |
| 16678 | with open(dash_jsonpath, "r") as f: |
| 16679 | dash_json = f.read().strip() |
| 16680 | dash_data, d_id, dash_rt, tlp, d_stats = json.loads(dash_json) |
| 16681 | num_passed, num_failed, num_skipped, num_untested = d_stats |
| 16682 | sb_config._results = dash_data |
| 16683 | sb_config._display_id = d_id |
| 16684 | sb_config._duration = dash_rt # Dashboard Run Time |
| 16685 | sb_config._d_t_log_path = tlp # Test Log Path |
| 16686 | sb_config.item_count_passed = num_passed |
| 16687 | sb_config.item_count_failed = num_failed |
| 16688 | sb_config.item_count_skipped = num_skipped |
| 16689 | sb_config.item_count_untested = num_untested |
| 16690 | if len(sb_config._extra_dash_entries) > 0: |
| 16691 | # First take care of existing entries from non-SeleniumBase tests |
| 16692 | for test_id in sb_config._extra_dash_entries: |
| 16693 | if test_id in sb_config._results.keys(): |
| 16694 | if sb_config._results[test_id] == "Skipped": |
| 16695 | sb_config.item_count_skipped += 1 |
| 16696 | sb_config.item_count_untested -= 1 |
| 16697 | elif sb_config._results[test_id] == "Failed": |
| 16698 | sb_config.item_count_failed += 1 |
| 16699 | sb_config.item_count_untested -= 1 |
| 16700 | elif sb_config._results[test_id] == "Passed": |
| 16701 | sb_config.item_count_passed += 1 |
| 16702 | sb_config.item_count_untested -= 1 |
| 16703 | else: # Mark "Skipped" if unknown |
| 16704 | sb_config.item_count_skipped += 1 |
| 16705 | sb_config.item_count_untested -= 1 |
| 16706 | sb_config._extra_dash_entries = [] # Reset the list to empty |
| 16707 | # Process new entries |
| 16708 | log_dir = self.log_path |
| 16709 | ft_id = self.__get_test_id() # Full test id with path to log files |
| 16710 | test_id = self.__get_test_id_2() # The test id used by the DashBoard |
| 16711 | dud = "seleniumbase/plugins/pytest_plugin.py::BaseClass::base_method" |
| 16712 | dud2 = "pytest_plugin.BaseClass.base_method" |
| 16713 | if hasattr(self, "_using_sb_fixture") and self.__will_be_skipped: |
| 16714 | test_id = sb_config._test_id |
| 16715 | if not init: |
no test coverage detected