capybara_active_admin 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +3 -2
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -0
- data/Rakefile +8 -0
- data/docs/.vuepress/config.js +1 -0
- data/docs/.vuepress/public/.keep +0 -0
- data/lib/capybara/active_admin/actions.rb +2 -2
- data/lib/capybara/active_admin/actions/layout.rb +11 -4
- data/lib/capybara/active_admin/actions/table.rb +12 -0
- data/lib/capybara/active_admin/matchers/layout.rb +6 -0
- data/lib/capybara/active_admin/selectors/layout.rb +2 -2
- data/lib/capybara/active_admin/version.rb +1 -1
- metadata +3 -3
- data/deploy.sh +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5e0ee49e0960bc3a5c3e92594431390718eaed7b46ab634422d6c7c51be233c
|
4
|
+
data.tar.gz: 94ea844aa767f0319abae52517bd56fc2ca46e887e88c74c243b46e101e466c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a541769b989dc70172f98d35833e94a9693227f382d8d2d19df2318be90b711678b0cede99ac509715bfbe95d0315fd66d261501daa47df9f21603f2e1e3ac
|
7
|
+
data.tar.gz: 58fb5eee24078cfbe920c9171a36bffdeae16f25b18f4d74855242623cef63c84577ce6a89b9bd41cb76a3042f75809477891e33366e98af8ba47bfcbdc112f5
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -29,9 +29,10 @@ jobs:
|
|
29
29
|
script: bundle exec rake default
|
30
30
|
- name: "Deploy documentation"
|
31
31
|
stage: deploy
|
32
|
-
install: skip
|
33
32
|
before_script: yarn install
|
34
|
-
script:
|
33
|
+
script:
|
34
|
+
- bundle exec rake yard
|
35
|
+
- yarn docs:build
|
35
36
|
deploy:
|
36
37
|
provider: pages
|
37
38
|
edge: true
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.3.3] - 2020-04-17
|
10
|
+
### Changed
|
11
|
+
- `batch_action_selector`, `click_batch_action` finds element by link text
|
12
|
+
|
13
|
+
### Added
|
14
|
+
- `select_table_row`, `open_batch_action_menu` actions
|
15
|
+
- `have_batch_action` matcher
|
16
|
+
- tests for batch actions
|
17
|
+
|
9
18
|
## [0.3.2] - 2020-04-16
|
10
19
|
### Changed
|
11
20
|
- remove model_name from table related DSL arguments
|
data/Gemfile
CHANGED
@@ -14,6 +14,7 @@ gem 'rake', '~> 12.0'
|
|
14
14
|
gem 'rspec-rails', '~> 4.0'
|
15
15
|
gem 'rubocop', '~> 0.81.0', require: false
|
16
16
|
gem 'system_test_html_screenshots', require: false
|
17
|
+
gem 'yard', require: false
|
17
18
|
|
18
19
|
gem 'activeadmin', ENV.fetch('ACTIVE_ADMIN_VERSION', '~> 2.0'), require: false
|
19
20
|
gem 'rails', ENV.fetch('RAILS_VERSION', '6.0.0')
|
data/Rakefile
CHANGED
@@ -3,8 +3,16 @@
|
|
3
3
|
require 'bundler/gem_tasks'
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
require 'rubocop/rake_task'
|
6
|
+
require 'yard'
|
7
|
+
require 'yard/rake/yardoc_task'
|
6
8
|
|
7
9
|
RSpec::Core::RakeTask.new(:spec)
|
8
10
|
RuboCop::RakeTask.new(:rubocop)
|
11
|
+
YARD::Rake::YardocTask.new(:yard) do |task|
|
12
|
+
task.options += [
|
13
|
+
%(--output-dir=./docs/.vuepress/public/api/),
|
14
|
+
%(--title=Capybara Active Admin API Reference)
|
15
|
+
]
|
16
|
+
end
|
9
17
|
|
10
18
|
task default: [:rubocop, :spec]
|
data/docs/.vuepress/config.js
CHANGED
File without changes
|
@@ -8,8 +8,8 @@ require 'capybara/active_admin/actions/form'
|
|
8
8
|
module Capybara
|
9
9
|
module ActiveAdmin
|
10
10
|
module Actions
|
11
|
-
# Actions are interactions with page that change something.
|
12
|
-
#
|
11
|
+
# Actions are interactions with page that change something (click button, fill field, etc).
|
12
|
+
# Good method names starts with *click_*, *scroll_*, *fill_*, *clear_*, *switch_*, *open_*.
|
13
13
|
|
14
14
|
include Actions::Layout
|
15
15
|
include Actions::Table
|
@@ -16,14 +16,21 @@ module Capybara
|
|
16
16
|
find(tab_header_link_selector, opts).click
|
17
17
|
end
|
18
18
|
|
19
|
-
def click_batch_action(title)
|
20
|
-
|
19
|
+
def click_batch_action(title, exact: true)
|
20
|
+
open_batch_action_menu
|
21
21
|
within(dropdown_list_selector) do
|
22
|
-
selector = batch_action_selector
|
23
|
-
|
22
|
+
selector = batch_action_selector
|
23
|
+
opts = Util.options_with_text(title, exact: exact)
|
24
|
+
find(selector, opts).click
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
28
|
+
def open_batch_action_menu
|
29
|
+
return if find_all(dropdown_list_selector).present?
|
30
|
+
|
31
|
+
find(batch_actions_button_selector).click
|
32
|
+
end
|
33
|
+
|
27
34
|
def confirm_modal_dialog
|
28
35
|
within_modal_dialog { click_button 'OK' }
|
29
36
|
end
|
@@ -4,6 +4,18 @@ module Capybara
|
|
4
4
|
module ActiveAdmin
|
5
5
|
module Actions
|
6
6
|
module Table
|
7
|
+
def select_table_row(id: nil, index: nil)
|
8
|
+
raise ArgumentError, "can't use both :id and :index" if id && index
|
9
|
+
raise ArgumentError, 'must provide :id or :index' if id.nil? && index.nil?
|
10
|
+
|
11
|
+
if id
|
12
|
+
find("input#batch_action_item_#{id}").click
|
13
|
+
return
|
14
|
+
end
|
15
|
+
|
16
|
+
selector = %(input[id^="batch_action_item_"])
|
17
|
+
find_all(selector, minimum: index + 1)[index].click
|
18
|
+
end
|
7
19
|
end
|
8
20
|
end
|
9
21
|
end
|
@@ -38,6 +38,12 @@ module Capybara
|
|
38
38
|
opts = Util.options_with_text(title, options)
|
39
39
|
have_selector(title_selector, opts)
|
40
40
|
end
|
41
|
+
|
42
|
+
def have_batch_action(title, exact: true)
|
43
|
+
selector = "#{dropdown_list_selector} #{batch_action_selector}"
|
44
|
+
opts = Util.options_with_text(title, exact: exact)
|
45
|
+
have_selector(selector, opts)
|
46
|
+
end
|
41
47
|
end
|
42
48
|
end
|
43
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara_active_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -58,8 +58,8 @@ files:
|
|
58
58
|
- bin/console
|
59
59
|
- bin/setup
|
60
60
|
- capybara_active_admin.gemspec
|
61
|
-
- deploy.sh
|
62
61
|
- docs/.vuepress/config.js
|
62
|
+
- docs/.vuepress/public/.keep
|
63
63
|
- docs/.vuepress/styles/index.styl
|
64
64
|
- docs/README.md
|
65
65
|
- docs/guide/README.md
|
data/deploy.sh
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env sh
|
2
|
-
|
3
|
-
# abort on errors
|
4
|
-
set -e
|
5
|
-
|
6
|
-
# build
|
7
|
-
npm run docs:build
|
8
|
-
|
9
|
-
# navigate into the build output directory
|
10
|
-
cd docs/.vuepress/dist
|
11
|
-
|
12
|
-
git init
|
13
|
-
git add -A
|
14
|
-
git commit -m 'deploy'
|
15
|
-
|
16
|
-
# deploying to https://activeadmin-plugins.github.io/capybara_active_admin
|
17
|
-
git push -f git@github.com:activeadmin-plugins/capybara_active_admin.git master:gh-pages
|
18
|
-
|
19
|
-
cd -
|