How to check if there is a horizontal scroll with Behat? - behat

My case is as follows: sometimes on a stage environment one CSS file gets removed and that causes a horizontal scroll. My goal is to check if there is a horizontal scroll with a Behat script which will be executed on a cronjob and if that's the case - I'll send an e-mail. The thing is, that horizontal scroll is not a property. So my question is - how can I make Behat know, that there is a horizontal scroll?

You must run your tests with a browser that actually renders the web page. Thus using the very fast goutte driver is not an option. Most likely you will have to use selenium2 with Chrome or Firefox.
You must define an "appropriate" default screen size and start the browser accordingly.
Having done so you can check the visible property of window.scrollbars via Javascript. It is true if any scrollbar (horizontal or vertical) is currently visible.

Use executeScript with a javascript condition.
For example:
document.documentElement.scrollWidth will measure the width and
You can create a conditions that check for scroll and return true if present, else false.
For horizontal scroll:
executeScript("return document.documentElement.scrollWidth>document.documentElement.clientWidth;");
For vertical scroll:
executeScript("return document.documentElement.scrollHeight>document.documentElement.clientHeight;");

Related

i want to scroll a voew to right and click on 3 dots, sometimes automatically it detects the button, sometimes not

I have to scroll right in cypress for a specific view part. Sometimes it automatically detect, but sometimes after scroll only it detect the button. Scrollbar has no unique ID. What is the solution for this scenario?
I tried cy.scroll(500,0) but this dont work
You can get the element then use .scrollIntoView() chained to the returned element.
cy.get('#uniqueId')
.scrollIntoView()
// now it will be in current viewport

Why does my window reset after everytime I call SDL_RenderPresent()?

I was trying to implement viewport. The thing I was doing is that I render in one viewport, than I call SDL_RenderPresent to update screen and then again I implemented viewport. The whole process was being controlled by key pressing, meaning by tapping c it used to render first viewport and then next one. But calling SDL_RenderPresent after everytime rendering viewport was clearing up screen. Why is this happening? And can someone tell me that if SDL_Renderer works like a pen/brush with what we can draw things? If not, then how does it work?

Not able to click a button using nightwatch , since button's bottom edge touches footer and no scroll space

I am using Nightwatch for automating scripts.
Facing an issue, not able to click a button using Nightwatch, since the button's bottom edge touches footer and no scroll space.
I tried
1. browser.maximizeWindow(); but command doesn't works.
2. browser.windowSize('current', 1200, 1200, function(result) {}); it works but on different machines and env it might cause issue.
Is there any other solution to click on a button which will work independently?

Detox partially visible Button behaves differently using toBeVisible() expectation and tap() action

I have a screen with a ScrollView and a Button which is in the very bottom and is partially visible, i.e. top part of the button is in the screen, but the title is not visible, unless I scroll down:
expect(element(by.id(BUTTON_IN_THE_BOTTOM))).toBeVisible() => the matcher fails.
element(by.id(BUTTON_IN_THE_BOTTOM)).tap() => all is good, button is tapped.
This seems to be an inconsistency and I would think that the framework should be consistent in such behaviors. Is this the expected behavior?
was using detox 7.3.2
Most likely an inconsistency between matchers in Earl Grey, our iOS backend framework.
Regardless, you are asking for trouble by not scrolling. The position on screen is dependent on several factors, including device size, RN layout system and the OS layout system and content. You should not really make assumptions about pixel accuracy. By not scrolling the button the visible, you are introducing flakiness where there shouldn't be.
Use the swipe action on the list to get to the bottom of the screen so the button will be visible. As stated above, This will prevent flaky behaviors such as testing on small res devices will fail your tests.

Text isn't always altered properly in plugin after resize

I wrote an Awesomium 1.7.2 plugin that displays a bunch of text and contains a few buttons. While the plugin functions fine, I have some strange display issues.
I have a separate program that I sometimes "Dock" at the top of my computer screen. When I do that, the text inside my Awesomium window gets warped a little (see screenshots below). That's because that window THINKS that it's maximized, but the screen has been compressed by 20 to 30 pixels; whatever the height of that separate, docked window is.
Other programs seem to be smart enough to render text appropriately when I add/remove my docked program. Also, when I view these web pages directly in a web-browser, they get resized properly after the dock change. It's only when they're inside of this Awesomium control where they don't respond properly to another program being docked. How can I make my html controls behave this way inside of the Awesomium window?
Update: I tried 1.7.3 as well, but the problem still exists.
Update: I also posted this question on answers.awesomium.com and awesomium.zendesk.com, but that hasn't helped.
SCREENSHOTS
Maximized without a docked program present:
Maximized WITH a docked program present and warped, compressed text: