Debugging protractor using WebStorm

Tonio

I'm trying to use WebStorm in order to debug protractor e2e test, My objective is to be able to put breakpoints in the code of the tests. I'm new to this, so I'm probably doing something wrong.

As stated on the protractor tutorial, I updated the webdriver-manager and start it using this command in a cmd Terminal (I'm working on Windows):

webdriver-manager start

This is my protractor-conf.js file:

var ScreenshotReporter = require('./screenshotReporter.js');

exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',

  //baseUrl: 'http://localhost:9000',

  framework: 'jasmine2',

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  specs: ['**/*_spec.js'],

  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  },

  onPrepare: function() {
    jasmine.getEnv().addReporter(new ScreenshotReporter("test-e2e/screenshotFailures/"));
  }
};

I created a configuration in WebStorm like this:

Node interpreter: C:\Program Files\nodejs\node.exe

Working directory: C:*******\ref-app

Javascript file: node_modules\protractor\lib\cli.js

Application parameters: test-e2e/protractor-conf.js

And after I tried several things:

  1. Run Protactor using Run Button in WebStorm: Failed: Angular could not be found on the page / : retries looking for angular exceeded
  2. Debug Protractor using Debug Button in WebStorm: I can see this in the WebStorm console but nothing happens after:

    Using the selenium server at http://localhost:4444/wd/hub
    [launcher] Running 1 instances of WebDriver
    Started
    F
    
  3. Modify protractor-conf.js to add baseUrl

    baseUrl: 'http://localhost:9000',
    

    Then start a local webserver on port 9000
    If I run Protractor using Run Button in WebStorm, it is working fine but I can't setup breakpoints
    If I Debug Prtoractor using Debug Button in WebStorm, I can just see this in the console but nothing happen after:

    Using the selenium server at http://localhost:4444/wd/hub
    [launcher] Running 1 instances of WebDriver
    Started
    

EDIT: AS I say in my comment below, I'm using: protractor 3.1.0 WebStorm 11.0.3

WHen I'm trying to debug using webstorm, it opens a Chrome windows but the screen is completely blank and in the URL, you have : data:, (I don't think it is useful but I don't know what to try)

Any idea what I'm doing wrong ?

Michael R.

you can run node in the --inspect-brk mode, and attach a remote debugger, for example the chrome dev-tools:

start your app with ng serve and run

node --inspect-brk ./node_modules/protractor/bin/protractor ./protractor.conf.js

now node waits for a debugger to attach.

Then you can open chrome://inspect/#devices. There your app should appear. Finally click inspect at the target / your app and voila you can use now breakpoints and debugger; statements.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Debugging simultaneously in Intellij/Webstorm and Chrome dev tools

From Dev

Typescript breakpoints not hit when debugging in WebStorm 7

From Dev

How to debug angular protractor tests in WebStorm

From Dev

Webstorm Karma test debugging - breakpoint not hit

From Dev

debugging protactor (with / without webstorm)

From Dev

'Step Over' doesn't work while debugging sails App using Webstorm 8

From Dev

How to set up Dart debugging in WebStorm?

From Dev

Debugging with arbitrary NodeJS unit testing frameworks in WebStorm

From Dev

[WebStorm]: Change Debugging WebServer Project Root

From Dev

Webstorm localhost debugging

From Dev

Webstorm debugging with source maps from Browserify and Typescript

From Dev

Debugging protractor tests from the console

From Dev

How to avoid timeout when debugging protractor test?

From Dev

WebStorm to recognize Protractor config options

From Dev

Set protractor arguments debugging in visual studio code

From Dev

WebStorm debugging with Chrome - best Workflow with useful console and setting breakpoints in WebStorm

From Dev

Debugging Ionic 2 project with TypeScript in WebStorm 11

From Dev

Protractor - debugging in webstorm

From Dev

WebStorm tries to open Chrome for debugging

From Dev

Restify debugging in WebStorm

From Dev

Debugging node.js app in webstorm

From Dev

Webstorm Karma test debugging - breakpoint not hit

From Dev

'Step Over' doesn't work while debugging sails App using Webstorm 8

From Dev

webstorm 10 chrome extension debugging

From Dev

How to avoid timeout when debugging protractor test?

From Dev

Debugging protractor with manual logging

From Dev

Protractor - debugging in webstorm

From Dev

Debugging TS in WebStorm

From Dev

Node webkit app debugging in WebStorm 11

Related Related

  1. 1

    Debugging simultaneously in Intellij/Webstorm and Chrome dev tools

  2. 2

    Typescript breakpoints not hit when debugging in WebStorm 7

  3. 3

    How to debug angular protractor tests in WebStorm

  4. 4

    Webstorm Karma test debugging - breakpoint not hit

  5. 5

    debugging protactor (with / without webstorm)

  6. 6

    'Step Over' doesn't work while debugging sails App using Webstorm 8

  7. 7

    How to set up Dart debugging in WebStorm?

  8. 8

    Debugging with arbitrary NodeJS unit testing frameworks in WebStorm

  9. 9

    [WebStorm]: Change Debugging WebServer Project Root

  10. 10

    Webstorm localhost debugging

  11. 11

    Webstorm debugging with source maps from Browserify and Typescript

  12. 12

    Debugging protractor tests from the console

  13. 13

    How to avoid timeout when debugging protractor test?

  14. 14

    WebStorm to recognize Protractor config options

  15. 15

    Set protractor arguments debugging in visual studio code

  16. 16

    WebStorm debugging with Chrome - best Workflow with useful console and setting breakpoints in WebStorm

  17. 17

    Debugging Ionic 2 project with TypeScript in WebStorm 11

  18. 18

    Protractor - debugging in webstorm

  19. 19

    WebStorm tries to open Chrome for debugging

  20. 20

    Restify debugging in WebStorm

  21. 21

    Debugging node.js app in webstorm

  22. 22

    Webstorm Karma test debugging - breakpoint not hit

  23. 23

    'Step Over' doesn't work while debugging sails App using Webstorm 8

  24. 24

    webstorm 10 chrome extension debugging

  25. 25

    How to avoid timeout when debugging protractor test?

  26. 26

    Debugging protractor with manual logging

  27. 27

    Protractor - debugging in webstorm

  28. 28

    Debugging TS in WebStorm

  29. 29

    Node webkit app debugging in WebStorm 11

HotTag

Archive