node-huxley
node-huxley copied to clipboard
Pause action not working
I need to wait for some elements to load on the page for my test, but whenever I try and use the pause action, it returns undefined? Even when I've recorded the action via hux --record, it doesn't seem to like it... Here's my json:
[
{
"action": "screenshot"
},
{
"action": "pause",
"ms": 5896
},
{
"action": "screenshot"
},
{
"action": "pause",
"ms": 3218
},
{
"action": "click",
"y": 318,
"x": 702
},
{
"action": "pause",
"ms": 1608
},
{
"action": "click",
"y": 318,
"x": 554
},
{
"action": "pause",
"ms": 1758
},
{
"action": "screenshot"
}
]
and my terminal Output:
---
Replaying and writing screenshots for "toggle button"
---
Taking screenshot 1
Pause for undefined ms
Clicking (570, 316)
Taking screenshot 2
Clicking (135, 164)
Clicking (43, 382)
Taking screenshot 3
Any help appreciated!
I copy pasted your exact record file and ran hux --write
on it. It works for me. Maybe there's something else?
Thanks chenglou, I am up and running now, however it might be worth stating that you need to run this command if you manually edit the JSON, as this was the the step I missed. Cheers!
Is there a way to use the tool to do record a single test and compare the results of this with some screenshots that I have already taken? For example, the current method compares two states by running tests for both cases at once. I want to create a single test that I can run and it will take a few screenshots and compare them to a fixed set of screenshots I have taken previously, is this possible? Cheers :)
Yes. Check here.
Specifically for you: hux --compare --only taskName
.
I'm not sure what you mean by this?
it might be worth stating that you need to run this command if you manually edit the JSON