Ostap Didenko
Ostap Didenko

Reputation: 484

Protractor.explore() and .pause() and .enterRepl() run into a TypeError

When I run a protractor test with one of those:

await browser.enterRepl();
await browser.pause();
await browser.debugger();

It runs into the following error:

TypeError: doneDeferred.fulfill is not a function
TypeError: doneDeferred.fulfill is not a function
    at Socket.tester.once (C:\TSO-IP\tso-ip-ui\node_modules\protractor\built\debugger.js:212:34)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:182:13)
    at Socket.EventEmitter.emit (domain.js:442:20)
    at TCP._handle.close (net.js:606:12)

I haven't really found anyone reporting an issue like this.

import 'jasmine';
import {browser} from 'protractor';
import {LoginPo} from '../login.po';
import {Process_adminPo} from "./process_admin.po";

describe ('Capacity register tests', () => {

let loginPage: LoginPo;
let process_adminPo: Process_adminPo;


beforeAll (async (done:DoneFn) => {
    loginPage = new LoginPo ();
    await loginPage.openApplication ();
    await loginPage.changeLanguage ();
    done();
});

beforeEach (async (done:DoneFn) => {
    process_adminPo = new Process_adminPo ();
    done();
});

it ('Add a new nomination group', async () => {
    await process_adminPo.open ();
    await browser.explore();
    //await browser.enterRepl();
    //await browser.pause();
    //await browser.debugger();
    await browser.sleep (5000);
    await process_adminPo.clickOnNewButton ();
}

I expect to enter into an interactive shell (REPL) mode to deal better with locating the elements

Upvotes: 2

Views: 1096

Answers (1)

craig
craig

Reputation: 5016

Please try to not use the browser.repl(), browser.explore(), and browser.debugger(). These methods require the control flow; however, since you are using async / await (which is awesome), that means you are not using the control flow and these methods will not work.

These are all going away because the selenium-webdriver is no longer using the control flow. Protractor used to intercept the control flow and set a magical breakpoint.

You should alternatively use node --inspect-brk ./node_modules/.bin/protractor See youtu.be/6aPfHrSl0Qk?t=985 for an example video.

Upvotes: 2

Related Questions