Jasir K
Jasir K

Reputation: 1

Adding extra dimensions to testacafe-resizeWindow

https://github.com/DevExpress/testcafe-browser-provider-browserstack/blob/eb56cb2bd88d80ecd021f924f735789f22f7b7fa/src/backends/automate.js#L84

Just confused with this statement. I see the width and height gets increased by some amount in chrome browser than what I specify when using .resizeWindow().

Upvotes: 0

Views: 38

Answers (1)

Alex Kamaev
Alex Kamaev

Reputation: 6318

These corrections are needed because you specify the width and height only for the client area (the area with your website content). However, when TestCafe resizes the window, it works with the window sizes, which are not equal to the client area sizes. Take a look at the screenshot: image The blue line here is the client area height. The red line is the window height and the yellow line is correction.

Let's assume that you want to have the window height equal to 400px. This means that TestCafe will calculate a new window size as 400 (the blue line) + correction (yellow line).

Upvotes: 1

Related Questions