Skip to content

Commit

Permalink
Prepare release with aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Nov 23, 2020
1 parent b5f85c8 commit eacb996
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AllCops:
Exclude:
- "examples/rails_app/**/*"
- "vendor/bundle"
- "tmp/**/*"

Style/DoubleNegation:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased
## Capybara Test Helpers 1.0.2 (2020-11-23) ##

* Add `aliases` DSL to define `SELECTORS`.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
capybara_test_helpers (1.0.1)
capybara_test_helpers (1.0.2)
activesupport
capybara

Expand Down
10 changes: 5 additions & 5 deletions docs/guide/essentials/aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Locator Aliases 🔍

You can encapsulate locators for commonly used elements to avoid hardcoding them
in different tests.
in different tests by defining `aliases`.

As a result, if the UI changes there are less places that need to be updated in
the tests 😃
Expand Down Expand Up @@ -43,18 +43,18 @@ form.within { form.should.have(:name_input, with: 'Jane') }

In the [next section][el convention] we will learn about how `:el` plays a special role.

## Getters
## Aliases Shortcuts

To avoid repetition, getters are available for every defined alias:
To avoid repetition and to keep things concise, getters are available for every defined alias:

```ruby
form.name_input
# same as
form.find(:name_input)
form.find(:fillable_field, 'Name')

form.error_summary(text: "Can't be blank")
# same as
form.find(:error_summary, text: "Can't be blank")
form.find('#error_explanation', visible: true, text: "Can't be blank")
```

## Capybara Selectors
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require Rails.root.join('test_helpers/base_test_helper')

[Check this example][cucumber_integration] to see how you can get started.

Have in mind that RSpec is a much better fit, as Gherkin is very limited.
Have in mind that RSpec is a much better fit, as Gherkin is very limited in its expresiveness.

That said, test helpers do provide [a nice way to share code](https://github.com/ElMassimo/capybara_test_helpers/blob/master/examples/rails_app/features/step_definitions/city_steps.rb) if you are migrating
from Cucumber to RSpec. Check out the [migration guide] for more details.
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara_test_helpers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Easily write fluent Page Objects for Capybara in Ruby.
module CapybaraTestHelpers
VERSION = '1.0.1'
VERSION = '1.0.2'
end

0 comments on commit eacb996

Please sign in to comment.