Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to keep opened developer tools while running a selenium nightwatch.js test?

I am starting to write e2e tests using nightwatch.js and I noticed some errors that I would like to inspect manually in the target browser's console (developer tools). but always when I open the developer console, it is automatically closed by the browser. is this a intended feature of either selenium or nightwatch.js, and, if it is the case, how can I disable it?

like image 417
cesarpachon Avatar asked Feb 11 '16 15:02

cesarpachon


People also ask

How do I run a single test file on Nightwatch?

A new parameter --testcase has been added to run a specified testcase. Show activity on this post. Test 2 and Test 3 will be executed. Separate each test function is mandatory because Nightwatch handled with filematcher each file.

How do I start selenium Nightwatch server?

Nightwatch can start and stop the Selenium process automatically which is very convenient as you don't have to manage this yourself and focus only on the tests. If you'd like to enable this, set start_process to true and specify the location of the jar file inside server_path .

Does Nightwatch use selenium?

Nightwatch. js is an automated testing framework for web applications and websites, written in Node. js and using the W3C WebDriver API (formerly Selenium WebDriver).


1 Answers

I'm successfully using this config in nightwatch:

...

chrome: {
  desiredCapabilities: {
    browserName: 'chrome',
    javascriptEnabled: true,
    acceptSslCerts: true,
    chromeOptions: {
      'args': ['incognito', 'disable-extensions', 'auto-open-devtools-for-tabs']
    }
  }
},
...
like image 111
Manel Clos Avatar answered Sep 24 '22 00:09

Manel Clos