module SessionContext
The session context provides a way to manage the lifecycle of a WebDriver session.
Nested
Definitions
def session
The current session, that represents the browser window.
Implementation
def session
@session ||= make_session
end
def find_element(...)
Find an element within the current session.
Signature
-
parameter
locator
Hash
The locator to use to find the element.
Implementation
def find_element(...)
session.find_element(::Async::WebDriver::Locator.wrap(...))
end
def find_elements(...)
Find all elements matching the given locator.
Signature
-
parameter
locator
Hash
The locator to use to find the elements.
Implementation
def find_elements(...)
session.find_elements(::Async::WebDriver::Locator.wrap(...))
end
def have_element(...)
Check if the current session has an element matching the given locator.
Implementation
def have_element(...)
HaveElement.new(::Async::WebDriver::Locator.wrap(...))
end
def have_properties(**properties)
Check if an element has properties matching the given key-value pairs.
Implementation
def have_properties(**properties)
predicates = properties.map do |key, value|
HaveProperty.new(key, value)
end
Sus::Have::All.new(predicates)
end