Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 11 11:10
    gravityvi closed #2732
  • Jun 11 11:10
    gravityvi closed #2732
  • Jun 11 11:09
    pawlakmaly commented #2732
  • Jun 11 11:09
    pawlakmaly commented #2732
  • Jun 11 11:07
    gravityvi commented #2732
  • Jun 11 11:07
    gravityvi commented #2732
  • Jun 11 11:06
    gravityvi commented #2732
  • Jun 11 11:06
    gravityvi commented #2732
  • Jun 11 11:06
    gravityvi commented #2732
  • Jun 11 11:06
    gravityvi commented #2732
  • Jun 11 10:55
    gravityvi commented #2308
  • Jun 11 10:55
    gravityvi commented #2308
  • Jun 11 10:54
    pawlakmaly commented #2732
  • Jun 11 10:54
    pawlakmaly commented #2732
  • Jun 10 20:15
    baffaman commented #649
  • Jun 10 20:15
    baffaman commented #649
  • Jun 10 19:20
    beatfactor commented #649
  • Jun 10 19:20
    beatfactor commented #649
  • Jun 10 19:17

    beatfactor on v2

    only add data if it's a post or… (compare)

  • Jun 10 19:17

    beatfactor on v2

    only add data if it's a post or… (compare)

ravikumar2000
@ravikumar2000
It is fixed after downgrading the chrome driver from 89 to 71
ravikumar2000
@ravikumar2000
Does nightwatch supports redirection of urls?
Example:
http://abc.com will redirect to http://xyz.com/login
vikram kumar
@vikramarka
Hi I am using chromedriver and a proxy using http-mitm-proxy library. I am using proxy to mock a particular API to return a custom response that I defined in tests.
I defined proxy like this "--proxy-server=http://localhost:8005" in chrome options of nightwatch configuration js file. I want to understand if it is possible to add a random port for proxy server. Basically I want to have a separate proxy for each test to support parallel test execution.
Since, we need to pass the config path as string to nightwatch, I could not find a way to change it. I am not sure if I explained correctly here. Please let me know if it is possible to change the properties under test_settings dynamically?
ravikumar2000
@ravikumar2000
We are facing issues on running nightwatch_js exporter
[opc@oci-vm-ravigr nightwatchjs-e2e]$ sudo ./nightwatchjs_exporter --nightwatch=/home/opc/amazon/nightwatchjs-e2e/node_modules/.bin/nightwatch --testdir=/home/opc/amazon/nightwatchjs-e2e/tests/google
2021/04/21 06:44:00 Error with nightwatch - not updating metrics: Nightwatch exited with error: exit status 1
2021/04/21 06:44:30 Error with nightwatch - not updating metrics: Nightwatch exited with error: exit status 1
Appreciate your quick help on this
nmcclain/nightwatchjs_exporter#1
Ravi Sawlani
@gravityvi
Hey @vikramarka that's not supported as of now
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);
    })
})