nightmare icon indicating copy to clipboard operation
nightmare copied to clipboard

Different test behaviour when using openDevTools

Open damien-duignan opened this issue 6 years ago • 2 comments

I'm experiencing some different behaviour when using nightmare with devTools open, and when devTools are not open.

I have an input field with autosuggestion(twitter typeahead) where I enter some data and select from the suggestions. Here is the relevant code:

.type('.input-field', 'test')
.focusInput('.input-field')
.wait('.tt-suggestions')
.click('.tt-suggestion')

Custom focusInput action:

Nightmare.action('focusInput', function ( selector, done ) {
  this.evaluate_now(( selector ) => {
    document.activeElement.blur();
    var element = document.querySelector(selector);
    element.focus();
  }, done, selector );
});

When using openDevTools with nightmare, this works perfectly. The suggestions are displayed and I can select it. However, without having devTools open, the suggestions don't even appear.

Has anyone experienced something like this before?

damien-duignan avatar Mar 21 '18 17:03 damien-duignan

I am seeing similar behavior. Clearing text doesn't work unless openDevTools is set to true.

Ranthalion avatar Sep 30 '18 01:09 Ranthalion

Having opposite problem; my test works fine with devTools closed but when open it fail. 'input' focus seems to not be correct if devTools is open. (in both cases, show is set to true )

drschwabe avatar Aug 29 '20 16:08 drschwabe