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.

Filter by
Sorted by
Tagged with
0votes
1answer
14views

Test random URLs from spreadsheet using alasql

I have a large number of URLs within a xlsx file. What I'd like to do is randomly select some of these URLs, load them, then check that they return a status code of 200. So I'm using the npm alasql ...
user avatar
0votes
0answers
10views

Nightwatch text.to.contain not finding element value

Im having trouble working out why my nightwatch test is failing. I have a simple div element <div id="imageLabelEco">eco</div> the Test I expect to pass mainImageSection.expect....
user avatar
-1votes
1answer
9views

Previously-defined variable not working in other parts of test in nightwatchjs

I'm using nightwatchjs and the ssh2 npm package to test that a file name is present in a location, and asserting that it's correct. My code is as follows; var Client = require('ssh2'); var conn = new ...
user avatar
0votes
0answers
19views

Nightwatch - How to subscribe to CDP Events?

As you may already know, Nightwatch 2 now includes methods for making calls to CDP protocol. So, I'm trying to capture network responses. I know that the "Network" target has to be enabled ...
user avatar
0votes
0answers
9views

Run the same nightwatch test concurrently

I have a nightwatch script that sends traffic to a service and am trying to configure it to run the same test multiple times concurrently similar to how playwright has workers ex: npx playwright test -...
user avatar
  • 23
0votes
2answers
40views

Nightwatch - How can I CSS select a nested button with no unique identifiers on the button itself

In image 'UI' I need to select the second 'Setup' button on the page. I've tried many different combinations of trying to select this element but have had no luck. I've seen some related posts but ...
user avatar
1vote
0answers
17views

Nightwatch mocha typescript

Could someone please help me how to use mocha Nightwatch with typescript , if I use like below it's not working , please help on it. import {NightwatchBrowser } from "nightwatch"; describe(...
user avatar
0votes
0answers
13views

Issues with allure-reporter for Nightwatch

I am using nightwatch framework v 1.7 with nightwatch-allure ^1.2.0 But now I faced several issues: The screenshot isn't added to the report for failed assertion with a loop ["@button",...
user avatar
0votes
0answers
7views

Nightwatch.js click() method not triggering event change in v-model

I have run into an issue using the nightwatch.js .click() method where it is able to click on the dropdown selector and then the option populating the dropdown correctly, however attached to this '...
user avatar
0votes
1answer
45views

Remove chromedriver prompt NightwatchJS

When I run my NightwatchJS tests npx nightwatch I seem to have the chromedriver prompt open alongside the browser. The test suite proceeds to press the buttons and assert elements correctly but I have ...
user avatar
  • 428
0votes
0answers
17views

nightwatchJS how to grant permission to camera or block it?

It's possible to grant permission with option like: 'goog:chromeOptions': { 'args': ["--use-fake-device-for-media-stream", "--use-fake-ui-for-media-stream"] } ...
user avatar
0votes
0answers
41views

Allure report counts test suite name as a test case when a Nightwatch tests are run

Allure report counts test suite name as a test case. Suppose I have a test suite, "Testing", and inside which I wrote 2 test cases, "test1" and "test2". Now, after ...
user avatar
0votes
0answers
18views

How do I loop through a list of element attributes and load them in nightwatchjs

So my goal is to get all the images on a page, extract a specified (url) attribute from each image, and then load each of these (url) attributes to ensure they return a 200 status code. So far, my ...
user avatar
0votes
0answers
13views

Referencing a config entry in a Nightwatchjs beforeEach hook

As part of my Nightwatchjs beforeEach hook, I have this in my globals.js file; // globals.js file var launchUrl = 'https://www.parkers.co.uk/'; module.exports = { beforeEach: function (browser, ...
user avatar
0votes
1answer
41views

Automation test with NightwatchJS on iOS simulator using XCUI

I try to do an automation UI test with NightWatchJS for a "click and drag" behavior and successfully executed it on Android Virtual Device. However, when I tried to launch the test on an IOS ...
user avatar
0votes
1answer
78views

Error connecting to localhost on port 4445. with Nightwatch and Selenium

I'm trying to run my script using Nightwatch(Javascript), but I'm getting this error : \ Connecting to localhost on port 4445... ‼ Error connecting to localhost on port 4445. × ...
user avatar
  • 652
0votes
0answers
19views

Nightwatch: How to skip a testcase depending upon a condition

In Nightwatch, I want to skip a test case if some condition is not met in a test. For e.g. in the first test case, I am fetching the text of an element and storing that in an array. In the second test ...
user avatar
0votes
0answers
10views

Nightwatch: Unable to get the updated array value in the assertion

Using Nightwatch with JS. Below is the Page object which I am using. Under commands, I initialized an empty array, "deletedPlans". Then further in the code, I'm pushing values to it. In the ...
user avatar
0votes
0answers
9views

Using a global entry in command script in nightwatch

Using nightwatch 1.7.7, I need to run code in my command script that references an entry in my globals file. So far, my code looks like this in my command file; var cmsDataNewsLetterSettings = require(...
user avatar
0votes
0answers
21views

Assert a script is present on the page using nightwatchjs

I'm using nightwatchjs and trying to test whether a javascript script is present on a page or not. Below is the html; and I need to test that this is present on a particular page. I understand that I ...
user avatar
0votes
1answer
31views

Right click in nightwatch is not working .mouseButtonClick('right')

.click('#gridW33F8AEBDB6D146F085CCBF0BF28D63B4 > div.ag-root-wrapper.ag-layout-normal.ag-ltr > div.ag-root-wrapper-body.ag-layout-normal > div.ag-root.ag-unselectable.ag-layout-normal > ...
user avatar
0votes
0answers
30views

Is it possible to run a Nightwatch test by partial name?

"test:automation-by-name": "node ./nightwatch.js -e local --suiteRetries 1 \ --reporter ./client/tests/automation/html-reporter.js --test client/tests/automation/test/cards.js \ --...
user avatar
  • 39.4k
0votes
1answer
46views

Getting webElementId as 'undefined' in Nightwatch

module.exports = { 'TESTTT'(browser){ browser .url ("https://xyz") .elements('xpath', '//div[@class="ant-card-head-title"]//span', function (elements) { ...
user avatar
0votes
0answers
53views

console.log does not print to the console when written in a test case in the Nightwatch using Javascript

const arr= ['A', 'B'] module.exports = { 'testCase1'(browser){ console.log("Hello") //Doesn't print to the console }, 'testCase2'(browser){ arr.forEach(myFunction); function ...
user avatar
0votes
0answers
53views

Unable to use ForEach loop to iterate array values under a test case using Nightwatch

const namesArray = ["Red", "Blue", "Orange"] module.exports = { 'Delete all the items' (browser){ namesArray.forEach(myFunction); console.log("...
user avatar
1vote
2answers
91views

How to select a specific text using CSS selector

I want to select the text "Auto-Publish" in Span. How can I do it with a CSS selector? with Xpath I know how to do it. I am using Nightwatch for UI automation. I want to make a generic ...
user avatar
1vote
1answer
60views

How can I handle file download pop up for safari using nightwatch

I am trying to use something like this, similar to my firefox options, but my test doesn't seem to handle the download pop-up, any suggestions ? Thank you "safari": { "...
user avatar
0votes
0answers
12views

Is there a way to add an error message to the .equal assertion in Nightwatch?

I'd like to add an error message to this code: this.expect.element(titleCss).text.to.equal(report); to this.expect.element(titleCss).text.to.equal(report, `{report.id} did not have correct title`); ...
user avatar
  • 39.4k
0votes
2answers
74views

NightwatchJS: Safari can't find nested iFrame

I'm having difficulty testing a piece of code using NightwatchJS with Selenium and SafariDriver. I have an open issue for this on nightwatch repo, although am not sure if it is an issue with ...
user avatar
0votes
0answers
28views

Nightwatch First Test is Running Before the `before` hook completed

The test doesn't wait for the before hook to complete. It runs right away. Why doesn't the test wait to run until after the before hook completes? I've created this example test that shows the issue. ...
user avatar
  • 3,640
0votes
1answer
56views

Can passed nightwatch.js tests be hidden in output?

The default Nightwatch.js output consumes one line per passed test. For example, ✔ Testing if element <body> contains text 'lecture is so boring' (12ms) ✔ Testing if element <button[id=btn1]&...
user avatar
0votes
1answer
45views

Determine the number of rows of a table with Nightwatch / Selenium using xPath

I have a table - a React Table which is a React table component that uses it's own mark up, so not a HTML table I would like to write a Selenium / Nightwatch test to see how many rows the table has ......
user avatar
0votes
0answers
36views

Attribute of an element is outputting null

As part of my nightwatchjs testing, what I would like to do is get the attribute of an element, then set this attribute value to a different value. Here is the HTML snippet; So first of all I'd like ...
user avatar
0votes
0answers
29views

Change element value in nightwatchjs

As part of my nightwatchjs test script, I would like to change the value of an element on the page in order to stop a pop-up from appearing on a subsequent page. The html is as below; div id="...
user avatar
0votes
1answer
31views

Nightwatch js iterating multiple webelements

Can anyone help me with exact code to iterate multiple elements & clicking it having same ID or XPath or css whatever just like we do findelements in selenium
user avatar
0votes
0answers
336views

Click browser permission popup in playwright without grantPermission

I'm trying to write test with playwright. My app use camera and microphone. So, I grant them using context.grantPermissions(['camera', 'microphone']). It works on chrome but, not firefox and safari. (...
user avatar
0votes
0answers
34views

.assert.containsText() in nightwatch not working properly

browser.execute(function () { document.getElementsByClassName('vitara-point')[1].innerHTML = 'bar2' }).assert.containsText('rect:nth-child(2)', 'bar2').moveToElement('rect:nth-child(2)', 2, 2).click(...
user avatar
0votes
0answers
52views

Async/Await not working in Nightwatch.js test

I'm trying to convert one of our E2E Nightwatch.js tests to use the await command. I'm expecting the command to return a Promise, as demo'd here: However, it seems to be returning all of the globals ...
user avatar
0votes
0answers
25views

mouseButtonClick('right') in nightwatch.js not working properly

browser.moveToElement('.vitara-chart-container', 10, 10).pause(3000).mouseButtonClick('right').pause(3000) as below image it is just middle click is happening not right right click is not working ...
user avatar
0votes
0answers
42views

Nightwatch Execute Method is not returning a result

I was running a test where I obtained a POST parameter, this has to be done with Nightwatch's execute function. Even though the function in execute returned a value, when I used that value outside of ...
user avatar
0votes
1answer
22views

Nightwatch.js Global afterEach not working

I am trying to use the global hook afterEach to close the browser after each test, but once the first test completes it does not perform the global afterEach. Here is an example of my global.js, any ...
user avatar
0votes
0answers
46views

Nighwatch ignores await in tests

I'm trying to start with Nightwatch and faced the unclear behavior. Please take a look at the the following code. I want to gather some text from a page into the list and then print it. Note the async ...
user avatar
  • 687
0votes
0answers
10views

how to optimise Nightwatch VRT logs?

How can i optimise Nightwatch VRT results, because it shows the same things for several times like this : √ Element <//*[@id="width"]> was visible after 22 milliseconds. √ Passed [ok]: ...
user avatar
  • 31
0votes
0answers
16views

Nightwatch: How to run certain tests in parallel and others in sequential

I have segregated all tests in folders based on the features in the app. There are some tests that do some settings in the app before actual testing happens. Such tests can't run in parallel otherwise ...
user avatar
0votes
0answers
35views

NIghtwatch - Saucelabs Issue

Issue: While running the test cases in saucelabs, "we are getting security verification failed. Please enable cookie and refresh error". Findings: The test cases are running fine in local ...
user avatar
  • 11
0votes
1answer
56views

when a test failed nightwatch skip the next ones?

i am using nightwatch VRT , and when a test fail,he skips all tests that come after that. i tried adding end_session_on_fail : false, and skip_testcases_on_fail: false, to my nightwatch.conf.js but it ...
user avatar
  • 31
1vote
0answers
70views

How can I display failed test on cucumber report?

Hi guys, I am using nightwatch VRT and cucumber to do some visual regression tests. But when a comparison of two images has failed (the baseline image and test image), it does not show that on ...
user avatar
  • 31
0votes
0answers
48views

nightwatchjs saveScreenshot giving TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView

I am working on an automation prototype using Nightwatch js and when I am trying to save screenshot, it is giving below error Error while running .getScreenshot() protocol action: An unknown server-...
user avatar
  • 1,972
1vote
1answer
30views

How to run all testcase of a file from other test file in nightwatch

I am trying to run a testfile which has multiple testcase inside it from another test file. let's say, i have admin-registration.js test file which has multiple testcase in it. I have to run all the ...
user avatar
0votes
1answer
63views

I'm using nightwatch framework for testing,i get this range error .On encountering the error execution just stops without any report

I've tried updating chromedriver and installing latest node package but still i keep getting this at times.Thanks in advance.Error details are below : RangeError: Invalid string length at addChunk (...
user avatar

15 30 50 per page
1
2 3 4 5
30