- Issue created by @larowlan
- Merge request !853Issue #3516338 Add e2e test for date range date list β (Merged) created by larowlan
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This blocks π Add e2e test and confirm support for date range default widget Active .
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
This failed for me locally.
cy:command β get @startDateHour cy:command β assert expected **<select>** to have value **'6'**, but the value was **'15'** 0 passing (2m) 1 failing 1) Entity form field types Can interact with form fields: Timed out retrying after 4000ms + expected - actual -'15' +'6' at eval (webpack://@drupal/experience_builder/./tests/e2e/entity-form-field-types-test.cy.js:200:30) at Array.forEach (<anonymous>) at Object.edit (webpack://@drupal/experience_builder/./tests/e2e/entity-form-field-types-test.cy.js:199:40) at eval (webpack://@drupal/experience_builder/./tests/e2e/entity-form-field-types-test.cy.js:349:12) at Array.forEach (<anonymous>) at Context.eval (webpack://@drupal/experience_builder/./tests/e2e/entity-form-field-types-test.cy.js:342:27)
It just happens to work for you because it's your timezone!
I was able to verify that withddev config --timezone=Australia/Sydney
and running the test again.We need to ensure the browser is in that timezone for the tests.
I was able to achieve that with:// We need to set the timezone in the running browser too. Cypress.automation('remote:debugger:protocol', { command: 'Emulation.setTimezoneOverride', params: { timezoneId: 'Australia/Sydney', }, });
in the
before()
method of the test. - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
The timezone needs to match bootstrap.php
So you need to run the cypress command with TZ=Australia/Sydney @penyaskito - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Ah, I didn't read your comment properly, you're saying we can set the timezone in the config.
I'll do that.FYI it's not my timezone, its what core uses in bootstrap.php - mine is slightly different (no daylight savings)
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Now locally my tests are still failing as in #8, even with Emulation.setTimezoneOverride.
Changing docker timezone affects this. I don't think we should rely on it. I'm investigating this. - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
@larowlan Couldn't get to this today. If you want to look at it you can reproduce it with something like TZ=America/Chicago in your container.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
@penyaskito when XbTestSetup runs, the test site installer has already loaded bootstrap.php which has set the PHP default timezone to Australia/Sydney which means that for the logged in user their timezone is set to Australia/Sydney and therefore Drupal shows the default values in that TZ. In this MR we set the timezone in CI to Australia/Sydney - I don't see a way around it because this happens before Drupal is installed and impacts the site's default timezone
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Ah, I think instead of using .local() in day JS I can force the TZ to Australia/Sydney instead.
Leave it with me
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
That's what I thought, but wasn't sure if that would break the actual purpose of the test.
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Rebased.
Thanks to
defaultValue.tz(tz);
we don't need
- // We need to set the timezone in the running browser too. - Cypress.automation('remote:debugger:protocol', { - command: 'Emulation.setTimezoneOverride', - params: { - timezoneId: 'Australia/Sydney', - }, - });
anymore, so removed. This passes for me locally.
- First commit to issue fork.
- πΊπΈUnited States bnjmnm Ann Arbor, MI
With the current implementation, the dropdown options include the label names in addition to the expected number/month/etc values and selecting these results in an error in the preview. (notice I was able to choose "Hour" as an option for the Hour dropdown).
This should get addressed and ideally the test expanded to check at least one of the dropdowns to ensure it doesn't regress to again offering the labels as selectable options.
-
bnjmnm β
committed 431e9418 on 0.x authored by
larowlan β
Issue #3516338 by larowlan, penyaskito, bnjmnm, wim leers: Add e2e test...
-
bnjmnm β
committed 431e9418 on 0.x authored by
larowlan β