node-huxley icon indicating copy to clipboard operation
node-huxley copied to clipboard

Pause action not working

Open ocundale opened this issue 10 years ago • 4 comments

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!

ocundale avatar Sep 16 '14 11:09 ocundale

I copy pasted your exact record file and ran hux --write on it. It works for me. Maybe there's something else?

chenglou avatar Sep 16 '14 16:09 chenglou

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!

ocundale avatar Sep 17 '14 10:09 ocundale

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 :)

ocundale avatar Sep 17 '14 10:09 ocundale

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

chenglou avatar Sep 17 '14 11:09 chenglou