playwright/tests
오소현 8761dafc73
feat(test runner): allow to pass arbitrary location to test.step (#32504)
Fixes https://github.com/microsoft/playwright/issues/30160

### Description:
This pull request introduces the ability to specify custom locations for
test steps in Playwright. By enabling the provision of arbitrary
locations to the test.step method, it resolves the limitation where
helper methods obfuscate the original call site, providing more accurate
and meaningful location data in test reports.

### Motivation:
To enhance the utility and clarity of test reports in Playwright.
Specifically, it addresses the need to trace test steps back to their
precise location in the code, which is especially important when steps
are abstracted in helper functions. This feature is crucial for
maintaining accurate documentation and facilitating debugging processes.

### Changes:
Added functionality to pass a custom location object to test.step.

### Expected Outcome:
This PR is expected to significantly improve the precision and
usefulness of diagnostic data in test reports by allowing specific
locations within helper functions to be accurately documented. It
facilitates better tracking of test executions and simplifies the
debugging process, making it easier for developers to understand and
address issues within complex tests.

### References:
Closes https://github.com/microsoft/playwright/issues/30160 -
"[Feature]: allow to pass arbitrary location to test.step"

**Code Check**
I conducted tests on this new feature by integrating it into some
existing test codes, and it worked well. I will attach the code used for
testing and a screenshot showing the successful outcome.

<details>
<summary>toggle dropdown</summary>
<div markdown="1">

```
import type { Location } from '../../../packages/playwright/types/testReporter'
...
test('should respect the back button', async ({ page }) => {
    await page.locator('.todo-list li .toggle').nth(1).check();
    await checkNumberOfCompletedTodosInLocalStorage(page, 1);
...
    await test.step('Showing active items', async () => {
      await page.getByRole('link', { name: 'Active' }).click();
    }, {location});
```

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/359feafa-0949-4c71-9426-46debef21bdd">
</div>
</details>
2024-09-17 08:11:21 -07:00
..
android test: update to android-35 SDK (Android 15) (#32430) 2024-09-06 14:27:56 +02:00
assets feat(ui-mode): display list of query params in request tab (#32443) 2024-09-04 07:54:44 -07:00
bidi chore: do not store project name in expectations (#32575) 2024-09-11 15:15:10 -07:00
components fix(ct): throw error if inline component is getting mounted (#32531) 2024-09-10 11:15:20 +02:00
config Revert "feat(tracing): add .pwtrace to trace file extension" (#32648) 2024-09-17 15:32:30 +02:00
electron chore: update flakiness metadata for better ui presentation (#31528) 2024-07-03 08:39:53 -07:00
expect chore: roll expect and move it to third party (#32458) 2024-09-09 13:12:20 -07:00
image_tools chore: bump @babel dependencies (#27632) 2023-10-17 20:52:41 +02:00
installation Revert "feat(tracing): add .pwtrace to trace file extension" (#32648) 2024-09-17 15:32:30 +02:00
library feat(fetch): record timings (#32613) 2024-09-17 16:11:21 +02:00
page chore: cookies in intercepted bidi requests (#32623) 2024-09-13 18:29:35 -07:00
playwright-test feat(test runner): allow to pass arbitrary location to test.step (#32504) 2024-09-17 08:11:21 -07:00
stress test: fix stress tests bots (#32513) 2024-09-09 12:52:40 +02:00
third_party/proxy chore: fix typos (#30645) 2024-05-08 19:40:03 +01:00
webview2 chore: update flakiness metadata for better ui presentation (#31528) 2024-07-03 08:39:53 -07:00
.eslintrc.js chore: strengthen linting (#29669) 2024-02-26 16:52:28 -08:00
tsconfig.json chore: use own socks5 server for tests (#31639) 2024-07-11 14:12:48 +02:00