-
Notifications
You must be signed in to change notification settings - Fork 1.5k
browser: implement page.goBack() and page.goForward()
#5494
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
base: master
Are you sure you want to change the base?
Conversation
inancgumus
left a comment
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.
Thanks for your contribution ❤️ Please watch the test results, and see if they pass, as I ran them. I have some suggestions.
|
@inancgumus Thanks a lot for the review and feedback.
Regarding this, indeed you are right. The test are timing out. I overlooked this. |
|
@inancgumus, I have implemented all the suggestions, thanks for pointing out a critical issue with the implementation.
What ?
FIXChanged the implementation to poll for URL change instead of waiting for
Also I am not sure why 2 test were failing in ci. please guide me here. |
inancgumus
left a comment
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.
Thanks for the changes @pkalsi97.
I have some suggestions, and we need to fix the git conflicts.
Don't mind those flaky tests. Your PR is fine as long as your tests pass.
What?
This PR implements
page.goBack()andpage.goForward()to allow users to navigate through the browser's session history.I have kept the implementation inline with
Reload()and followed guidelines mentioned in the issue.Why?
This functionality was missing and users had to rely on
page.evaluate(() => window.history.back()), which is racy and unreliable for testing purposes as mentioned in the issue #5400Example
Checklist
make check) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Closes #5400