Comments (8)
Can't reproduce. Could you share the test page you run gremlins on? Could you paste the detailed error stack when using the non-minified version of gremlins?
from gremlins.js.
same thing here
from gremlins.js.
Same comment: can you help me reproduce the bug?
from gremlins.js.
After rebuilding the js file with the optimize
property set to none
, then running the test, here is the stack for the error:
Uncaught RangeError: Chance: Min cannot be greater than Max. gremlins.min.js?bust=1395780871173:481
testRange gremlins.min.js?bust=1395780871173:481
Chance.natural gremlins.min.js?bust=1395780871173:603
Chance.pick gremlins.min.js?bust=1395780871173:662
fillSelect gremlins.min.js?bust=1395780871173:2002
formFillerGremlin gremlins.min.js?bust=1395780871173:1975
iterator gremlins.min.js?bust=1395780871173:2564
executeInSeries gremlins.min.js?bust=1395780871173:2576
executeNext gremlins.min.js?bust=1395780871173:2789
(anonymous function) gremlins.min.js?bust=1395780871173:2791
Looks like the error is being thrown by this method in chancejs:
function testRange(test, errorMessage) {
if (test) {
throw new RangeError(errorMessage);
}
}
Which means that the passed options here are invalid?
// NOTE the max and min are INCLUDED in the range. So:
//
// chance.natural({min: 1, max: 3});
//
// would return either 1, 2, or 3.
Chance.prototype.natural = function (options) {
// 9007199254740992 (2^53) is the max integer number in JavaScript
// See: http://vq.io/132sa2j
options = initOptions(options, {min: 0, max: MAX_INT});
testRange(options.min > options.max, "Chance: Min cannot be greater than Max.");
return Math.floor(this.random() * (options.max - options.min + 1) + options.min);
};
Happens every time we launch. Loading the module via requirejs and launching with gremlins.createHorde().unleash()
.
After looking at the stack, please let me know if there are any specific variables you care for us to log.
from gremlins.js.
where is MAX_INT getting defined?
from gremlins.js.
I haven't traced exactly where it is getting defined, yet, but it's value is as the comment indicates: 9007199254740992
The issue definitely seems to be with chance's handling of picking a random item. For some reason at a given moment, element.querySelectorAll('option')
returns no items:
Then, calling pick (with the count argument not defined), it is setting the max value to be -1:
Which then leads to this error being called by chance's natural method, because the range is invalid:
from gremlins.js.
Thanks, you helped me find a bug in case a page contains an empty select. Should be fixed by #52.
from gremlins.js.
👍 awesome work, thanks for taking care of that.
from gremlins.js.
Related Issues (20)
- Current project status HOT 4
- Example of bugs? HOT 3
- Roadmap to Gremlins.js 2.0 HOT 3
- Bug: Uncaught RangeError: Chance: Min cannot be greater than Max. HOT 4
- Bug: Input with `type="number"` breaks gremlins HOT 3
- Bug: Gremlins won't execute in Cypress test HOT 2
- Incorrect params for `customGremlin` in README HOT 2
- Command line interface? HOT 2
- How to test a website? HOT 1
- Detailed logs HOT 3
- Using Within Playwright HOT 3
- the newly opened windows also be monkey tested
- Unable to capture the result /log HOT 1
- Bug: gremlins is not defined in some page HOT 2
- Add support for right click (or in general other buttons) HOT 1
- Interactions not completely deterministic despite seeding the randomizer HOT 4
- Bug: gremlins.js aborts too early.
- Running gremlins.js on a webview
- Is there an example of successfully finding a bug or error? HOT 1
- Bug:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gremlins.js.