view console.log output in angular protractor jasmine test

后端 未结 7 1809
忘掉有多难
忘掉有多难 2020-12-24 05:12

How can I view console.log output in an angularjs protractor jasmine test? As of now, the browser closes by itself too quickly.

more info - I am working with the ang

7条回答
  •  时光取名叫无心
    2020-12-24 05:46

    A simple option is to use:

    browser.pause(); protractor/api/browser.pause

    for example:

    it('should .. test stuff', function() {
        browser.pause(); //--->the automation will pause here - follow the instructions in your terminal to continue 
        //--->your broken testing magic here...
    });
    

    Place that method call as the first item in the spec body where you need to view the browsers console.

    After the browser pauses you'll have control of the automation. You can then interact with the browser as usual, inspecting elements at different states, checking the browsers console, etc.

    Continue the tests by entering c for continue in your terminal - there will be a prompt with instructions waiting for your entry.

提交回复
热议问题