Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:22

    beatfactor on main

    Add global `app` alias to `brow… (compare)

  • 09:22

    beatfactor on main

    Add global `app` alias to `brow… (compare)

  • 09:22
    beatfactor closed #3549
  • 09:22
    beatfactor closed #3549
  • Feb 07 21:14
    alicenwonderland94 commented #3587
  • Feb 07 21:14
    alicenwonderland94 commented #3587
  • Feb 07 21:13
    alicenwonderland94 commented #3587
  • Feb 07 21:13
    alicenwonderland94 commented #3587
  • Feb 07 20:59
    alicenwonderland94 commented #3587
  • Feb 07 20:59
    alicenwonderland94 commented #3587
  • Feb 07 20:43
    alicenwonderland94 commented #3587
  • Feb 07 20:43
    alicenwonderland94 commented #3587
  • Feb 07 20:36
    AKoumpouras commented #3587
  • Feb 07 20:36
    AKoumpouras commented #3587
  • Feb 07 20:31
    AKoumpouras commented #3587
  • Feb 07 20:31
    AKoumpouras commented #3587
  • Feb 07 20:14
    AKoumpouras commented #3587
  • Feb 07 20:14
    AKoumpouras commented #3587
  • Feb 07 20:13
    AKoumpouras commented #3587
  • Feb 07 20:13
    AKoumpouras commented #3587
ravikumar2000
@ravikumar2000
Is there any good nightwatch test recorder to record the use cases. I tried with nightwatch test recorder and it was unable to record redirection issues and by adding .usexpath() also not identifying the object. Let us know can we handle multiple redirections in nightwathcjs code will help us to fix my issues.
vikram kumar
@vikramarka
Thanks @gravityvi , I figured out that I can create a new javascript file on the fly with the desired port number for each test.
ravikumar2000
@ravikumar2000
what might be the issues related to these in nightwatch test execution
POST /wd/hub/session/f8754bfe0cd4e333375ec085220c755e/url - ECONNRESET
Error: socket hang up
Tim Yao
@tim-yao
Hi here. Can I ask the xpath in Nightwatch.js, is xpath 1 or xpath 2?
Trying to use lower-case function like /html/body//text()[contains(lower-case(.),'test')], so I can match text case insensitive. But couldn't make it work in Nightwatch.js.
ravikumar2000
@ravikumar2000
Is there any available good html report for nightwatchjs exporter ? We tried with html reporter with nightwatch it is creating html reports by parsing hte .xml values. When we run ./nightwatchjs_exporter it is not creating the html reports. Do we have any html reporters for the same?
vikram kumar
@vikramarka
ravikumar2000
@ravikumar2000

@vikramarka This we tried with nightwatch execution will generate a html report. But we are looking for generating the html report with nightwatchjs_exporter as shown below. We cannot add such argument --reporter html-reporter.js in nightwatchjs_exporter. we can get only failed snapshots not html reportes

./nightwatchjs_exporter -n /home/opc/nightwatch/node_modules/nightwatch/bin/nightwatch -t /home/opc/nightwatch/node_modules/nightwatch/bin/ --delay=10

ravikumar2000
@ravikumar2000
Is there any encryption logic for password using nightwatch?
6 replies
ravikumar2000
@ravikumar2000
like base64 encode logic for password in nightwatch modules?
ravikumar2000
@ravikumar2000
we are observing this issues while running >10 modules in nightwatchjs exporter with concurrency of 4 cpu
appreciate your quick help on this
"Error with nightwatch - not updating metrics: Error reading from nightwatch"
Shashank Shekhar
@2906shekhar
can we record video of our nightwatch tests execution in windows?
ravikumar2000
@ravikumar2000
yes this is with browser stack it is possible to record your test suite execution with video how it displays?
DustinBest
@DustinBest
I am trying to write an assertion to make sure that the username is getting typed correctly and i was using .assert.containtsText('elementID', 'username') and it is return null. I have looked at the recordings and i can see that the username was actually typed out though
Ravi Sawlani
@gravityvi
hey @DustinBest, can you use getValue instead and assert on that?
I think you want to assert the value of the form element and containsText is not correct command for that.
DustinBest
@DustinBest
i tried getValue but get the error "Error: Provided locating strategy "#login_pass" is not supported for .getValue(). It must be one of the following: id, css selector, link text, partial link text, tag name, xpath.
Ravi Sawlani
@gravityvi
can you share the snippet of the code?
DustinBest
@DustinBest
Screen Shot 2021-05-17 at 11.03.40.png
this is the first i am using nightwatch so theres not much set up yet
Ravi Sawlani
@gravityvi
try using assert.value('#login_user','username') after setValue
getValue requires a callback method too so it's better to use assert.value directly
DustinBest
@DustinBest
when i use that i get the error "element could not be located". I checked the recordings and the element is there and its getting updated with the username
a more detailed response shows this "errorStatus":405,"error":"Method has not yet been implemented","httpStatusCode":501}
i am using browerstack which is using nightwatch to write the scripts which might be part of it
Ravi Sawlani
@gravityvi
Strange, I will try using browserstack and check, it should work.
DustinBest
@DustinBest
yeah, maybe i configured something wrong. This is new for us
Ravi Sawlani
@gravityvi
can you share the code base in the chat so that I work on the same thing and resolve it?
DustinBest
@DustinBest
a lot of the stuff i have so far is revolving around logging into my companies product site which is private. beyond that snippet above, not sure what you need to see, but we may be able to modify the code to show you
Ravi Sawlani
@gravityvi
yeah, it's hard to reproduce the issue if we are testing on different website
maybe setting up a test repo would resolve it
DustinBest
@DustinBest
yeah, i am actually building off of the nightwatch-browserstack demo repo that i just modified the config with my username and key and then set up the above script to run on an ipad 12
DustinBest
@DustinBest
i set the url to google.com and just typed into the search bar and when i do the assertion i still get the same result
20 replies
zwbetz-gh
@zwbetz-gh
RE: securely using the test password. Instead of hardcoding it, read it from an env var.
miltonofficial
@miltonofficial
Has anyone one implemented nightwatch.js auto tests execution(Drupal 8) on Pantheon server?
RachaelKlein92
@RachaelKlein92

Good morning,

Could you please advise whether Nightwatch testing framework supports the following?

Desktop:
IE11 - yes/no?
Edge - yes/no?
Chromium - yes/no?
Firefox - yes/no?
Safari - yes/no?

Mobile: Responsive web:
Chrome - yes/no?
Safari - yes/no?

Ravi Sawlani
@gravityvi
Hey @RachaelKlein92 it's possible to run test on all of the above using nightwatch
RachaelKlein92
@RachaelKlein92
This message was deleted
1 reply
Amit Pandey
@mastergogo
Hi All, new here and also new to automated testing, im trying to test a hybrid mobile application using Nightwatch, I'm able to launch my localhost url and also able to open the dev tools, but not able to emulate device, how can i do that? is there any reference i can look? or do i need to share how my nightwatch.conf.js look like? thanks in advance
3 replies
Michael Harding
@redoxeon
I'm trying to get both unit and e2e testing set up for my team, but for the unit tests I'm not sure about the right way to import vue components that I want to test. Can unit tests also use the BDD Describe stuff?
dharls36
@dharls36

Hi. I'm trying to run my nightwatch tests on headless firefox, but can't get it to work. My config includes

firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled : true,
acceptSslCerts: true,
acceptInsecureCerts: true,
firefoxOptions: {
w3c: false,
headless: true,
args: [
'--enable-features=NetworkService,NetworkServiceInProcess',
'--ignore-certificate-errors',
'--disable-web-security',
'--window-size=1920,1080',
'--disable-extensions',
'--start-maximized',
'--disable-dev-shm-usage',
'disable-infobars',
'disable-notifications',
'--log-level=3',
'--headless'],
prefs: {

any ideas what I'm doing wrong? Thanks.

Alexander Kjeldaas
@alexander.kjeldaas:matrix.org
[m]
Is there a way to modify a web page before it's parsed? I would like to replace a <script src=...> element in a test.
Ravi Sawlani
@gravityvi
Hey @dharls36, the following is the desired capabilities to use firefox in headless mode.
Hope this helps.
desiredCapabilities: {
        'moz:firefoxOptions': {
          args: [
            '--headless'],
        }
      }
Ravi Sawlani
@gravityvi
Hey @redoxeon, it is totally possibe to run unit test cases using nightwatch with describe thing. you can set unit_tests_mode:true in your nightwatch config and you are ready go. Below is the simple example of it. For more information on unit test cases you can refer this. Hope it helps 😃
const add = require('./add');
const assert = require('assert');
describe('Adding two numbers',function (){
    it('adding two numbers',function(){
        const sum = add(2,3);
        assert.strictEqual(sum,5);
    })
})
Andrei Rusu
@beatfactor
Hey everyone! Nightwatch v1.7.3 is released in NPM. You can check out the changelog here:
https://github.com/nightwatchjs/nightwatch/releases/tag/v1.7.3
Andrei Rusu
@beatfactor
We released a survey where you can let us know about what features you'd like to see in Nightwatch v2. Here's the link: https://forms.gle/zBhbjdsDE77hTHSB7
neu5
@neu5
hey, If I expose some global methods eg. window.e2e
how can I access them in the test?
I want to write API for testing
Ravi Sawlani
@gravityvi
Hey @neu5, I didn't get your use case quite clearly. would it be possible to elaborate it or maybe share a code snippet?
neu5
@neu5

hey @gravityvi, my application renders in <canvas> so I cannot interact with it via DOM elements. So my idea was to create global object on window, eg. e2e holding methods eg.
e2e: { doSmth() }
that method under the hoods can call the backend endpoint or whatever. I'm trying to have tests looking like

client
      .url("http://localhost:5000/")
      .makePlayerDie('playerName')
      .pause(2000) // wait for backend to perform
      .checkIfPlayerIsDead('playerName')
      .respawnPlayer('playerName')
      .checkIfPlayerIsAlive('playerName')
      .end()

this makePlayerDie, checkIfPlayerIsDead, respawnPlayer, checkIfPlayerIsAlive are methods available in
window.e2e global
but I don't know how to access this global from the nightwatch