1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Thomas Walpole
0c43bfbd3c Change #text to be closer to what a browser displays 2018-03-12 09:51:47 -07:00
Thomas Walpole
618dd9ff70 Rubocop driven spec style cleanup 2018-03-01 11:44:55 -08:00
Andy Klimczak
5eb538d730 Fix non-visible text error message
- Remove extra period in the invisible text details message
- Add error validation test that requires :js for when text is changed by `text-transform` css
  - When asserting on text that is changed via css in a test that
  requires :js, the test must assert how the text exactly looks on the
  page, not just in HTML
  - Discrepancy between pure html and actual output on page
  - In this case, the text is found using case insensitive text and
  including non-visible text
  - When those two error detail messages (case insensitive and non-visible) are concatenated, the error
  looks off because of the prepended period.
  - Remove the prepended period so that the error looks correct
2017-11-21 21:19:16 -05:00
Thomas Walpole
c5d7089e0e generally prefer ruby 1.9 hash format 2016-10-04 11:10:29 -07:00
Thomas Walpole
b212d8fa2a Use Capybara::Helpers to_regexp and update history 2016-08-18 10:05:10 -07:00
Ryunosuke Sato
325876ce96 Allow to use text as invalid Regexp for #have_text
When the text as invalid Regexp is given to `#have_text`, it raises the following error:
``` ruby
expect(page).to have_text('[]') #=> RegexpError: empty char-class: /[]/
```

We expect an error `Capybara::ExpectationNotMet`, not a `RegexpError`.
2016-08-18 11:50:59 +09:00
Thomas Walpole
114ec10d12 improve error message when case doesn't match 2016-07-21 11:34:26 -07:00
Alex Chaffee
51c83ed5a9 Improve failure message when text is present but invisible.
When testing a page with JS that hides and shows
certain elements, it's useful to know whether a
test failure means that an element has failed to
render, or has rendered but become invisible (or
failed to become visible).

For instance, some jQuery plugins will take
existing elements and hide them, adding some other
elements onto the page that use the originals as
storage. If your tests are written to use the
now-hidden elements they will mysteriously start
failing.

This commit only changes the behavior for failed
tests (rspec and assert) and only for text
queries. It might be nice to extend this to the
other finders.
2016-07-21 11:29:35 -07:00
Thomas Walpole
07e7777425 frozen literal magic comment 2016-03-07 16:52:19 -08:00
Thomas Walpole
3ae284460b increase timing leeway on test 2015-05-22 15:24:30 -07:00
Andrey Botalov
06c4955e56 Use diffferent queries for searching
* Add assert_text, assert_no_text, assert_title, assert_no_title
* Refactor query resolving
* Improve failure messages for have_text, have_title RSpec matchers (they will be the same as for added assert_* methods)
* Add Simple#inspect
2014-07-01 23:13:45 +03:00