chenglou / node-huxley

Codeless front-end testing.
MIT License
361 stars 29 forks source link

Pause action not working #75

Open ocundale opened 10 years ago

ocundale commented 10 years ago

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!

chenglou commented 10 years ago

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

ocundale commented 10 years ago

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 commented 10 years ago

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

chenglou commented 10 years ago

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