testdriverai 7.3.12 → 7.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.github/skills/testdriver:ai/SKILL.md +204 -0
  2. package/.github/skills/testdriver:assert/SKILL.md +284 -0
  3. package/.github/skills/testdriver:aws-setup/SKILL.md +515 -0
  4. package/.github/skills/testdriver:caching/SKILL.md +124 -0
  5. package/.github/skills/testdriver:captcha/SKILL.md +159 -0
  6. package/.github/skills/testdriver:ci-cd/SKILL.md +602 -0
  7. package/.github/skills/testdriver:click/SKILL.md +286 -0
  8. package/.github/skills/testdriver:client/SKILL.md +339 -0
  9. package/.github/skills/testdriver:cloud/SKILL.md +119 -0
  10. package/.github/skills/testdriver:customizing-devices/SKILL.md +153 -0
  11. package/.github/skills/testdriver:dashcam/SKILL.md +418 -0
  12. package/.github/skills/testdriver:debugging-with-screenshots/SKILL.md +271 -0
  13. package/.github/skills/testdriver:device-config/SKILL.md +317 -0
  14. package/.github/skills/testdriver:double-click/SKILL.md +102 -0
  15. package/.github/skills/testdriver:elements/SKILL.md +605 -0
  16. package/.github/skills/testdriver:enterprise/SKILL.md +114 -0
  17. package/.github/skills/testdriver:examples/SKILL.md +7 -0
  18. package/.github/skills/testdriver:exec/SKILL.md +345 -0
  19. package/.github/skills/testdriver:find/SKILL.md +721 -0
  20. package/.github/skills/testdriver:focus-application/SKILL.md +293 -0
  21. package/.github/skills/testdriver:generating-tests/SKILL.md +36 -0
  22. package/.github/skills/testdriver:hover/SKILL.md +278 -0
  23. package/.github/skills/testdriver:locating-elements/SKILL.md +71 -0
  24. package/.github/skills/testdriver:making-assertions/SKILL.md +32 -0
  25. package/.github/skills/testdriver:mcp-workflow/SKILL.md +410 -0
  26. package/.github/skills/testdriver:mouse-down/SKILL.md +161 -0
  27. package/.github/skills/testdriver:mouse-up/SKILL.md +164 -0
  28. package/.github/skills/testdriver:performing-actions/SKILL.md +51 -0
  29. package/.github/skills/testdriver:press-keys/SKILL.md +348 -0
  30. package/.github/skills/testdriver:quickstart/SKILL.md +161 -0
  31. package/.github/skills/testdriver:reusable-code/SKILL.md +240 -0
  32. package/.github/skills/testdriver:right-click/SKILL.md +123 -0
  33. package/.github/skills/testdriver:running-tests/SKILL.md +181 -0
  34. package/.github/skills/testdriver:screenshot/SKILL.md +167 -0
  35. package/.github/skills/testdriver:scroll/SKILL.md +299 -0
  36. package/.github/skills/testdriver:secrets/SKILL.md +115 -0
  37. package/.github/skills/testdriver:self-hosted/SKILL.md +65 -0
  38. package/.github/skills/testdriver:test-writer/SKILL.md +451 -0
  39. package/.github/skills/testdriver:testdriver/SKILL.md +523 -0
  40. package/.github/skills/testdriver:testdriver-mechanic/SKILL.md +165 -0
  41. package/.github/skills/testdriver:type/SKILL.md +357 -0
  42. package/.github/skills/testdriver:variables/SKILL.md +111 -0
  43. package/.github/skills/testdriver:waiting-for-elements/SKILL.md +66 -0
  44. package/.github/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  45. package/.github/workflows/acceptance-windows-scheduled.yaml +6 -1
  46. package/.github/workflows/acceptance.yaml +0 -36
  47. package/.github/workflows/update-examples.yaml +53 -0
  48. package/CHANGELOG.md +8 -0
  49. package/agent/events.js +1 -0
  50. package/agent/index.js +8 -0
  51. package/agent/lib/commands.js +48 -29
  52. package/agent/lib/redraw.js +3 -1
  53. package/agent/lib/sandbox.js +166 -14
  54. package/agent/lib/sdk.js +142 -3
  55. package/agent/lib/system.js +4 -6
  56. package/ai/skills/testdriver:ai/SKILL.md +204 -0
  57. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  58. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  59. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  60. package/ai/skills/testdriver:captcha/SKILL.md +159 -0
  61. package/ai/skills/testdriver:ci-cd/SKILL.md +602 -0
  62. package/ai/skills/testdriver:click/SKILL.md +286 -0
  63. package/ai/skills/testdriver:client/SKILL.md +372 -0
  64. package/ai/skills/testdriver:cloud/SKILL.md +119 -0
  65. package/ai/skills/testdriver:customizing-devices/SKILL.md +153 -0
  66. package/ai/skills/testdriver:dashcam/SKILL.md +418 -0
  67. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +401 -0
  68. package/ai/skills/testdriver:device-config/SKILL.md +317 -0
  69. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  70. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  71. package/ai/skills/testdriver:enterprise/SKILL.md +114 -0
  72. package/ai/skills/testdriver:examples/SKILL.md +7 -0
  73. package/ai/skills/testdriver:exec/SKILL.md +345 -0
  74. package/ai/skills/testdriver:find/SKILL.md +745 -0
  75. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  76. package/ai/skills/testdriver:generating-tests/SKILL.md +36 -0
  77. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  78. package/ai/skills/testdriver:locating-elements/SKILL.md +71 -0
  79. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  80. package/ai/skills/testdriver:mcp-workflow/SKILL.md +410 -0
  81. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  82. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  83. package/ai/skills/testdriver:ocr/SKILL.md +235 -0
  84. package/ai/skills/testdriver:performing-actions/SKILL.md +51 -0
  85. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  86. package/ai/skills/testdriver:quickstart/SKILL.md +146 -0
  87. package/ai/skills/testdriver:reusable-code/SKILL.md +240 -0
  88. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  89. package/ai/skills/testdriver:running-tests/SKILL.md +185 -0
  90. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  91. package/ai/skills/testdriver:scroll/SKILL.md +335 -0
  92. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  93. package/ai/skills/testdriver:self-hosted/SKILL.md +65 -0
  94. package/ai/skills/testdriver:test-writer/SKILL.md +451 -0
  95. package/ai/skills/testdriver:testdriver/SKILL.md +631 -0
  96. package/ai/skills/testdriver:testdriver-mechanic/SKILL.md +165 -0
  97. package/ai/skills/testdriver:type/SKILL.md +357 -0
  98. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  99. package/ai/skills/testdriver:waiting-for-elements/SKILL.md +66 -0
  100. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  101. package/debugger/index.html +12 -2
  102. package/docs/v7/examples/scroll-keyboard.mdx +1 -1
  103. package/docs/v7/find.mdx +1 -0
  104. package/examples/config.mjs +1 -1
  105. package/examples/findall-coffee-icons.test.mjs +42 -0
  106. package/examples/flake-diffthreshold-001.test.mjs +9 -0
  107. package/examples/flake-diffthreshold-01.test.mjs +9 -0
  108. package/examples/flake-diffthreshold-05.test.mjs +9 -0
  109. package/examples/{z_flake-noredraw-cache.test.mjs → flake-noredraw-cache.test.mjs} +2 -2
  110. package/examples/{z_flake-noredraw-nocache.test.mjs → flake-noredraw-nocache.test.mjs} +2 -2
  111. package/examples/{z_flake-redraw-cache.test.mjs → flake-redraw-cache.test.mjs} +2 -2
  112. package/examples/{z_flake-redraw-nocache.test.mjs → flake-redraw-nocache.test.mjs} +2 -2
  113. package/examples/flake-rocket-match.test.mjs +30 -0
  114. package/examples/{z_flake-shared.mjs → flake-shared.mjs} +2 -2
  115. package/examples/parse.test.mjs +19 -0
  116. package/examples/scroll-keyboard.test.mjs +1 -1
  117. package/interfaces/cli/lib/base.js +6 -0
  118. package/interfaces/logger.js +51 -13
  119. package/interfaces/vitest-plugin.mjs +137 -0
  120. package/lib/core/index.d.ts +22 -0
  121. package/lib/init-project.js +105 -6
  122. package/lib/vitest/hooks.mjs +2 -5
  123. package/lib/vitest/setup-disable-defender.mjs +52 -0
  124. package/package.json +2 -1
  125. package/sdk-log-formatter.js +90 -0
  126. package/sdk.d.ts +88 -51
  127. package/sdk.js +126 -18
  128. package/setup/aws/disable-defender.sh +42 -0
  129. package/vitest.config.mjs +1 -3
  130. package/examples/z_flake-diffthreshold-001.test.mjs +0 -9
  131. package/examples/z_flake-diffthreshold-01.test.mjs +0 -9
  132. package/examples/z_flake-diffthreshold-05.test.mjs +0 -9
  133. /package/{examples → manual}/captcha-api.test.mjs +0 -0
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: testdriver:ai
3
+ description: Execute natural language tasks using AI
4
+ ---
5
+ <!-- Generated from ai.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ The `ai()` method allows you to execute complex tasks using natural language descriptions. TestDriver's AI will figure out the steps needed to accomplish the task.
10
+
11
+ ## Syntax
12
+
13
+ ```javascript
14
+ await testdriver.ai(task, options)
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ <ParamField path="task" type="string" required>
20
+ Natural language description of what to do
21
+ </ParamField>
22
+
23
+ <ParamField path="options" type="object">
24
+ Execution options
25
+
26
+ <Expandable title="properties">
27
+ <ParamField path="validateAndLoop" type="boolean" default="false">
28
+ Whether to validate completion and retry if incomplete
29
+ </ParamField>
30
+ </Expandable>
31
+ </ParamField>
32
+
33
+ ## Returns
34
+
35
+ `Promise<string | void>` - Final AI response if `validateAndLoop` is true
36
+
37
+ ## Examples
38
+
39
+ ### Basic Usage
40
+
41
+ ```javascript
42
+ // Simple task execution
43
+ await testdriver.ai('Click the submit button');
44
+
45
+ // Complex multi-step task
46
+ await testdriver.ai('Fill out the contact form and submit it');
47
+
48
+ // Navigation task
49
+ await testdriver.ai('Go to the settings page and enable notifications');
50
+ ```
51
+
52
+ ### With Validation
53
+
54
+ ```javascript
55
+ // AI will verify the task completed successfully
56
+ const result = await testdriver.ai('Complete the checkout process', {
57
+ validateAndLoop: true
58
+ });
59
+
60
+ console.log('Task result:', result);
61
+ ```
62
+
63
+ ### Multi-Step Workflows
64
+
65
+ ```javascript
66
+ // The AI will break down complex tasks
67
+ await testdriver.ai('Search for "laptop", add the first result to cart, and proceed to checkout');
68
+
69
+ // UI exploration
70
+ await testdriver.ai('Find and click all menu items to explore the application');
71
+ ```
72
+
73
+ ## Use Cases
74
+
75
+ <AccordionGroup>
76
+ <Accordion title="Exploratory Testing">
77
+ Use AI to explore unfamiliar applications:
78
+
79
+ ```javascript
80
+ await testdriver.ai('Explore the main navigation menu');
81
+ await testdriver.ai('Try to find the user profile settings');
82
+ ```
83
+ </Accordion>
84
+
85
+ <Accordion title="Complex Workflows">
86
+ Let AI handle multi-step processes:
87
+
88
+ ```javascript
89
+ await testdriver.ai('Complete the multi-step registration form');
90
+ await testdriver.ai('Configure all the advanced settings to default values');
91
+ ```
92
+ </Accordion>
93
+
94
+ <Accordion title="Flexible Interactions">
95
+ When exact element locations aren't critical:
96
+
97
+ ```javascript
98
+ await testdriver.ai('Close any popup dialogs');
99
+ await testdriver.ai('Accept the cookie consent if it appears');
100
+ ```
101
+ </Accordion>
102
+ </AccordionGroup>
103
+
104
+ ## Best Practices
105
+
106
+ <Check>
107
+ **Be specific but flexible**: Give enough context without over-constraining the AI
108
+
109
+ ```javascript
110
+ // ✅ Good
111
+ await testdriver.ai('Add the first product to the shopping cart');
112
+
113
+ // ❌ Too vague
114
+ await testdriver.ai('do something');
115
+
116
+ // ❌ Too specific (defeats the purpose)
117
+ await testdriver.ai('click at coordinates 500, 300');
118
+ ```
119
+ </Check>
120
+
121
+ <Check>
122
+ **Use for exploration, not precision**: For critical assertions, use explicit methods
123
+
124
+ ```javascript
125
+ // Use AI for setup
126
+ await testdriver.ai('Navigate to the login page');
127
+
128
+ // Use explicit methods for critical steps
129
+ const usernameField = await testdriver.find('username input');
130
+ await usernameField.click();
131
+ await testdriver.type('testuser');
132
+
133
+ await testdriver.assert('login page is displayed');
134
+ ```
135
+ </Check>
136
+
137
+ <Warning>
138
+ **AI tasks may be slower**: The AI needs to analyze the screen and plan actions. For performance-critical tests, use explicit methods.
139
+ </Warning>
140
+
141
+ ## When to Use AI vs Explicit Methods
142
+
143
+ ### Use `ai()` when:
144
+ - Exploring unfamiliar applications
145
+ - Handling optional UI elements (popups, cookies, etc.)
146
+ - Prototyping tests quickly
147
+ - Tasks where exact steps may vary
148
+
149
+ ### Use explicit methods when:
150
+ - Performance is critical
151
+ - You need precise control
152
+ - Making assertions
153
+ - Debugging test failures
154
+ - Repetitive, predictable actions
155
+
156
+ ## Complete Example
157
+
158
+ ```javascript
159
+ import { beforeAll, afterAll, describe, it } from 'vitest';
160
+ import TestDriver from 'testdriverai';
161
+
162
+ describe('E-commerce Flow with AI', () => {
163
+ let testdriver;
164
+
165
+ beforeAll(async () => {
166
+ client = new TestDriver(process.env.TD_API_KEY);
167
+ await testdriver.auth();
168
+ await testdriver.connect();
169
+ });
170
+
171
+ afterAll(async () => {
172
+ await testdriver.disconnect();
173
+ });
174
+
175
+ it('should complete shopping flow using AI assistance', async () => {
176
+ await testdriver.focusApplication('Google Chrome');
177
+
178
+ // Use AI for navigation and exploration
179
+ await testdriver.ai('Browse to the electronics section');
180
+ await testdriver.ai('Find and add a laptop to the cart');
181
+
182
+ // Use explicit methods for critical steps
183
+ const cartIcon = await testdriver.find('shopping cart icon');
184
+ await cartIcon.click();
185
+
186
+ const total = await testdriver.extract('the cart total amount');
187
+ console.log('Cart total:', total);
188
+
189
+ // Use AI for checkout flow
190
+ await testdriver.ai('Proceed to checkout and fill in shipping details', {
191
+ validateAndLoop: true
192
+ });
193
+
194
+ // Explicit assertion
195
+ await testdriver.assert('order confirmation page is displayed');
196
+ });
197
+ });
198
+ ```
199
+
200
+ ## Related Methods
201
+
202
+ - [`find()`](/v7/find) - Locate specific elements
203
+ - [`assert()`](/v7/assert) - Make assertions
204
+ - [`extract()`](/v7/extract) - Extract information
@@ -0,0 +1,284 @@
1
+ ---
2
+ name: testdriver:assert
3
+ description: Make AI-powered assertions about screen state
4
+ ---
5
+ <!-- Generated from assert.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ Make AI-powered assertions about the current screen state using natural language. The AI analyzes the screen and verifies that your assertion is true.
10
+
11
+ ## Syntax
12
+
13
+ ```javascript
14
+ await testdriver.assert(assertion)
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ <ParamField path="assertion" type="string" required>
20
+ Natural language description of what should be true
21
+ </ParamField>
22
+
23
+ ## Returns
24
+
25
+ `Promise<boolean>` - `true` if assertion passes, throws error if assertion fails
26
+
27
+ ## Examples
28
+
29
+ ### Basic Assertions
30
+
31
+ ```javascript
32
+ // Verify page elements
33
+ await testdriver.assert('the login page is displayed');
34
+ await testdriver.assert('submit button is visible');
35
+ await testdriver.assert('error message is shown');
36
+
37
+ // Verify text content
38
+ await testdriver.assert('the page title is "Welcome"');
39
+ await testdriver.assert('username field contains "john.doe"');
40
+ await testdriver.assert('success message says "Account created"');
41
+
42
+ // Verify states
43
+ await testdriver.assert('the form is empty');
44
+ await testdriver.assert('the checkbox is checked');
45
+ await testdriver.assert('the dropdown shows "United States"');
46
+
47
+ // Verify visual appearance
48
+ await testdriver.assert('the button is blue');
49
+ await testdriver.assert('the loading spinner is displayed');
50
+ await testdriver.assert('the modal dialog is open');
51
+ ```
52
+
53
+ ## Best Practices
54
+
55
+ <Check>
56
+ **Be specific in assertions**
57
+
58
+ More specific assertions are more reliable:
59
+
60
+ ```javascript
61
+ // ❌ Too vague
62
+ await testdriver.assert('button is visible');
63
+
64
+ // ✅ Specific
65
+ await testdriver.assert('blue submit button is visible below the form');
66
+ ```
67
+ </Check>
68
+
69
+ <Check>
70
+ **Assert state changes**
71
+
72
+ Verify state before and after actions:
73
+
74
+ ```javascript
75
+ // Before
76
+ await testdriver.assert('cart is empty');
77
+
78
+ // Action
79
+ const addBtn = await testdriver.find('add to cart');
80
+ await addBtn.click();
81
+
82
+ // After
83
+ await testdriver.assert('cart contains 1 item');
84
+ ```
85
+ </Check>
86
+
87
+ <Check>
88
+ **Use with test framework assertions**
89
+
90
+ Combine AI assertions with traditional test assertions:
91
+
92
+ ```javascript
93
+ // AI assertion
94
+ const result = await testdriver.assert('success message is displayed');
95
+
96
+ // Framework assertion
97
+ expect(result).toBeTruthy();
98
+
99
+ // Extract for detailed comparison
100
+ const message = await testdriver.extract('the success message text');
101
+ expect(message).toContain('successfully');
102
+ ```
103
+ </Check>
104
+
105
+ ## Polling Assertions
106
+
107
+ For conditions that may take time to become true:
108
+
109
+ ```javascript
110
+ async function waitForAssertion(testdriver, assertion, timeout = 30000) {
111
+ const startTime = Date.now();
112
+
113
+ while (Date.now() - startTime < timeout) {
114
+ try {
115
+ await testdriver.assert(assertion);
116
+ return true; // Assertion passed
117
+ } catch (error) {
118
+ // Assertion failed, wait and retry
119
+ await new Promise(r => setTimeout(r, 1000));
120
+ }
121
+ }
122
+
123
+ throw new Error(`Assertion timeout: "${assertion}"`);
124
+ }
125
+
126
+ // Usage
127
+ await waitForAssertion(testdriver, 'page has finished loading', 30000);
128
+ await waitForAssertion(testdriver, 'results are displayed', 10000);
129
+ ```
130
+
131
+ ## Use Cases
132
+
133
+ <AccordionGroup>
134
+ <Accordion title="Form Validation">
135
+ ```javascript
136
+ // Try to submit empty form
137
+ const submitBtn = await testdriver.find('submit button');
138
+ await submitBtn.click();
139
+
140
+ // Verify validation errors
141
+ await testdriver.assert('email field shows "required" error');
142
+ await testdriver.assert('password field shows "required" error');
143
+
144
+ // Verify form not submitted
145
+ await testdriver.assert('still on the form page');
146
+ ```
147
+ </Accordion>
148
+
149
+ <Accordion title="Page Navigation">
150
+ ```javascript
151
+ const loginBtn = await testdriver.find('login button');
152
+ await loginBtn.click();
153
+
154
+ // Verify navigation
155
+ await testdriver.assert('user dashboard is displayed');
156
+ await testdriver.assert('welcome message shows user name');
157
+ await testdriver.assert('logout button is visible');
158
+ ```
159
+ </Accordion>
160
+
161
+ <Accordion title="Dynamic Content">
162
+ ```javascript
163
+ const loadBtn = await testdriver.find('load more button');
164
+ await loadBtn.click();
165
+
166
+ // Poll for content using helper
167
+ await waitForAssertion(testdriver, 'more than 10 items are shown', 10000);
168
+ await testdriver.assert('load more button is still visible');
169
+ ```
170
+ </Accordion>
171
+
172
+ <Accordion title="Visual States">
173
+ ```javascript
174
+ // Verify hover effect
175
+ const button = await testdriver.find('primary button');
176
+ await button.hover();
177
+
178
+ await testdriver.assert('button background is darker');
179
+
180
+ // Verify button is enabled
181
+ await testdriver.assert('submit button is enabled');
182
+ ```
183
+ </Accordion>
184
+
185
+ <Accordion title="Multi-Step Workflows">
186
+ ```javascript
187
+ // Step 1
188
+ await testdriver.assert('step 1 is active');
189
+ const nextBtn = await testdriver.find('next button');
190
+ await nextBtn.click();
191
+
192
+ // Step 2
193
+ await testdriver.assert('step 2 is active');
194
+ await testdriver.assert('step 1 is completed');
195
+ await nextBtn.click();
196
+
197
+ // Step 3
198
+ await testdriver.assert('step 3 is active');
199
+ await testdriver.assert('step 2 is completed');
200
+ ```
201
+ </Accordion>
202
+ </AccordionGroup>
203
+
204
+ ## Complete Example
205
+
206
+ ```javascript
207
+ import { beforeAll, afterAll, describe, it, expect } from 'vitest';
208
+ import TestDriver from 'testdriverai';
209
+
210
+ describe('Assertions', () => {
211
+ let testdriver;
212
+
213
+ beforeAll(async () => {
214
+ client = new TestDriver(process.env.TD_API_KEY);
215
+ await testdriver.auth();
216
+ await testdriver.connect();
217
+ });
218
+
219
+ afterAll(async () => {
220
+ await testdriver.disconnect();
221
+ });
222
+
223
+ it('should validate login flow', async () => {
224
+ await testdriver.focusApplication('Google Chrome');
225
+
226
+ // Verify initial state
227
+ await testdriver.assert('the login page is displayed');
228
+ await testdriver.assert('username field is empty');
229
+ await testdriver.assert('password field is empty');
230
+
231
+ // Fill form
232
+ const usernameField = await testdriver.find('username input');
233
+ await usernameField.click();
234
+ await testdriver.type('testuser');
235
+
236
+ await testdriver.pressKeys(['tab']);
237
+ await testdriver.type('password123');
238
+
239
+ // Verify fields filled
240
+ await testdriver.assert('username field contains "testuser"');
241
+ await testdriver.assert('password field is not empty');
242
+
243
+ // Submit
244
+ await testdriver.pressKeys(['enter']);
245
+
246
+ // Poll for success
247
+ await waitForAssertion(testdriver, 'user dashboard is displayed', 10000);
248
+
249
+ // Verify logged in state
250
+ await testdriver.assert('welcome message is shown');
251
+ await testdriver.assert('logout button is visible');
252
+
253
+ // Verify login page is gone
254
+ await testdriver.assert('login form is displayed', false, true);
255
+ });
256
+
257
+ it('should show validation errors', async () => {
258
+ // Try empty submission
259
+ const submitBtn = await testdriver.find('submit button');
260
+ await submitBtn.click();
261
+
262
+ // Verify multiple errors
263
+ const errors = [
264
+ 'email field shows error',
265
+ 'name field shows error',
266
+ 'password field shows error'
267
+ ];
268
+
269
+ for (const error of errors) {
270
+ const result = await testdriver.assert(error);
271
+ expect(result).toBeTruthy();
272
+ }
273
+
274
+ // Verify not submitted
275
+ await testdriver.assert('confirmation page is shown', false, true);
276
+ });
277
+ });
278
+ ```
279
+
280
+ ## Related Methods
281
+
282
+ - [`extract()`](/v7/extract) - Extract information for detailed assertions
283
+ - [`find()`](/v7/find) - Locate elements to verify
284
+ - [`ai()`](/v7/ai) - Complex AI-driven tasks