|
255 | 255 | } |
256 | 256 | ] |
257 | 257 | }, |
| 258 | + "trip.com": { |
| 259 | + "forms": [ |
| 260 | + // This site uses the same form for account creation and login, with differing flow options based on pre-qualifying the email. |
| 261 | + { |
| 262 | + "category": "account-creation", |
| 263 | + // Note, the static class value segment matched elsewhere is not present in every state |
| 264 | + "container": ["div#ibu_login_online form[class]"], |
| 265 | + "fields": { |
| 266 | + "newPassword": [ |
| 267 | + "div#ibu_login_online form[class^='pc-module__form-wrapper__'] input[autocomplete='new-password']" |
| 268 | + ], |
| 269 | + // Note, the form at this stage lacks any static class value |
| 270 | + "username": [ |
| 271 | + "div#ibu_login_online form[class] input[placeholder='Please enter an email address']" |
| 272 | + ] |
| 273 | + }, |
| 274 | + "actions": { |
| 275 | + // "Register and Sign in" |
| 276 | + "submit": [ |
| 277 | + "div#ibu_login_online form[class^='pc-module__form-wrapper__'] button[type='submit']:has(div.tripui-online-btn-content > span.tripui-online-btn-content-children:not(:empty))" |
| 278 | + ], |
| 279 | + // This action is not enclosed by the form container |
| 280 | + "previous": ["div#ibu_login_online div#ibu_login_back"], |
| 281 | + // This action is not enclosed by the form container |
| 282 | + "cancel": ["div#ibu_login_online div#ibu_login_close"], |
| 283 | + "reset": [ |
| 284 | + // Field reset; form class to match against each form state |
| 285 | + "div#ibu_login_online form[class] div#ibu_login_input_clear" |
| 286 | + ] |
| 287 | + } |
| 288 | + }, |
| 289 | + { |
| 290 | + "category": "account-login", |
| 291 | + // Note, the static class value segment matched elsewhere is not present in every state |
| 292 | + "container": ["div#ibu_login_online form[class]"], |
| 293 | + "fields": { |
| 294 | + // signposted as a new password field, but is used for existing password |
| 295 | + "password": [ |
| 296 | + "div#ibu_login_online form[class^='pc-module__form-wrapper__'] input[autocomplete='new-password']" |
| 297 | + ], |
| 298 | + // MFA |
| 299 | + "oneTimeCode": [ |
| 300 | + "div#ibu_login_online form[class] input[autocomplete='one-time-code']" |
| 301 | + ], |
| 302 | + // Note, the form at this stage lacks any static class value |
| 303 | + "username": [ |
| 304 | + "div#ibu_login_online form[class] input[placeholder='Please enter an email address']" |
| 305 | + ] |
| 306 | + }, |
| 307 | + "actions": { |
| 308 | + // "Sign in" |
| 309 | + "submit": [ |
| 310 | + "div#ibu_login_online form[class^='pc-module__form-wrapper__'] button[type='submit']:has(div.tripui-online-btn-content > span.tripui-online-btn-content-children:not(:empty))" |
| 311 | + ], |
| 312 | + // This action is not enclosed by the form container |
| 313 | + "previous": ["div#ibu_login_online div#ibu_login_back"], |
| 314 | + // This action is not enclosed by the form container |
| 315 | + "cancel": ["div#ibu_login_online div#ibu_login_close"], |
| 316 | + "reset": [ |
| 317 | + // Field reset; form class to match against each form state |
| 318 | + "div#ibu_login_online form[class] div#ibu_login_input_clear" |
| 319 | + ] |
| 320 | + } |
| 321 | + } |
| 322 | + ] |
| 323 | + }, |
258 | 324 | "webtests.dev": { |
259 | 325 | "pathnames": { |
260 | 326 | "/forms/login/ambiguous-inputs": { |
|
327 | 393 | "category": "account-login", |
328 | 394 | "container": ["div#form-container >>> form[action='/login']"], |
329 | 395 | "fields": { |
330 | | - // FIXME: brittle selectors needed here since `>>>` requires an unambiguous #shadow-root host |
331 | 396 | "username": [ |
332 | 397 | "div#form-container >>> form[action='/login'] > div:nth-of-type(1) > div >>> input[name='username']" |
333 | 398 | ], |
|
0 commit comments