facebookarchive / huxley

A testing system for catching visual regressions in Web applications.
Apache License 2.0
4.07k stars 286 forks source link

huxley improment #26

Closed brain-zhang closed 10 years ago

brain-zhang commented 11 years ago

Dear Pete Hunt: sorry for my poor English first :)

Huxley is useful and interesting.I do some static html UI test for my project.And i do something improment. Maybe someone need this,so i pull it..

1. add a test mode "history",

in this mode, huxley will save screenshot to a folder named by current datetime after each test. for exp: this is my 5 tests later screenclip

if you want to use history mode,just record and play in:

huxley -r -H
huxley -p -H

2. add mouse drag and drop support

we can drag and drop element now

3.improve run.py->navigate()

sometimes, we'll find alert dialog when close or refresh page,i add UnexpectedAlertPresentException to ignore it.

4.add huxleytest.py to support nosetests better.

Now we can

huxley -c facebook

to create a testcase for nosetests and this case will run in history mode default,it'll log pretty if fails.

5. add login.py-->login_handle

sometimes,send postdata won't login correctly because of redirect, i provide a login_handle for custom own login method.

That's what i changed. i'd like that it has something useful. I''m a beginner on github, so i didn't create branch for this pull request.sorry..

petehunt commented 11 years ago

Thanks for this! I'm currently traveling (JSConf EU) so it will be about a week until I can take a look at this.

petehunt commented 11 years ago

Hey @memoryboxes ! Few pieces of feedback.

  1. What's the motivation behind history mode? Is checking your screenshots into Git not working for you? I like using Git or another VCS rather than creating a new solution since there are lots of tools (e.g. bisect) built around existing workflows.
  2. As far as creating test cases goes, I like the general idea. Can we iterate on it in a separate PR?
  3. Drag and drop seems cool too, can we put this in a separate PR too?

Thanks!

brain-zhang commented 11 years ago

Hey @petehunt

very sorry for reply so late.

What's the motivation behind history mode?

I want to browse each testcase results screenshots, so I must save them.And i create an easy tools, here: https://github.com/memoryboxes/huxleyview

I think it's useful and interesting for review each screenshot and find the different between them.

As far as creating test cases goes, I like the general idea. Can we iterate on it in a separate PR? Drag and drop seems cool too, can we put this in a separate PR too?

OK.

Best wishes!

gustavo-almeida commented 10 years ago

@memoryboxes

I'm testing your version of Huxley, but when I try to record a test using login_handle adapted for my project, when huxley starts the step of "Begin playback", something goes wrong: Webdriver is loading homepage without load login page before.