Skip to content

Instantly share code, notes, and snippets.

View pratik-domain's full-sized avatar

pratik-domain

View GitHub Profile
@pratik-domain
pratik-domain / gist:7e866af93f74cad13fbaf74bbee3d4e0
Created October 6, 2017 00:10
Nightwatchjs - Scrolling to an element / bottom of the page
Scroll to an element
====================
client.execute('var footerElements = document.getElementsByClassName("footer-partners");' +
'footerElements[0].scrollIntoView(true);')
Scroll to the bottom of the page
================================
https://www.domain.com.au/real-estate-agents/ page > Agents tab: It is hard to find the elements of react-select component.
We can use this command in debugger to pause the debugger and find element:
setTimeout(function(){debugger;}, 5000)
@pratik-domain
pratik-domain / DemoTestGoogle.js
Created February 2, 2017 03:48 — forked from ericmacfa/DemoTestGoogle.js
StackOverflowGist_nightwatchjs-how-to-check-if-element-exists-without-creating-an-error-failure-exception
// Example adapted from the examples at http://nightwatchjs.org/guide#writing-tests
module.exports = {
'Navigate to google': function (browser) {
browser.windowMaximize();
browser.url('http://www.google.com');
browser.waitForElementVisible('body', 1000);
},
'Try a junk selector that doesnt exist, using .elements': function (browser) {
// Note that the status is 0