Comments (7)
def within_sidebar(title)
sidebar = page.find('#sidebar > .sidebar_section > h3', text: title).ancestor('.sidebar_section')
within(sidebar) { yield }
end
from capybara_active_admin.
def find_action_item(title, exact: true)
opts = exact ? { exact_text: title } : { text: title }
page.find(action_item_selector, opts)
end
def have_action_item_link(title, exact: true, href: nil, **options)
opts = exact ? { exact_text: title } : { text: title }
opts.merge!(options)
selector = "#{action_item_selector} > a"
selector += "[href=\"#{href}\"]" if href.present?
have_selector(selector, opts)
end
def within_action_item_dropdown
within("#{action_item_selector} .dropdown_menu_list_wrapper") { yield }
end
from capybara_active_admin.
# override Capybara::ActiveAdmin::Selectors::Form#has_many_fields_selector
# @param association_name [String]
# @return [String] selector.
def has_many_fields_selector(association_name)
".has_many_container.#{association_name} > fieldset.inputs.has_many_fields"
end
from capybara_active_admin.
def within_attribute_row(label)
selector = attributes_row_selector(label)
within(selector) { yield }
end
from capybara_active_admin.
def have_status_tag(text, type:, **options)
selector = ".status_tag.#{type}"
opts = options.merge exact_text: text
have_selector(selector, opts)
end
from capybara_active_admin.
def have_table_scope(title, selected: false)
selector = table_scope_selector(selected)
have_selector(selector, exact_text: title.to_s)
end
def table_scope_selector(selected)
if selected
'div.scopes li.scope.selected'
else
'div.scopes li.scope'
end
end
from capybara_active_admin.
# @example usage
# expect(page).to have_status_tag(:error, exact_text: 'DOWN')
def have_status_tag(type, **options)
have_selector("span.status_tag.#{type}", **options)
end
from capybara_active_admin.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capybara_active_admin.