From ae6c353b51a37daa2f7e98540133d58661fd2cd0 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 13 Dec 2023 13:33:52 -0500 Subject: [PATCH] docs(test): add locale best practice (#28699) This best practice currently resides in our internal testing process docs. I think this is valuable information for contributors to have as well, so I've added it to our public best practices doc. --- core/src/utils/test/playwright/docs/best-practices.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/utils/test/playwright/docs/best-practices.md b/core/src/utils/test/playwright/docs/best-practices.md index 79d79653de..d17cd250dd 100644 --- a/core/src/utils/test/playwright/docs/best-practices.md +++ b/core/src/utils/test/playwright/docs/best-practices.md @@ -18,6 +18,7 @@ This guide details best practices that should be followed when writing E2E tests - [Test for positive and negative cases](#practice-positive-negative) - [Start your test with the configuration or layout in place if possible](#practice-test-config) - [Place your test closest to the fix or feature](#practice-test-close) +- [Account for different locales when writing tests](#practice-locales)

Use the customized `test` function

@@ -259,3 +260,7 @@ This allows tests to remain fast on CI as we can focus on the test itself instea

Place your test closest to the fix or feature

Tests should be placed closest to where the fix or feature was implemented. This means that if a fix was written for `ion-button`, then the test should be placed in `src/components/button/tests`. + +

Account for different locales when writing tests

+ +Tests ran on CI may not run on the same locale as your local machine. It's always a good idea to apply locale considerations to components that support it, when writing tests (i.e. `ion-datetime` should specify `locale="en-US"`).