This repository was archived by the owner on Jun 28, 2023. It is now read-only.
Get window size#125
Open
SebastienBoisard wants to merge 2 commits into
Open
Conversation
- add test for page.GetSize
Owner
|
I merged the |
sclevine
suggested changes
Sep 28, 2017
| Height int `json:"height"` | ||
| }{} | ||
|
|
||
|
|
| } | ||
|
|
||
| func (w *Window) GetSize() (width int, height int, err error) { | ||
| request := struct { |
Owner
There was a problem hiding this comment.
This struct does not represent a request
|
|
||
| Describe("#GetSize", func() { | ||
| It("should successfully send a GET request to the size endpoint", func() { | ||
| width, height, err := window.GetSize() |
Owner
There was a problem hiding this comment.
Setup and test return values using the mock bus (ideally in a separate test)
| session.GetWindowCall.ReturnWindow = window | ||
| width, height, err := page.GetSize() | ||
| Expect(err).To(Succeed()) | ||
| Expect(width).To(BeNumerically(">=", 0)) |
Owner
There was a problem hiding this comment.
Setup return values using the mock bus
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
It can be useful to be able to get the browser window size.
So, I added 2 functions GetSize() in window.go and page.go (but I'm not sure to comply with method naming convention with GetSize() in page.go).
I tried to add some tests, I hope it's ok, but I'm not used to Ginkgo yet 😉.