Closed tatilepizs closed 2 weeks ago
@tatilepizs Could you please include the log as a text snippet rather than a screenshot so we can find this issue when doing a text search?
Sure, I updated the description.
I think the failure is both in the test and in the hook. Looking at the reported screenshots, it looks like the language actually never changes:
The way the test was written, only a few components on the page will have translations as seen in the createLanguage
function at the top of the spec file:
'n.month': '{MONTHS, plural, =1{1 luna} other{# luni}}',
'n.week': '{WEEKS, plural, =1{1 saptamana} other{# saptamani}}',
'reports.none.n.months':
'{MONTHS, plural, =1{No reports in the last month.} other{No reports in the last # months.}}',
'task.days.left': '{DAYS, plural, =1{1 day left} other{# days left}',
'tasks.none.n.weeks': '{WEEKS, plural, =1{No tasks in the next week.} other{No tasks in the next # weeks.}}',
'Reports': 'HilReports',
'view.all': 'View all'
So the expected screenshot when the test runs successfully will look like this:
Also, the validations for the language translations are only for the Tasks
filter and the HilReports
filter.
From my investigations I noticed intermittent failures happening in the afterEach hook majorly because of a timeout which seems to happen in the revertSettings
.
Timeout of 120000ms exceeded. The execution in the test "Testing Incorrect locale should work with incorrect locale" took too long. Try to reduce the run time or increase your timeout for test specs (https://webdriver.io/docs/timeouts). (/home/runner/work/cht-core/cht-core/tests/e2e/default/translations/incorrect-locale.wdio-spec.js)
Moving this function from the afterEach block to the main test block seemed to make the test more stable and we can accommodate this fix for now because we have only one test in the spec file - /tests/e2e/default/translations/incorrect-locale.wdio-spec.js
After executing the test about 20 times here, there was no related failure - the only failure on Attempt#5 & Attempt#20 happened because of this error - A previous test did not call revertSettings
in the createLanguage
function and isn't one of the previous functions in the afterEach block.
Describe the issue E2e test /tests/e2e/default/translations/incorrect-locale.wdio-spec.js has been failing constantly in the "after each" hook due to timing
This is an example run
Here is the artifact in case it is helpful -> incorrect-locale-ci-webdriver-default-core-minimum-browser.zip