Commit 0d2b398
authored
clean up page methods (#1407)
# why
Currently we use multiple overloads for click, scroll, and draganddrop
# what changed
simplified code to always return a value, that is either an xpath, or
empty string
# test plan
updated tests, and ran them
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Simplified page interaction methods by removing overloads and making
returns predictable. click(), hover(), and scroll() now always return a
string, and dragAndDrop() returns [fromXpath, toXpath], using empty
strings when no XPath is available.
- **Refactors**
- Removed TypeScript overloads for Page.click, Page.hover, Page.scroll,
and Page.dragAndDrop.
- click/hover/scroll now return an XPath string or "".
- dragAndDrop returns [fromXpath, toXpath] or ["", ""].
- Updated tests to assert empty strings instead of undefined.
- **Migration**
- Replace any undefined checks with "" (and ["", ""] for dragAndDrop).
<sup>Written for commit 0d162af.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->1 parent 6a5496f commit 0d2b398
File tree
5 files changed
+25
-111
lines changed- .changeset
- packages/core/lib/v3
- tests
- understudy
5 files changed
+25
-111
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1275 | 1275 | | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | 1278 | | |
1306 | 1279 | | |
1307 | 1280 | | |
| |||
1311 | 1284 | | |
1312 | 1285 | | |
1313 | 1286 | | |
1314 | | - | |
| 1287 | + | |
1315 | 1288 | | |
1316 | 1289 | | |
1317 | 1290 | | |
| |||
1377 | 1350 | | |
1378 | 1351 | | |
1379 | 1352 | | |
1380 | | - | |
| 1353 | + | |
| 1354 | + | |
1381 | 1355 | | |
1382 | 1356 | | |
1383 | 1357 | | |
1384 | 1358 | | |
1385 | 1359 | | |
1386 | 1360 | | |
1387 | 1361 | | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | 1362 | | |
1399 | 1363 | | |
1400 | 1364 | | |
1401 | 1365 | | |
1402 | 1366 | | |
1403 | | - | |
| 1367 | + | |
1404 | 1368 | | |
1405 | 1369 | | |
1406 | 1370 | | |
| |||
1443 | 1407 | | |
1444 | 1408 | | |
1445 | 1409 | | |
1446 | | - | |
| 1410 | + | |
1447 | 1411 | | |
1448 | 1412 | | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | 1413 | | |
1471 | 1414 | | |
1472 | 1415 | | |
1473 | 1416 | | |
1474 | 1417 | | |
1475 | 1418 | | |
1476 | 1419 | | |
1477 | | - | |
| 1420 | + | |
1478 | 1421 | | |
1479 | 1422 | | |
1480 | 1423 | | |
| |||
1503 | 1446 | | |
1504 | 1447 | | |
1505 | 1448 | | |
1506 | | - | |
| 1449 | + | |
1507 | 1450 | | |
1508 | 1451 | | |
1509 | 1452 | | |
1510 | 1453 | | |
1511 | 1454 | | |
1512 | 1455 | | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | 1456 | | |
1550 | 1457 | | |
1551 | 1458 | | |
| |||
1558 | 1465 | | |
1559 | 1466 | | |
1560 | 1467 | | |
1561 | | - | |
| 1468 | + | |
1562 | 1469 | | |
1563 | 1470 | | |
1564 | 1471 | | |
| |||
1642 | 1549 | | |
1643 | 1550 | | |
1644 | 1551 | | |
1645 | | - | |
| 1552 | + | |
1646 | 1553 | | |
1647 | 1554 | | |
1648 | 1555 | | |
| |||
0 commit comments