-
Notifications
You must be signed in to change notification settings - Fork 16
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
Issue: gremlins.js gremlins.species.scroller() crashes Chromote session #117
Labels
wontfix
This will not be worked on
Comments
Side note. A working gremlins config for this app. I set up a custom clicker that will only target the slider. I also assume some touch events (mobile, ...), set probability distribution of triggering each species. Also adding some quick log message at the end of the promise: const customClicker = gremlins.species.clicker({
// which mouse event types will be triggered
clickTypes: ['click'],
// Click only if element has id obs
canClick: (element) => element.id === 'obs',
// by default, the clicker gremlin shows its action by a red circle
// overriding showAction() with an empty function makes the gremlin action invisible
showAction: (x, y) => {},
});
gremlins.createHorde({
randomizer: new gremlins.Chance(1234), // repeatable
species: [customClicker, gremlins.species.toucher()],
mogwais: [gremlins.mogwais.alert(),gremlins.mogwais.gizmo()],
strategies: [
gremlins.strategies.distribution({
distribution: [0.8, 0.2], // custom
delay: 10 // default
})
]
}).unleash().then(() => {
console.log('Gremlins test success')
}); |
Debug idea...
app <- AppDriver$new(....)
# Set up the crash callback
chromote_session <- app$get_chromote_session()
chromote_session$Inspector$targetCrashed(function(...) {
# Notify event is running
message("Running Inspector.targetCrashed callback!")
# Display args being passed in
str(list(...))
# Display current app log
print(app$get_log())
})
# Perform actions as normal to trigger the crash
.... |
@schloerke: I can give it a try on a test branch. |
Covered in this vignette. |
Fixed in #140 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @schloerke ,
as discussed, I open this issue just for recording it. I was trying to run Monkey testing with shinytest2, leveraging gremlins.js.
Below is my test example:
app.R
shinytest2
code:Setting the gremlins.js require to inject a JS script in the DOM. Notice, sometimes
https://unpkg.com/gremlins.js
maybe blocked by corporate networks. A solution is to serve the gremlins JS with the app using local script copy and a call toaddResourcePath("gremlins", "inst/js")
... :Then just check if the script is in the DOM and if we can get
window.gremlins
:If it is an
object
this is fine, if not this is likely because the script was blocked (see above).Next step is to set up the gremlins horde. This is where I get the issue. They provide a plug and play script:
I never managed to get it working on CI/CD. I realised later that the
gremlins.species.scroller()
is crashing the Chromote session:As I said, I am not able to reproduce locally where it works well and with the same Chrome version (Google Chrome 98.0.4758.102).
In practice, I don't think users will ever need the
scroller
gremlins since this app only requiresclick
andtouch
. I'll add a warning in the upcoming vignette.The text was updated successfully, but these errors were encountered: