chenglou / node-huxley

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

Real-time option only works when enabled, disabled, then enabled again. #72

Closed gilbox closed 10 years ago

gilbox commented 10 years ago

I am testing in Chrome:

When beginning a record session, if I press l <enter> to enable real-time recording, it doesn't work when I playback the test. However if (at the beginning of a record session) I press l <enter> l <enter> l <enter> then real-time recording works.

chenglou commented 10 years ago

Can you give me the exact sequence of keys you used?

gilbox commented 10 years ago

chenglou, thanks for the response. Actually I am unable to reproduce a successful real-time recording session now. It worked 2 times if I followed the sequence I outlined above, but now when I try again it does not work.

$ hux -r -b chrome
--------------------------------
Begin record "2013-09-08"
--------------------------------
`enter`: take screenshot.
`l` `enter`: toggle real-time recording (for animation, ajax).
`q` `enter`: quit.

> l
Live playback on.
> 
screenshot 1 recorded.
> 
screenshot 2 recorded.
> 
screenshot 3 recorded.
> 
screenshot 4 recorded.
> 
screenshot 5 recorded.
> q
All done.
gilbox commented 10 years ago

Playback... This is not from the same recording session as above, but it is another failed session. Notice how all the clicks are at the beginning, however during recording I was clicking between screen grabs.

$ hux -w -b chrome
---
Replaying and writing screenshots for "2013-09-08"
---
  Clicking (209, 167)
  Clicking (219, 136)
  Clicking (207, 231)
  Clicking (204, 168)
  Clicking (208, 217)
  Clicking (168, 303)
  Pause for 424 ms
  Pause for 4208 ms
  Taking screenshot 1
  Pause for 2456 ms
  Taking screenshot 2
  Pause for 4671 ms
  Taking screenshot 3
  Pause for 4409 ms
  Taking screenshot 4
  Pause for 2991 ms
  Taking screenshot 5
All done.
gilbox commented 10 years ago

Here is the record.json from the previous...

[
  {
    "action": "click",
    "x": 209,
    "y": 167
  },
  {
    "action": "click",
    "x": 219,
    "y": 136
  },
  {
    "action": "click",
    "x": 207,
    "y": 231
  },
  {
    "action": "click",
    "x": 204,
    "y": 168
  },
  {
    "action": "click",
    "x": 208,
    "y": 217
  },
  {
    "action": "click",
    "x": 168,
    "y": 303
  },
  {
    "action": "pause",
    "ms": 424
  },
  {
    "action": "pause",
    "ms": 4208
  },
  {
    "action": "screenshot"
  },
  {
    "action": "pause",
    "ms": 2456
  },
  {
    "action": "screenshot"
  },
  {
    "action": "pause",
    "ms": 4671
  },
  {
    "action": "screenshot"
  },
  {
    "action": "pause",
    "ms": 4409
  },
  {
    "action": "screenshot"
  },
  {
    "action": "pause",
    "ms": 2991
  },
  {
    "action": "screenshot"
  }
]
chenglou commented 10 years ago

What's the recording session like for the above one?

gilbox commented 10 years ago

This is the recording session. I was trying the "fix" but it didn't work...

$ hux -r -b chrome
--------------------------------
Begin record "2013-09-08"
--------------------------------
`enter`: take screenshot.
`l` `enter`: toggle real-time recording (for animation, ajax).
`q` `enter`: quit.

> l
Live playback on.
> l
Live playback off.
> l
Live playback on.
> 
screenshot 1 recorded.
> 
screenshot 2 recorded.
> 
screenshot 3 recorded.
> 
screenshot 4 recorded.
> 
screenshot 5 recorded.
> l
Live playback off.
> q
All done.
chenglou commented 10 years ago

Humm... I did what you seemed to describe and it works correctly here:

screenshot 2014-09-08 23 29 54

gilbox commented 10 years ago

huxley-example works fine for me. I think I figure out the problem. Opening a new issue.