
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Based on TestSelector for
Elixir, a gem that adds a test-selector
to the HTML so it can be found in the
tests.
After installing this gem the views have a helper method test_selector
that
can be used as:
<!--- app/views/some/view.erb --->
<p <%= test_selector "description", 1 %>the description of entity 1</p>
<p <%= test_selector "description", 2 %>the description of entity 2</p>
That will result in:
<p test-selector="_app_views_some_view_erb__description" test-value="1">the description of entity 1</p>
<p test-selector="_app_views_some_view_erb__description" test-value="2">the description of entity 2</p>
In the test this can be found with:
it "assert the second description" do
... # some setup
test_part = test_selector(path, "description", 1)
expect(find_test_selector page.body, test_part).to have_content "the description of entity 2"
end
Add this line to your application's Gemfile:
Add to the Gemfile
gem 'test_selector'
Execute:
$ bundle
include
in the test framework you're using, for RSpec:
require 'test_selector'
RSpec.configure do |config|
...
config.include TestSelector::TestHelpers
end
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that test_selector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.