Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'then' of undefined - error when running multiple expect #1938

Closed
aberonni opened this issue Dec 3, 2018 · 2 comments

Comments

@aberonni
Copy link
Collaborator

aberonni commented Dec 3, 2018

I'm getting this error:

  Cannot read property 'then' of undefined
       at new Promise (<anonymous>)
       at process.internalTickCallback (internal/process/next_tick.js:77:7)

It seems that this is happening when running multiple expect inside a loop. For example:

        results.value.forEach(function (element) {
          browser.elementIdAttribute(element.ELEMENT, 'class', function (result) {
            console.log('Checking class: ', result.value);
            browser.expect
              .element(result.value)
              .to.have.attribute('class')
              .which.matches(/.*sb.*/);
          });
        });

An example of how to reproduce is on it's way.

@aberonni
Copy link
Collaborator Author

aberonni commented Dec 3, 2018

I've added an example here which can be reproduced by cloning the repo and running npm run test:1938

@phaseen
Copy link

phaseen commented Dec 6, 2018

Even I have same issue. I am not using expect any where but I am using for loop.
Cannot read property 'then' of undefined
at new Promise ()
at process.internalTickCallback (internal/process/next_tick.js:77:7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants