-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add: VRTを追加 #1688
Add: VRTを追加 #1688
Conversation
[update snapshots]
[update snapshots]
[update snapshots]
[skip ci]
README.md
Outdated
#### スクリーンショットの更新 | ||
|
||
ブラウザ End to End テストでは Visual Regression Testing を行っています。 | ||
以下の手順でスクリーンショットを更新できます: | ||
|
||
1. GitHub Actions をフォークしたリポジトリで有効にします。 | ||
2. リポジトリの設定の Actions > General > Workflow permissions で Read and write permissions を選択します。 | ||
3. `[update snapshots]` という文字列をコミットメッセージに含めてコミットします。 | ||
|
||
```bash | ||
git commit -m "UIを変更 [update snapshots]" | ||
``` | ||
|
||
4. 6 分ほどで更新されたスクリーンショットがコミットされます。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こんな感じで更新できるようにしてみました。
もしかしたらPR作る感じにした方が良いかも?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良いですね!!!ぜひマージしたいです。
ちょっとまずモック用のリソースに関してだけコメントさせて頂きました!!
[update snapshots]
[skip ci]
[update snapshots]
[update snapshots]
[update snapshots]
スクロールバーが現れたり現れなかったりするの、謎ですね・・・・・・。 なんとなくなんですが、もしかしてもしかしたらgithub actions上で使っている |
うーーーーーーーーーーん。。。。。。。 |
VRTやりたいけど難しいですね。。。。。。 |
[update-snapshots]
Windows限定にしてみました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
めちゃくちゃいいですね!!!
ちょっと色々コメントさせていただきましたが、大枠は完璧だと思います!
コメントも適宜書いてくださってすごいわかりやすかったです。
// eslint-disable-next-line no-constant-condition | ||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ一生テストが終わらないとかありそうなので、20回ぐらいトライしたらエラーにするみたいな処理書いてもいいかも?
そういうリトライ用の便利関数をutilityに実装しちゃうとかどうでしょう。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一生テストが終わらない
Playwright側でタイムアウトしてくれるので大丈夫だと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほどです。
タイムアウトが30秒くらいだったとして、本来数秒でわかる問題を発見するのに数十秒かかるのは、まあ避けといたほうが良い気もしました。
ESLintの警告を無視しているのも気になったのですが、調べた感じこれはデフォルトの挙動を変えないかという議論中でした。
eslint/eslint#17807
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
基本的に多分画面ごとにテストがあって、その中で1つのテストとしてスクリーンショットテストがあるのかなと想像してます。
なのでスクリーンショット.spec.tsは将来的に解体されるかも?
Co-authored-by: Hiroshiba <[email protected]>
Co-authored-by: Hiroshiba <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューを反映しました。
// eslint-disable-next-line no-constant-condition | ||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一生テストが終わらない
Playwright側でタイムアウトしてくれるので大丈夫だと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!!!!!!!!!
試しに使ってみるのが非常に楽しみです!!!!!
commit-snapshots: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: | ||
- e2e-test | ||
steps: | ||
- uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今気づいたのですが、このjobを実行するかどうかをshouldUpdateSnapshots
の出力から判定できるかもですね。
if: steps.check-whether-to-update-snapshots.outputs.shouldUpdateSnapshots == 'true'
をここに書くとかで。
内容
Visual Regression Testingを追加します。
関連 Issue
スクリーンショット・動画など
(なし)
その他
(なし)