-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: add page/locator.mark API to enhance playwright trace
#9652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hi-ogawa
wants to merge
47
commits into
vitest-dev:main
Choose a base branch
from
hi-ogawa:02-13-feat_improve_playwright_trace
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+989
−52
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
6395c96
feat: improve playwright trace
hi-ogawa 276210c
chore: todo
hi-ogawa 409baf7
feat: markTrace on onTaskFinished errors
hi-ogawa 0798165
docs: revert
hi-ogawa b7c75ef
fix: pw only
hi-ogawa 2061704
Merge branch 'main' into 02-13-feat_improve_playwright_trace
hi-ogawa 4c740e7
fix: try/catch trace hack
hi-ogawa f781463
feat: support markTrace with locator
hi-ogawa 6c17817
chore: example
hi-ogawa 1ae2e5c
feat: page.markTrace and locator.markTrace
hi-ogawa 7a402a5
example
hi-ogawa e108db8
chore: cleanup
hi-ogawa 23971d5
fix: make markTrace no-op when trace is not active
hi-ogawa a746f34
chore: cleanup
hi-ogawa 88c57a8
fix: trace on onAfterRetryTask
hi-ogawa 6b67fe1
chore: example
hi-ogawa 8ef1094
feat: call trace on expect.element
hi-ogawa b07c25d
refactor: types
hi-ogawa c970d86
refactor: cleanup
hi-ogawa 5c67b06
Merge branch 'main' into 02-13-feat_improve_playwright_trace
hi-ogawa a7acfc4
fix: include sources
hi-ogawa 4651fd7
feat: simplify browser trace mark API
hi-ogawa b606490
docs: tweak
hi-ogawa 9e58b72
docs: add browser trace mark documentation
hi-ogawa 8169fbd
docs: add mark API links in JSDoc
hi-ogawa f2cd343
docs: add locator.describe tracing notes
hi-ogawa 6884131
Revert "docs: add locator.describe tracing notes"
hi-ogawa 03d4c2e
test: wip
hi-ogawa 9706e90
test: wip
hi-ogawa 524d078
test: wip
hi-ogawa 80d42c5
chore: lint
hi-ogawa d721d32
test: refactor
hi-ogawa a409b3e
test: branch webkit
hi-ogawa 32067b5
test: refactor
hi-ogawa 538e537
test: test vi.defineHelper
hi-ogawa c7087bd
feat: support custom stack
hi-ogawa c529452
feat: describe browser-playwright locators in traces
hi-ogawa 3763d0b
feat: support mark(name, () => {})
hi-ogawa 9faec43
chore: remove markGroup
hi-ogawa 85ca927
test: test mark group
hi-ogawa e9da4cf
docs: no limitations
hi-ogawa 0435861
chore: example
hi-ogawa 38fea7c
docs: warning playwright#39307
hi-ogawa a99ea35
test: add test/browser/README.md
hi-ogawa 34f83b3
chore: comment
hi-ogawa 959aea4
fix: re-export asLocator from @vitest/browser
hi-ogawa 9bed8b3
Merge branch 'main' into 02-13-feat_improve_playwright_trace
hi-ogawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| __traces__ | ||
| __screenshots__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| import type { UserEvent } from 'vitest/browser' | ||
| import type { UserEventCommand } from './utils' | ||
| import { getDescribedLocator } from './utils' | ||
|
|
||
| export const clear: UserEventCommand<UserEvent['clear']> = async ( | ||
| context, | ||
| selector, | ||
| ) => { | ||
| const { iframe } = context | ||
| const element = iframe.locator(selector) | ||
| const element = getDescribedLocator(context, selector) | ||
| await element.clear() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| import type { UserEvent } from 'vitest/browser' | ||
| import type { UserEventCommand } from './utils' | ||
| import { getDescribedLocator } from './utils' | ||
|
|
||
| export const fill: UserEventCommand<UserEvent['fill']> = async ( | ||
| context, | ||
| selector, | ||
| text, | ||
| options = {}, | ||
| ) => { | ||
| const { iframe } = context | ||
| const element = iframe.locator(selector) | ||
| const element = getDescribedLocator(context, selector) | ||
| await element.fill(text, options) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import type { UserEvent } from 'vitest/browser' | ||
| import type { UserEventCommand } from './utils' | ||
| import { getDescribedLocator } from './utils' | ||
|
|
||
| export const hover: UserEventCommand<UserEvent['hover']> = async ( | ||
| context, | ||
| selector, | ||
| options = {}, | ||
| ) => { | ||
| await context.iframe.locator(selector).hover(options) | ||
| await getDescribedLocator(context, selector).hover(options) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack?option is added so thatvitest-browser-xxxrender helper can manipulate the trace. see vitest-community/vitest-browser-react#47