-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Automatically generate Go interfaces code, etc. #367
Conversation
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.
didn't do a line by line review but looks all reasonable.
@@ -22,7 +22,7 @@ func main() { | |||
if err != nil { | |||
log.Fatalf("could not create page: %v", err) | |||
} | |||
if _, err = page.Goto("http://whatsmyuseragent.org/", playwright.PageGotoOptions{ | |||
if _, err = page.Goto("https://playwright.dev/", playwright.PageGotoOptions{ | |||
// networkidle is DISCOURAGED |
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.
// networkidle is DISCOURAGED |
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.
Will do this in next pr.
RecordVideo: &playwright.RecordVideo{ | ||
Dir: playwright.String("videos/"), |
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.
I in the past used it to differentiate if a user did set a string, since in Go a String can't be nil.
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.
According to the documentation, recordVideo itself can be nil
, and path
is required once the recordVideo parameter is provided. When generating type members, the script will judge whether the primitive type needs to be referenced by pointer or not.
## context-option-recordvideo
* langs: js
- `recordVideo` <[Object]>
- `dir` <[path]> Path to the directory to put videos into.
- `size` ?<[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`
scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.
Actual picture of each page will be scaled down if necessary to fit the specified size.
- `width` <[int]> Video frame width.
- `height` <[int]> Video frame height.
Impressive work, thanks for putting effort into this. |
Due to the rewrite of the go code generation scripts, it brings the following breaking changes:
//nolint:staticcheck
to ignore.Page.OnDialog()
etc.Click
usedPageClickOptions
, nowPage.AddInitScript(script Script)
Page.ExpectedDialog
can usePage.OnDialog
instead.xxxAssertions.NotTo...
, use.Not().xxx
pls.