Commit Graph

28 Commits

Author SHA1 Message Date
Thomas Walpole b1f4709c6e General code cleanup 2018-05-16 12:47:08 -07:00
Thomas Walpole 952d373026 Cleanup some rubocop style warnings 2018-05-14 16:06:53 -07:00
Thomas Walpole baabfa5d67 Require minimum of Ruby 2.3.0 2018-05-14 13:17:06 -07:00
Thomas Walpole a17e9c36fa Add rubocop-spec - some disabled for now 2018-04-30 18:00:16 -07:00
Thomas Walpole 0c43bfbd3c Change #text to be closer to what a browser displays 2018-03-12 09:51:47 -07:00
Thomas Walpole a0f913be7d Capybara::Helpers keyword args 2018-02-27 18:22:14 -08:00
Thomas Walpole dfaf958ea7 more code cleanup 2018-01-15 14:02:20 -08:00
Thomas Walpole 86ede5207a code cleanup/refactor 2018-01-11 18:17:38 -08:00
Thomas Walpole 24eb7a0702 rubocop driven style cleanup 2018-01-09 16:01:47 -08:00
Thomas Walpole e68051f6ac Rubocop driven cleanup 2018-01-08 14:39:56 -08:00
Thomas Walpole efe48bb685 update 2018-01-03 09:04:12 -08:00
Thomas Walpole aa73e3a94d Parameter cleanup 2018-01-03 09:04:12 -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 1f56ec47b7 minor code cleanup inspired by RustyNail 2017-10-10 17:20:32 -07:00
Thomas Walpole 8f5f55af89 Fix Ruby warnings during tests 2017-05-31 17:52:11 -07:00
Thomas Walpole 0270b7a4cf Per-session config and thread specific current_driver/session_name 2017-04-27 13:37:04 -07:00
Thomas Walpole 92098f44b0 fix bad commit 2017-01-18 19:33:52 -08:00
Thomas Walpole 1a21567b9a ignore errors when trying to create detailed error message 2017-01-18 18:14:19 -08:00
Thomas Walpole e85cce5778 Support easier full text matching 2016-12-23 12:28:25 -08:00
Thomas Walpole 5033eca9fc move helpers to BaseQuery 2016-08-31 12:04:22 -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
Akira Matsuda 8f43c71e78 "warning: instance variable @type not initialized" 2015-07-21 17:26:34 +09:00
Thomas Walpole bc47af003e raise error when invalid options are passed to have_text/have_content - Fixes issue #1549 2015-07-16 10:46:44 -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