intellitester 0.2.71 → 0.2.72
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.
- package/README.md +57 -0
- package/dist/cli/index.cjs +193 -0
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +193 -0
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,6 +113,63 @@ When execution pauses, you can:
|
|
|
113
113
|
- Examine selectors and elements
|
|
114
114
|
- Continue execution when ready
|
|
115
115
|
|
|
116
|
+
## Iframe Targeting (frame)
|
|
117
|
+
|
|
118
|
+
Target elements inside iframes using the `frame` property. Essential for payment forms (Stripe, PayPal), embedded widgets, and third-party integrations.
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
steps:
|
|
122
|
+
# Wait for Stripe iframe to load
|
|
123
|
+
- type: wait
|
|
124
|
+
target: { css: "div.__PrivateStripeElement iframe" }
|
|
125
|
+
timeout: 10000
|
|
126
|
+
|
|
127
|
+
# Type card number inside iframe
|
|
128
|
+
- type: type
|
|
129
|
+
target: { css: "[placeholder='Card number']" }
|
|
130
|
+
frame:
|
|
131
|
+
css: "div.__PrivateStripeElement iframe"
|
|
132
|
+
index: 0
|
|
133
|
+
value: "4242424242424242"
|
|
134
|
+
delay: 50
|
|
135
|
+
|
|
136
|
+
# Type expiry inside iframe
|
|
137
|
+
- type: type
|
|
138
|
+
target: { css: "[placeholder='MM / YY']" }
|
|
139
|
+
frame:
|
|
140
|
+
css: "div.__PrivateStripeElement iframe"
|
|
141
|
+
index: 0
|
|
142
|
+
value: "12/34"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Frame locator properties:**
|
|
146
|
+
|
|
147
|
+
| Property | Description |
|
|
148
|
+
|----------|-------------|
|
|
149
|
+
| `css` | CSS selector for the iframe element |
|
|
150
|
+
| `name` | Name or id attribute of the iframe |
|
|
151
|
+
| `index` | Zero-based index when multiple iframes match (default: 0) |
|
|
152
|
+
|
|
153
|
+
**Supported actions:** `tap`, `input`, `type`, `clear`, `hover`, `press`, `focus`, `assert`, `wait`, `waitForSelector`
|
|
154
|
+
|
|
155
|
+
## Character-by-Character Typing (type)
|
|
156
|
+
|
|
157
|
+
Use the `type` action for inputs that require character-by-character entry (like Stripe payment fields, autocomplete, or inputs with per-keystroke validation). Unlike `input` which clears first, `type` appends characters one at a time.
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
steps:
|
|
161
|
+
# Use 'type' for Stripe (validates each keystroke)
|
|
162
|
+
- type: type
|
|
163
|
+
target: { testId: card-number }
|
|
164
|
+
value: "4242424242424242"
|
|
165
|
+
delay: 50 # ms between keystrokes (default: 50)
|
|
166
|
+
|
|
167
|
+
# Use 'input' for normal form fields (faster, clears first)
|
|
168
|
+
- type: input
|
|
169
|
+
target: { testId: email }
|
|
170
|
+
value: "test@example.com"
|
|
171
|
+
```
|
|
172
|
+
|
|
116
173
|
## Fast-Fail Conditions (errorIf)
|
|
117
174
|
|
|
118
175
|
Use `errorIf` to fail a step immediately when a condition is met, without waiting for timeouts:
|
package/dist/cli/index.cjs
CHANGED
|
@@ -1765,6 +1765,26 @@ Type text into an input field. Clears existing content first.
|
|
|
1765
1765
|
value: "{{randomUsername}}"
|
|
1766
1766
|
\`\`\`
|
|
1767
1767
|
|
|
1768
|
+
#### \`type\`
|
|
1769
|
+
Type text character-by-character WITHOUT clearing first. Use for special inputs like Stripe payment fields, autocomplete, or inputs that validate on each keystroke.
|
|
1770
|
+
|
|
1771
|
+
\`\`\`yaml
|
|
1772
|
+
# Basic character-by-character typing
|
|
1773
|
+
- type: type
|
|
1774
|
+
target: { testId: card-number }
|
|
1775
|
+
value: "4242424242424242"
|
|
1776
|
+
|
|
1777
|
+
# With custom delay between keystrokes (default: 50ms)
|
|
1778
|
+
- type: type
|
|
1779
|
+
target: { css: "[placeholder='Card number']" }
|
|
1780
|
+
value: "4242424242424242"
|
|
1781
|
+
delay: 100
|
|
1782
|
+
\`\`\`
|
|
1783
|
+
|
|
1784
|
+
**When to use \`type\` vs \`input\`:**
|
|
1785
|
+
- Use \`input\` for normal form fields (faster, clears first)
|
|
1786
|
+
- Use \`type\` for special inputs like Stripe, password strength meters, or autocomplete fields
|
|
1787
|
+
|
|
1768
1788
|
#### \`clear\`
|
|
1769
1789
|
Clear the contents of an input field.
|
|
1770
1790
|
|
|
@@ -2091,6 +2111,125 @@ target:
|
|
|
2091
2111
|
|
|
2092
2112
|
---
|
|
2093
2113
|
|
|
2114
|
+
## Iframe Targeting with \`frame\`
|
|
2115
|
+
|
|
2116
|
+
Many actions support a \`frame\` property to target elements inside iframes. This is essential for payment forms (Stripe, PayPal), embedded widgets, and third-party integrations.
|
|
2117
|
+
|
|
2118
|
+
### Frame Locator Properties
|
|
2119
|
+
|
|
2120
|
+
| Property | Description |
|
|
2121
|
+
|----------|-------------|
|
|
2122
|
+
| \`css\` | CSS selector for the iframe element |
|
|
2123
|
+
| \`name\` | Name or id attribute of the iframe |
|
|
2124
|
+
| \`index\` | Zero-based index when multiple iframes match (default: 0) |
|
|
2125
|
+
|
|
2126
|
+
### Basic Usage
|
|
2127
|
+
|
|
2128
|
+
\`\`\`yaml
|
|
2129
|
+
# Target element inside an iframe by CSS selector
|
|
2130
|
+
- type: type
|
|
2131
|
+
target: { css: "[placeholder='Card number']" }
|
|
2132
|
+
frame:
|
|
2133
|
+
css: "iframe.payment-frame"
|
|
2134
|
+
value: "4242424242424242"
|
|
2135
|
+
|
|
2136
|
+
# Target iframe by name attribute
|
|
2137
|
+
- type: input
|
|
2138
|
+
target: { testId: email-field }
|
|
2139
|
+
frame:
|
|
2140
|
+
name: checkout-iframe
|
|
2141
|
+
value: "test@example.com"
|
|
2142
|
+
|
|
2143
|
+
# When multiple iframes match, use index
|
|
2144
|
+
- type: type
|
|
2145
|
+
target: { css: "input" }
|
|
2146
|
+
frame:
|
|
2147
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2148
|
+
index: 0
|
|
2149
|
+
value: "4242424242424242"
|
|
2150
|
+
\`\`\`
|
|
2151
|
+
|
|
2152
|
+
### Supported Actions with \`frame\`
|
|
2153
|
+
|
|
2154
|
+
These actions support the \`frame\` property:
|
|
2155
|
+
- \`tap\` - Click inside iframe
|
|
2156
|
+
- \`input\` - Fill text inside iframe
|
|
2157
|
+
- \`type\` - Type character-by-character inside iframe
|
|
2158
|
+
- \`clear\` - Clear input inside iframe
|
|
2159
|
+
- \`hover\` - Hover element inside iframe
|
|
2160
|
+
- \`press\` - Press key inside iframe
|
|
2161
|
+
- \`focus\` - Focus element inside iframe
|
|
2162
|
+
- \`assert\` - Assert element inside iframe
|
|
2163
|
+
- \`wait\` - Wait for element inside iframe
|
|
2164
|
+
- \`waitForSelector\` - Wait for element state inside iframe
|
|
2165
|
+
|
|
2166
|
+
### Stripe Checkout Example
|
|
2167
|
+
|
|
2168
|
+
\`\`\`yaml
|
|
2169
|
+
name: Stripe Checkout
|
|
2170
|
+
platform: web
|
|
2171
|
+
variables:
|
|
2172
|
+
CARD_NUMBER: "4242424242424242"
|
|
2173
|
+
CARD_EXPIRY: "12/34"
|
|
2174
|
+
CARD_CVC: "123"
|
|
2175
|
+
steps:
|
|
2176
|
+
- type: navigate
|
|
2177
|
+
value: /checkout
|
|
2178
|
+
|
|
2179
|
+
# Wait for Stripe iframe to load
|
|
2180
|
+
- type: wait
|
|
2181
|
+
target:
|
|
2182
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2183
|
+
timeout: 10000
|
|
2184
|
+
|
|
2185
|
+
# Type card number (character-by-character for Stripe validation)
|
|
2186
|
+
- type: type
|
|
2187
|
+
target:
|
|
2188
|
+
css: "[placeholder='Card number']"
|
|
2189
|
+
frame:
|
|
2190
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2191
|
+
index: 0
|
|
2192
|
+
value: "\${CARD_NUMBER}"
|
|
2193
|
+
delay: 50
|
|
2194
|
+
|
|
2195
|
+
# Type expiry
|
|
2196
|
+
- type: type
|
|
2197
|
+
target:
|
|
2198
|
+
css: "[placeholder='MM / YY']"
|
|
2199
|
+
frame:
|
|
2200
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2201
|
+
index: 0
|
|
2202
|
+
value: "\${CARD_EXPIRY}"
|
|
2203
|
+
|
|
2204
|
+
# Type CVC
|
|
2205
|
+
- type: type
|
|
2206
|
+
target:
|
|
2207
|
+
css: "[placeholder='CVC']"
|
|
2208
|
+
frame:
|
|
2209
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2210
|
+
index: 0
|
|
2211
|
+
value: "\${CARD_CVC}"
|
|
2212
|
+
|
|
2213
|
+
# Submit (on main page, not in iframe)
|
|
2214
|
+
- type: tap
|
|
2215
|
+
target: { testId: pay-button }
|
|
2216
|
+
|
|
2217
|
+
- type: assert
|
|
2218
|
+
target: { text: "Payment successful" }
|
|
2219
|
+
\`\`\`
|
|
2220
|
+
|
|
2221
|
+
### Common Iframe Selectors
|
|
2222
|
+
|
|
2223
|
+
| Service | Typical Selector |
|
|
2224
|
+
|---------|------------------|
|
|
2225
|
+
| Stripe Elements | \`div.__PrivateStripeElement iframe\` |
|
|
2226
|
+
| Stripe Checkout | \`iframe[name*='stripe']\` |
|
|
2227
|
+
| PayPal | \`iframe[name*='paypal']\` |
|
|
2228
|
+
| reCAPTCHA | \`iframe[title*='reCAPTCHA']\` |
|
|
2229
|
+
| YouTube | \`iframe[src*='youtube.com']\` |
|
|
2230
|
+
|
|
2231
|
+
---
|
|
2232
|
+
|
|
2094
2233
|
## Variables & Interpolation
|
|
2095
2234
|
|
|
2096
2235
|
### Defining Variables
|
|
@@ -2627,6 +2766,60 @@ steps:
|
|
|
2627
2766
|
value: "100-500"
|
|
2628
2767
|
\`\`\`
|
|
2629
2768
|
|
|
2769
|
+
### Payment with Stripe
|
|
2770
|
+
|
|
2771
|
+
\`\`\`yaml
|
|
2772
|
+
name: Stripe Payment
|
|
2773
|
+
platform: web
|
|
2774
|
+
variables:
|
|
2775
|
+
# Stripe test card numbers:
|
|
2776
|
+
# 4242424242424242 - Succeeds
|
|
2777
|
+
# 4000000000000002 - Declined
|
|
2778
|
+
CARD_NUMBER: "4242424242424242"
|
|
2779
|
+
CARD_EXPIRY: "12/34"
|
|
2780
|
+
CARD_CVC: "123"
|
|
2781
|
+
steps:
|
|
2782
|
+
- type: navigate
|
|
2783
|
+
value: /checkout
|
|
2784
|
+
|
|
2785
|
+
# Wait for Stripe to initialize
|
|
2786
|
+
- type: wait
|
|
2787
|
+
target: { css: "div.__PrivateStripeElement iframe" }
|
|
2788
|
+
timeout: 10000
|
|
2789
|
+
|
|
2790
|
+
# Fill card details (use 'type' not 'input' for Stripe)
|
|
2791
|
+
- type: type
|
|
2792
|
+
target: { css: "[placeholder='Card number']" }
|
|
2793
|
+
frame:
|
|
2794
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2795
|
+
index: 0
|
|
2796
|
+
value: \${CARD_NUMBER}
|
|
2797
|
+
delay: 50
|
|
2798
|
+
|
|
2799
|
+
- type: type
|
|
2800
|
+
target: { css: "[placeholder='MM / YY']" }
|
|
2801
|
+
frame:
|
|
2802
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2803
|
+
index: 0
|
|
2804
|
+
value: \${CARD_EXPIRY}
|
|
2805
|
+
|
|
2806
|
+
- type: type
|
|
2807
|
+
target: { css: "[placeholder='CVC']" }
|
|
2808
|
+
frame:
|
|
2809
|
+
css: "div.__PrivateStripeElement iframe"
|
|
2810
|
+
index: 0
|
|
2811
|
+
value: \${CARD_CVC}
|
|
2812
|
+
|
|
2813
|
+
# Submit payment
|
|
2814
|
+
- type: tap
|
|
2815
|
+
target: { testId: submit-payment }
|
|
2816
|
+
|
|
2817
|
+
# Verify success
|
|
2818
|
+
- type: wait
|
|
2819
|
+
target: { text: "Payment successful" }
|
|
2820
|
+
timeout: 30000
|
|
2821
|
+
\`\`\`
|
|
2822
|
+
|
|
2630
2823
|
---
|
|
2631
2824
|
|
|
2632
2825
|
Generated by IntelliTester v1.0.0
|