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

Bug: gremlins.js aborts too early. #187

Open
dmbs335 opened this issue Mar 31, 2022 · 0 comments
Open

Bug: gremlins.js aborts too early. #187

dmbs335 opened this issue Mar 31, 2022 · 0 comments

Comments

@dmbs335
Copy link

dmbs335 commented Mar 31, 2022

  • gremlins.js version: 2.2.0
  • node version: -
  • npm (or yarn) version : -
  • browser version: 98.0.2

Steps To Reproduce

When executing code below, gremlins.js aborted too early.
(function() { function callback() { gremlins.createHorde({ species: [gremlins.species.clicker(),gremlins.species.toucher(),gremlins.species.formFiller(),gremlins.species.scroller(),gremlins.species.typer()], mogwais: [gremlins.mogwais.alert(),gremlins.mogwais.fps(),gremlins.mogwais.gizmo()], strategies: [gremlins.strategies.distribution(),gremlins.strategies.allTogether(),gremlins.strategies.bySpecies()] }).unleash(); } var s = document.createElement("script"); s.src = "https://unpkg.com/gremlins.js"; if (s.addEventListener) { s.addEventListener("load", callback, false); } else if (s.readyState) { s.onreadystatechange = callback; } document.body.appendChild(s); })()

The current behavior

Error occurs, and gremlins.js stops.
Uncaught (in promise) TypeError: m is null La https://unpkg.com/gremlins.js:1 Na https://unpkg.com/gremlins.js:1 promise callback*Na/< https://unpkg.com/gremlins.js:1 Na https://unpkg.com/gremlins.js:1 i https://unpkg.com/gremlins.js:1 n https://unpkg.com/gremlins.js:1 unleash https://unpkg.com/gremlins.js:1 callback debugger eval code:1 EventListener.handleEvent* debugger eval code:1 <anonymous> debugger eval code:1 getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:243 evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:167 evaluateJS resource://devtools/server/actors/webconsole.js:1127 evaluateJSAsync resource://devtools/server/actors/webconsole.js:1019 makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103 }

The expected behavior

gremlins.js should not stop.

Suggested solution:

By auditing and debugging the source code, I found that the reason for the bug is that sometimes https://github.com/marmelab/gremlins.js/blob/master/src/species/typer.js#L69 returns undefined.

@dmbs335 dmbs335 changed the title Bug: Bug: gremlins.js aborts too early. Mar 31, 2022
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

1 participant