Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use with Chromatic #320

Open
rangerscience opened this issue Dec 7, 2024 · 3 comments
Open

Use with Chromatic #320

rangerscience opened this issue Dec 7, 2024 · 3 comments

Comments

@rangerscience
Copy link

Simple description about the feature

Chromatic has a very simple integration with Playwright: https://www.chromatic.com/docs/playwright/

Replace:

import { test, expect } from "@playwright/test"; 

with:

import { test, expect } from "@chromatic-com/playwright"; 

Any pointers for where to look in this gem to allow or make this change?

(I think there might be another way using the JS module resolution stuff, but I'm still new to all that...)

Usecase / Motivation

Allows you to use this gem and Chromatic.

@YusukeIwaki
Copy link
Owner

Hi, thank you for your suggestion.

playwright-ruby-client is browser-automation tool,
and visual regression testing feature would be provided by a plugin for testing library (rspec-xxxx, minitest-xxxx).

@rangerscience
Copy link
Author

Yes, Chromatic provides visual regression testing, and does so as a plugin/testing library, by replacing the "@playwright/test" with "@chromatic-com/playwright". Reading Chromatic's docs, it does this because it uses the browser automation to capture HTML as the visual test, rather than a screenshot image.

Let me try a different question: Where does "@playwright/test" get used by this gem? :)

@YusukeIwaki
Copy link
Owner

@rangerscience @playwright/test is just a test runner (test framework) like mocha, jest and not a browser-automation library.

This playwright-ruby-client gem provides feature for browser-automation and assertion, however no test runner (framework) features are provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants