Reference
TestCaseAgent
Reference for the agent
object used in Magnitude tests.
The agent
object is your primary tool for interacting with the browser within a Magnitude test. It’s an instance of the TestCaseAgent
class.
TestCaseAgent
extends BrowserAgent
and includes all of its methods, such as act()
, nav()
, and extract()
.
In addition to the inherited methods, TestCaseAgent
provides the following methods for making assertions:
agent.check(description)
Verifies that a certain condition holds true on the web page based on a natural language description. The AI evaluates the description against the current page state (DOM, visibility, text content).
A natural language statement describing the expected condition or state to verify.