MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / __get_display_id

Method __get_display_id

seleniumbase/fixtures/base_case.py:16591–16624  ·  view source on GitHub ↗

The id for running a test from pytest. (Displayed on Dashboard)

(self)

Source from the content-addressed store, hash-verified

16589 return test_id
16590
16591 def __get_display_id(self):
16592 """The id for running a test from pytest. (Displayed on Dashboard)"""
16593 if "PYTEST_CURRENT_TEST" in os.environ:
16594 full_name = os.environ["PYTEST_CURRENT_TEST"]
16595 if "] " in full_name:
16596 return full_name.split("] ")[0] + "]"
16597 else:
16598 return full_name.split(" ")[0]
16599 if getattr(self, "is_behave", None):
16600 file_name = sb_config.behave_scenario.filename
16601 line_num = sb_config.behave_line_num
16602 scenario_name = sb_config.behave_scenario.name
16603 if " -- @" in scenario_name:
16604 scenario_name = scenario_name.split(" # ")[0].rstrip()
16605 test_id = "%s:%s => %s" % (file_name, line_num, scenario_name)
16606 return test_id
16607 test_id = "%s.py::%s::%s" % (
16608 self.__class__.__module__.replace(".", "/"),
16609 self.__class__.__name__,
16610 self._testMethodName,
16611 )
16612 if self._sb_test_identifier and len(str(self._sb_test_identifier)) > 6:
16613 test_id = self._sb_test_identifier
16614 if hasattr(self, "_using_sb_fixture_class"):
16615 if test_id.count(".") >= 2:
16616 parts = test_id.split(".")
16617 full = parts[-3] + ".py::" + parts[-2] + "::" + parts[-1]
16618 test_id = full
16619 elif hasattr(self, "_using_sb_fixture_no_class"):
16620 if test_id.count(".") >= 1:
16621 parts = test_id.split(".")
16622 full = parts[-2] + ".py::" + parts[-1]
16623 test_id = full
16624 return test_id
16625
16626 def __get_filename(self):
16627 """The filename of the current SeleniumBase test. (NOT Path)"""

Callers 2

check_windowMethod · 0.95
__process_dashboardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected