This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyApp.WaitHelper do | |
| use Hound.Helpers | |
| def wait_until(fun), do: wait_until(1000, fun) | |
| def wait_until(0, fun), do: fun.() | |
| def wait_until(timeout, fun) do | |
| fun.() | |
| rescue | |
| Hound.NoSuchElementError -> retry(timeout, fun) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config.assets.precompile += [ | |
| # precompile any CSS or JS file that doesn't start with _ | |
| /(^inline[^_\/]|\/[^_])[^\/]*.(js|css)$/, | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |