Questions tagged [nightwatch.js]

Nightwatch.js is an easy to use Node.js based End-to-End (E2E) testing solution for browser based apps and websites.

Nightwatch.js is an easy to use Node.js based End-to-End (E2E) testing solution for browser based apps and websites. It uses the powerful Selenium WebDriver API to perform commands and assertions on DOM elements.


Resources


See Also

1449 questions
13
votes
3 answers

check http status code using nightwatch

how do I check the HTTP status code using nightwatch.js? I tried browser.url(function (response) { browser.assert.equal(response.statusCode, 200); }); but of course that does not work.
Brown A
  • 849
  • 3
  • 13
  • 21
13
votes
3 answers

Nightwatch testing: Set browser to fixed size

Is there any way to ensure that the browser does not change from the initial window size. There are several things that are clicked during testing that are causing the window to maximize but i would like it to stay the same size throughout.
compsci45000
  • 289
  • 1
  • 4
  • 16
12
votes
2 answers

Using pages object in Nightwatch JS

I'm using nightwatch "0.8.6". Per the documentation on pages, I've created a pages/login.js file and add the directory to the config file with: module.exports = { url: function() { return this.launchUrl; } }; The documentation mentions…
Allyl Isocyanate
  • 12,435
  • 15
  • 71
  • 117
11
votes
4 answers

How can I check until an element is clickable using nightwatchjs?

How can I check until an element is clickable using nightwatch js? I want to click on an element but when I run nightwatch, selenium does not click on the element because it is not clickable yet.
Brown A
  • 849
  • 3
  • 13
  • 21
11
votes
3 answers

Hovering over a link in nightwatchjs

I have been using nightwatch.js and always clicked around elements. Is there a way we can hover over a link or button?
user461112
  • 3,411
  • 3
  • 17
  • 24
11
votes
3 answers

Nightwatch - Use chromedriver

So i saw a similar question on stack here but it did not have an accepted answer nor did it provide me with the information i needed.. I am trying to use 'chromedriver' because 'selenium-webdriver' requires a FF version <= 28. What i've done so…
chrismillah
  • 2,926
  • 2
  • 12
  • 18
11
votes
2 answers

Nightwatch js how to assert multiple elements

i'm trying to assert/verify multiple elements for an attribute with Nightwatch.js. I tried to use the "elements" command by selenium but it seems to not actually return a tag. browser.elements('css selector','icon_checkmark', function (result) { …
11
votes
6 answers

Uploading an image file with Nightwatch.js

I'm running front-end tests using nightwatch.js using the Chrome Driver. I need to test that image uploading works properly, presumably through the provided file input since there are callbacks that run on a successful post. I'm aware that this can…
Jeffpowrs
  • 3,964
  • 3
  • 24
  • 45
10
votes
5 answers

Assert text value of list of webelements using nightwatch.js

I am new to using nightwatch.js. I want to get a list of elements and verify text value of each and every element with a given string. I have tried : function iter(elems) { elems.value.forEach(function(element) { …
vibhor
  • 181
  • 1
  • 2
  • 7
10
votes
1 answer

saving HTML source code for debugging in nightwatch.js

Suppose, I have a failing test in only one of the browsers, where one of the css/html elements is "not found". Screenshot looks okay. How can I get the html source of the current document to check?
Alexei Vinogradov
  • 1,078
  • 1
  • 13
  • 29
10
votes
6 answers

How to make a globally accessible variable?

How can I make a globally accessible variable in nightwatch.js? I'm using a variable to store a customized url (dependent on which store is loaded in our online product), but I need it to be accessible across several javascript functions. It appears…
tmacarthur
  • 141
  • 1
  • 1
  • 6
9
votes
1 answer

Can I use links in setValue in file upload using nightwatch

Can I use links in different site in setValue in file upload using nightwatch? I look up a link in stackoverflow and see this: File Upload Testing in Nightwatch.js but the answer said that it will not work if the file is coming from…
Dranier
  • 251
  • 2
  • 24
9
votes
1 answer

How to make es6 import/export works in Nightwatch test?

I want to import into my test file utility module, which is written in ES6 and exports several things I need. So what I do is import { module } from 'file' but it throws the 'SyntaxError: Unexpected token import' error. I tried to: add…
Evgeniy
  • 420
  • 4
  • 14
9
votes
4 answers

How to click a link using link text in nightwatch.js

Say I have these elements on my web page. One Two Three I want to click on the link with text Two. How to identify or click that element using the Link Text without any…
sith
  • 1,618
  • 4
  • 23
  • 40
9
votes
2 answers

How can I run Nightwatch tests in a specific order?

I have several tests which test the UI and also serve to create data along the way. A separate set of tests rely on this data, meaning that these must run only after the first set have run. I know about running a group of them, or running them…
Sua Morales
  • 816
  • 8
  • 20
1
2
3
96 97