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

e2eテストを作る時のコードの指針を考えてどこかにメモする #1863

Open
Hiroshiba opened this issue Feb 21, 2024 · 0 comments
Labels
要議論 実行する前に議論が必要そうなもの

Comments

@Hiroshiba
Copy link
Member

Hiroshiba commented Feb 21, 2024

内容

e2eテストを書くとき、自由度はかなり高いので書くときもレビューする時も基準がなく結構大変だということに気づきました。
なのでなんとなく方針を定めてどこかに記載して案内すれば迷わずに済む&時間短縮にもなるかなと思いました!

Pros 良くなる点

方針がわかりやすくなる。
迷いが減る。

実現方法

とりあえず今思いついているなんとなくの方針はこんな感じです。

  • getByなんとかで済むならそちらを
  • クラス名でもコンポーネント名に一致するものは使ってOK
  • 役割がある操作可能な要素はaria-labelを付与してもOK
  • 役割がある操作不可能な要素はdata-testidを付与してもOK
  • なるべく範囲を絞ると良い

まとめたらREADMEのe2e testのとこか、test/e2eディレクトリのREADME あたりに記載しようかなと思ってます。

その他

思いついたこととかあれば何でもコメントいただければ!

@Hiroshiba Hiroshiba added the 要議論 実行する前に議論が必要そうなもの label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
要議論 実行する前に議論が必要そうなもの
Projects
None yet
Development

No branches or pull requests

1 participant