MCPcopy Create free account
hub / github.com/microsoft/playwright-python / snapshot_frame

Method snapshot_frame

tests/sync/conftest.py:156–163  ·  view source on GitHub ↗
(
        self, action_name: str, ordinal: int = 0, has_subframe: bool = False
    )

Source from the content-addressed store, hash-verified

154 self.page.click(f'.snapshot-tab .tabbed-pane-tab-label:has-text("{name}")')
155
156 def snapshot_frame(
157 self, action_name: str, ordinal: int = 0, has_subframe: bool = False
158 ) -> FrameLocator:
159 self.select_action(action_name, ordinal)
160 expected_frames = 4 if has_subframe else 3
161 while len(self.page.frames) < expected_frames:
162 self.page.wait_for_event("frameattached")
163 return self.page.frame_locator("iframe.snapshot-visible[name=snapshot]")
164
165 def show_source_tab(self) -> None:
166 self.page.click("text='Source'")

Calls 3

select_actionMethod · 0.95
wait_for_eventMethod · 0.45
frame_locatorMethod · 0.45

Tested by

no test coverage detected