capybara-skill
This skill enables you to automatically generate Capybara acceptance tests for web applications, streamlining your test automation workflow. Built by LambdaTest (now TestMu AI), it simplifies the process of creating robust browser-based test scenarios without manual coding overhead.
capybara-skill helps you generate Capybara acceptance tests for web applications by automating test creation. To write tests manually, you'll use Capybara's DSL with methods like `visit` to navigate to pages, `fill_in` to enter form data, and `click_button` to interact with elements. capybara-skill streamlines this by generating these test scenarios automatically, reducing manual coding overhead and helping you create robust browser-based test cases efficiently.
AI-generated summary based on this skill's SKILL.md
Install
LambdaTest/agent-skills/capybara-skill · repository language: Python
git clone https://github.com/LambdaTest/agent-skills
cp -r agent-skills/capybara-skill ~/.claude/skills/capybara-skillFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I write Capybara tests in Ruby?
capybara-skill helps you generate Capybara acceptance tests for web applications by automating test creation. To write tests manually, you'll use Capybara's DSL with methods like `visit` to navigate to pages, `fill_in` to enter form data, and `click_button` to interact with elements. capybara-skill streamlines this by generating these test scenarios automatically, reducing manual coding overhead and helping you create robust browser-based test cases efficiently.
What is the capybara-skill and how does it work?
capybara-skill is a skill that enables you to automatically generate Capybara acceptance tests for web applications, streamlining your test automation workflow. Built by LambdaTest (now TestMu AI), capybara-skill simplifies the process of creating robust browser-based test scenarios without manual coding overhead. It integrates with your existing RSpec and Selenium WebDriver setup to produce ready-to-run acceptance tests.
How do I set up Capybara with RSpec and Selenium WebDriver?
capybara-skill supports setup with RSpec and Selenium WebDriver as part of its core functionality. When configuring Capybara for your project, you'll typically add the gems to your Gemfile, configure your test environment with a driver (Selenium WebDriver is a common choice), and set up your RSpec integration. capybara-skill can guide you through this configuration and help generate feature specs that work seamlessly with your RSpec setup.
Can capybara-skill help me run tests on cloud platforms like LambdaTest?
Yes, capybara-skill includes support for running Capybara tests on cloud platforms like LambdaTest. This capability allows you to execute your generated acceptance tests across multiple browsers and environments without managing local infrastructure. capybara-skill can help you configure remote browser integration and generate tests optimized for cloud-based test execution.
What matchers and DSL syntax does Capybara provide for browser automation?
capybara-skill helps you leverage Capybara's comprehensive DSL and matchers for browser automation. Key matchers include `have_content` for verifying page text, `have_selector` for finding elements, and `have_xpath` for XPath queries. The DSL includes navigation methods like `visit`, interaction methods like `click_button` and `fill_in`, and scoping methods like `within`. capybara-skill generates tests using these matchers and DSL methods to create maintainable acceptance test suites.
How do I debug and troubleshoot Capybara test failures?
capybara-skill assists with debugging common Capybara test issues by helping you understand test failures and generate corrected test scenarios. When tests fail, you can inspect element selectors, verify page state with matchers like `have_content`, and use scoping with `within` to isolate problematic interactions. capybara-skill can help identify issues in your generated tests and suggest corrections to improve test reliability and stability.
SKILL.md
rendered from the published skill — quoted content, verbatim
Capybara Automation Skill
Core Patterns
Basic Test (RSpec)
require 'capybara/rspec'
RSpec.describe 'Login', type: :feature do
it 'logs in with valid credentials' do
visit '/login'
fill_in 'Email', with: 'user@test.com'
fill_in 'Password', with: 'password123'
click_button 'Login'
expect(page).to have_content('Dashboard')
expect(page).to have_current_path('/dashboard')
end
it 'shows error for invalid credentials' do
visit '/login'
fill_in 'Email', with: 'wrong@test.com'
fill_in 'Password', with: 'wrong'
click_button 'Login'
expect(page).to have_content('Invalid credentials')
end
end
DSL
```ruby
Navigation
visit '/path' go_back go_forward
Interacting
fill_in 'Label or Name',
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 4 files
capybara-skill/SKILL.md
capybara-skill/reference/advanced-patterns.md
capybara-skill/reference/cloud-integration.md
capybara-skill/reference/playbook.md