https://github.com/rmosolgo/refract
https://github.com/rmosolgo/refract
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rmosolgo/refract
- Owner: rmosolgo
- License: mit
- Created: 2016-12-21T19:06:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T20:47:12.000Z (about 9 years ago)
- Last Synced: 2025-10-06T14:49:44.557Z (3 months ago)
- Language: Ruby
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Refract
Visual diffing in your development environment.
## Installation
```ruby
gem 'refract'
```
## Usage
- define a run in `snapshots.rb`
```ruby
# snapshots.rb
Refract.run do |run|
# Specify a Capybara Driver:
run.driver(:selenium)
# Snapshots will be taken with each dimension:
run.dimension(1024, 768)
run.dimension(320, 568)
# `session` is a Capybara::Session
run.before do |session|
# executed before each script
end
run.script do |session|
# Take a snapshot with this name:
session.snapshot("Landing Page")
# click things ...
session.snapshot("Event Page")
end
run.script do |session|
# ...
end
end
```
- manage runs in the browser:
```
$ bundle exec refract serve
```
- or, run in the terminal:
```
$ bundle exec refract run
```
## Development
- Trying out the server
- Enter a project to test on: `$ cd ~/code/my_rails_app`
- `gem "refract", path: "~/code/refract"`
- `bundle exec refract serve`
- Visit `http://localhost:7777`
- Running the tests
- HA HA HA. There are no tests. None.
## TODO
- How to get full-height screenshot?
- How to not have zombie selenium processes?
- How to have a nice headless browser on OSX (with full-height screenshots)?
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).