limelight.components.confirm
¶
Confirm
¶
A driver for the inline prompt that stands between an action and its effect.
This class clicks the button that carries the action through, and waits for the button to appear before drawing anything over it. The search considers only visible buttons, because a page that renders one prompt per row keeps each unopened prompt in the markup.
The click is left unbarriered on purpose. A prompt sits in front of anything from a form post to a background write, so the caller wraps the accept in the barrier that proves its own effect landed.
The constructor for the Confirm class.
Parameters:
-
demo(Demo) –The demo driving the browser.
-
root(Locator | None, default:None) –The region holding the prompt, or None for the whole page.
Source code in limelight/components/confirm.py
button_selector = 'button'
class-attribute
instance-attribute
¶
demo = demo
instance-attribute
¶
root = root
instance-attribute
¶
accept
¶
A method that carries the action through.
Parameters:
-
text(str, default:'') –The text on the button, or an empty string for the only one.
-
label(str, default:'') –The spotlight caption, defaulting to the button text.
Raises:
-
AssertionError–If the button never appears.
Source code in limelight/components/confirm.py
button
¶
A method that gets the button that carries the action through.
Parameters:
-
text(str, default:'') –The text on the button, or an empty string for the only one.
Returns:
-
Locator–The locator for the button.