- Issue created by @zniki.ru
- Assigned to zniki.ru
- Status changed to Needs work
11 months ago 7:28pm 8 January 2024 - Issue was unassigned.
- Status changed to Active
11 months ago 9:41pm 8 January 2024 - Merge request !40Draft: Resolve #3413295 "Fix functional tests 8.x-1.x" → (Closed) created by zniki.ru
- Status changed to Needs review
11 months ago 10:02pm 8 January 2024 - last update
11 months ago 42 pass - last update
11 months ago 43 pass - Status changed to Needs work
11 months ago 10:20pm 8 January 2024 - 🇺🇸United States dww
Thanks for splitting this off to a separate issue, and thanks for the MRs! It's fantastic that the phpunit tests are all passing in both pipelines!! 🎉
However, I opened some important MR threads. I'm only reviewing !39 for now, but the same feedback applies to both. If you want to get 2.0.x done first, then backport, that's fine with me. Or if you want to keep them in sync, I'm okay with that, too.
Thanks again!
-Derek - 🇺🇸United States dww
Just noticed this at the very end of #3316274-118: Stabilize FunctionalJavascript testing AJAX: add ::assertExpectedAjaxRequest() → :
Just FYI for anyone else that finds this issue because their assertWaitOnAjaxRequest() calls started failing, you need to now enable js_testing_ajax_request_test for any JS test that uses this function.
js_testing_ajax_request_test provides test JS code that set window.drupalActiveXhrCount and window.drupalCumulativeXhrCount. Those variables are required to have a successful assertWaitOnAjaxRequest call.
Let's try a new branch where we just enable that module and see how that does...
- 🇷🇺Russia zniki.ru
Thanks for the feedback, I read this comment and forgot about it.
But as you can see in the WebDriverTestBase::installModulesFromClassProperty() module js_testing_ajax_request_test used by default, and I can confirm it from html output provided by phpunit that<script src="/core/modules/system/tests/modules/js_testing_ajax_request_test/js/js_testing_ajax_request_test.js?v=10.2.1"></script>
presented on the page.
Just to be 100% sure I tried adding js_testing_ajax_request_test to AddressDefaultWidgetTest::$modules.
And it doesn't help. I will add draft MR to have confirmation.I marked MR 40 as draft, so it will be obvious where to focus on.
- last update
11 months ago 36 pass, 2 fail - last update
11 months ago 36 pass, 2 fail - 🇷🇺Russia zniki.ru
I create MR 41, with adding js_testing_ajax_request_test to AddressDefaultWidgetTest::$modules.
MR tests failed. - last update
11 months ago 43 pass - last update
11 months ago 43 pass - Status changed to Needs review
11 months ago 11:52am 9 January 2024 - 🇷🇺Russia zniki.ru
Nikolay Shapovalov → changed the visibility of the branch 3413295-fix-function-tests--add-module to hidden.
- 🇷🇺Russia zniki.ru
Nikolay Shapovalov → changed the visibility of the branch 3413295-fix-function-tests-8.x to hidden.
- last update
11 months ago 43 pass - last update
11 months ago 7 pass, 13 fail - 🇺🇸United States dww
I tried running tests locally with the 3413295-fix-function-tests branch and was consistently getting failures:
There was 1 error: 1) Drupal\Tests\address\FunctionalJavascript\AddressDefaultWidgetTest::testMultipleWidget Behat\Mink\Exception\ExpectationException: A field "field_address[1][address][given_name]" appears on this page, but it should not. /Applications/MAMP-common/htdocs/drupal-10/vendor/behat/mink/src/WebAssert.php:794 /Applications/MAMP-common/htdocs/drupal-10/vendor/behat/mink/src/WebAssert.php:681 /Users/dww/drupal/address/tests/src/FunctionalJavascript/AddressDefaultWidgetTest.php:764 /Users/dww/drupal/address/tests/src/FunctionalJavascript/AddressDefaultWidgetTest.php:639
The final conversion here was wrong. The test is setting a country to '- None -' and trying to clear the field value. By waiting for given name, we immediately submit the form before AJAX has replaced the value with an empty address. There doesn't seem to be a more reasonable way to wait for this than the original
assertWaitOnAjaxRequest()
. I tested locally on various versions of core. I pushed the commit to the MR and the GitLab pipelines passed everywhere. I think this is as solid as we're going to get for now. -
dww →
committed 7fad463c on 2.0.x authored by
Nikolay Shapovalov →
Issue #3413295 by Nikolay Shapovalov, dww: Fix FunctionalJavascript...
-
dww →
committed 7fad463c on 2.0.x authored by
Nikolay Shapovalov →
-
dww →
committed b640a115 on 8.x-1.x authored by
Nikolay Shapovalov →
Issue #3413295 by Nikolay Shapovalov, dww: Fix FunctionalJavascript...
-
dww →
committed b640a115 on 8.x-1.x authored by
Nikolay Shapovalov →
- 🇺🇸United States dww
Those 10.2 test failures in DrupalCI are from D11 deprecation warnings. We shouldn't be failing on those (yet) 😅 and they're not introduced by this patch, so I'm going to ignore them.
Merged this (minus the GitLab CI changes) to 2.0.x and cherry-pick'ed to 8.x-1.x. Thanks again!
- Status changed to Fixed
11 months ago 11:22pm 9 January 2024 - Status changed to Needs review
11 months ago 12:02am 10 January 2024 - 🇺🇸United States dww
Well, drat. ;) I forgot to test this with 9.5 and PHP 7.4. The latest commits in here use
match
which is elegant, but PHP 8+ only. Technically, the 8.x-1.x branch is still supposed to work with 7.4. Pushing another commit to keep this elegant but working on PHP 7.4, too... - 🇺🇸United States dww
Let's see how https://git.drupalcode.org/project/address/-/pipelines/74589 (2.0.x) and https://git.drupalcode.org/project/address/-/pipelines/74590 (8.x-1.x) turn out...
- Status changed to Fixed
11 months ago 12:51am 10 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.