playwright-ruby-client
playwright-ruby-client copied to clipboard
Minitest spec expectations
Simple description about the feature
Add Minitest spec expectations for parity with rspec
Usecase / Motivation
I'm using Minitest spec in my project and trying to figure out what is needed to enable tests like the rspec examples on https://playwright-ruby-client.vercel.app/docs/article/guides/rspec_integration
I think the desired outcome would be something similar to capybara's expectations here https://github.com/teamcapybara/capybara/blob/master/lib/capybara/minitest/spec.rb
For example,
it 'should show username after login' do
page.fill('input[name="username"]', 'playwright')
page.fill('input[name="password"]', 'password123')
page.expect_navigation do
page.locator('button[type="submit"]').click
end
dashboard_container = page.locator('.dashboard')
# Web-first assertion
expect(dashboard_container).must_have_text('Hi, playwright!')
end
I'm happy to try and make a PR for this work, but wondered if any thought has already been done on how to handle, or maybe it already works and I just don't know the right syntax.