- Issue created by @vishalshah133
- π¬π§United Kingdom longwave UK
We are having trouble upgrading Nightwatch past 2.4.2 already, see π Update Nightwatch from 2.4.2 to 2.6.19 Closed: duplicate - whatever is broken there needs fixing first.
- First commit to issue fork.
- Open on Drupal.org βEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - last update
over 1 year ago Build Successful - @swrdfish opened merge request.
I was able to get nightwatch 3.0.1 running and have submitted a merge PR. But several tests were failing. I am trying to setup a local environment to try and debug the tests, till now I have not been able to setup a test environment.
- Open on Drupal.org βEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - Status changed to Needs review
over 1 year ago 2:11pm 27 July 2023 - π¬π§United Kingdom longwave UK
The
domain
setting in cookies does not work the same way when w3c mode is enabled, removing it from the SIMPLETEST_USER_AGENT cookie works locally for me. - last update
over 1 year ago CI aborted - last update
over 1 year ago 29,776 pass - πΊπΈUnited States effulgentsia
longwave β credited effulgentsia β .
- π¬π§United Kingdom longwave UK
Crediting contributors to π Update Nightwatch from 2.4.2 to 2.6.19 Closed: duplicate
- Status changed to Needs work
over 1 year ago 3:06pm 27 July 2023 - π³π±Netherlands spokje
DrupalCI doesn't seem to pick up on the five
NightwatchAssertError
s I see in the full test log.Adding
Needs followup
for that.
Even whilst the full focus is, rightfully so, on the GitLab move, having a green TestBot whilst there are errors is bad.00:40:15.270 β NightwatchAssertError 00:40:15.270 Timed out while waiting for element <[href*=edit-editor-settings-plugins-ckeditor5-sourceediting]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5082ms) 00:40:15.270 00:40:15.270 Error location: 00:40:15.270 /var/www/html/core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5CodeSyntaxTest.js: 00:40:15.270 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:40:15.270 36 | .keys(browser.Keys.DOWN) // Hit the down arrow key to move it to the toolbar. 00:40:15.270 37 | // Wait for new source editing vertical tab to be present before continuing. 00:40:15.270 38 | .waitForElementVisible( 00:40:15.270 39 | '[href*=edit-editor-settings-plugins-ckeditor5-sourceediting]', 00:40:15.270 40 | ) 00:40:15.270 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:40:15.391 FAILED: 1 assertions failed and 5 passed (8.962s) 00:40:26.978 Timed out while waiting for element <[href*=edit-editor-settings-plugins-ckeditor5-sourceediting]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5088ms) 00:40:26.978 00:40:26.978 Error location: 00:40:26.978 /var/www/html/core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js: 00:40:26.978 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:40:26.978 38 | .keys(browser.Keys.DOWN) // Hit the down arrow key to move it to the toolbar. 00:40:26.978 39 | // Wait for new source editing vertical tab to be present before continuing. 00:40:26.978 40 | .waitForElementVisible( 00:40:26.978 41 | '[href*=edit-editor-settings-plugins-ckeditor5-sourceediting]', 00:40:26.978 42 | ) 00:40:26.978 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:40:26.978 00:40:27.196 00:40:27.196 FAILED: 1 assertions failed and 5 passed (9.067s) 00:41:54.180 β NightwatchAssertError 00:41:54.180 Failed [ok]: (The expression evaluated to a falsy value: 00:41:54.180 00:41:54.180 assertModule[propName].apply(null, this.args) 00:41:54.180 ) - expected "true" but got: "false" (0ms) 00:41:54.180 00:41:54.180 Error location: 00:41:54.180 /var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js: 00:41:54.180 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:41:54.180 117 | [linkSubMenuId], 00:41:54.180 118 | (result) => { 00:41:54.180 119 | browser.assert.ok(result.value); 00:41:54.180 120 | }, 00:41:54.180 121 | ) 00:41:54.180 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:41:54.180 00:41:54.334 00:41:54.334 FAILED: 1 assertions failed and 4 passed (1.001s) 00:42:50.917 β NightwatchAssertError 00:42:50.917 Timed out while waiting for element <.block-search-wide__wrapper> to not be visible for 5000 milliseconds. - expected "not visible" but got: "visible" (5114ms) 00:42:50.917 00:42:50.917 Error location: 00:42:50.917 /var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroSearchFormTest.js: 00:42:50.917 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:42:50.917 81 | .keys(browser.Keys.TAB) 00:42:50.917 82 | .pause(50) 00:42:50.917 83 | .waitForElementNotVisible(searchWideSelector) 00:42:50.917 84 | // Release all keys. 00:42:50.917 85 | .keys(browser.Keys.NULL); 00:42:50.917 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:42:50.917 00:42:51.081 00:42:51.081 FAILED: 1 assertions failed and 3 passed (5.959s) 00:43:03.680 β NightwatchAssertError 00:43:03.680 Testing if element <button.sticky-header-toggle> is visible in 5000ms - expected "is visible" but got: "not visible" (5191ms) 00:43:03.680 00:43:03.680 Error location: 00:43:03.680 /var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroStickyHeaderToggleTest.js: 00:43:03.680 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:43:03.680 21 | .assert.attributeEquals(buttonSelector, 'aria-checked', 'false') 00:43:03.680 22 | .getLocationInView('footer.site-footer', () => { 00:43:03.680 23 | browser.assert.visible(buttonSelector); 00:43:03.680 24 | browser.assert.not.visible('#site-header__inner'); 00:43:03.680 25 | }) 00:43:03.680 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 00:43:03.680 00:43:03.833 00:43:03.833 FAILED: 1 assertions failed and 2 passed (5.753s)
- π³π±Netherlands spokje
Also, we can now drop our workaround with the
"resolutions"
-section incore/package.json
, since nightwatch 3.1.0 has a "safe" version of the semver-package. - last update
over 1 year ago CI aborted - πΊπΈUnited States effulgentsia
I don't know if there are any differences between Chrome 106 and Chrome 115 that are relevant to this issue, but FYI that I just now opened #3377509: Update Chrome container to use newer version (115 or higher) β .
- π¬π§United Kingdom longwave UK
oliveroStickyHeaderToggleTest
fails due togetLocationInView()
not working now we are in w3c mode: https://github.com/nightwatchjs/nightwatch/issues/3091We will need to find a workaround for that.
- π¬π§United Kingdom longwave UK
The other issues are due to sending special keys such as Tab or arrow-down - this also no longer seems to work, the driver responds with
{ value: { error: 'unknown command', message: 'unknown command: Cannot call non W3C standard command while in W3C mode', stacktrace: '' } }
- last update
over 1 year ago Custom Commands Failed - π³π±Netherlands spokje
Whoops, got to the same solution as @longwave, but was trying to post it in my [ignore]-patch issue.
- last update
over 1 year ago 29,776 pass - π³π±Netherlands spokje
I think we have another candidate follow-up issue:
core/tests/Drupal/Nightwatch/Tests/claroAutocompleteTest.js
passes, but the autocomplete JavaScript used in the test seems to be 404?
https://dispatcher.drupalci.org/job/drupal_patches/195337/artifact/jenki...(Coordinated-Universal-Time)_console.json - last update
over 1 year ago 29,776 pass - π³π±Netherlands spokje
So, per usual, @longwave found the correct way.
Also, per usual, I stumble over the weirdest stuff:
Commit 8ebeb952 has only one error showing in the full CI log, yet looking at the result artifacts made by nightwatch, we have 5 failures.
I strongly suspect any Nightwatch-test ending with a
(result) => { browser.assert
will not show up in the log when it fails.
It's seems we're _really_ want to make it hard to see a nightwatch failure :/
Yet Another Follow-Up, me thinks. - π¬π§United Kingdom longwave UK
Not sure what's happening with the Nightwatch output, can't reproduce this locally - yarn exits with a non-zero return code which should indicate failure, but on DrupalCI it just seems to abort and truncate the log.
- last update
over 1 year ago 29,776 pass - π³π±Netherlands spokje
So if we dig really deep (https://dispatcher.drupalci.org/job/drupal_patches/195437/artifact/jenki...), we see that there are 2 remaining failing tests.
The fact that we have really deep, since:
1) TestBot is green anyway
2) You have to look at the full log to see any reported fail in the log
3) Which then turns out to not even show all the fails
leaves me wondering if there's any use of a test subsystem that is giving a false sense of security and most probably have been doing so since it introduction.Add to that we didn't seem to mind too much when it couldn't be updated when 9.5/10.0 came out, nor when 10.1 was released, is making me feel Nightwatch-testing isn't getting same amount of attention/love the rest of core is getting.
For me, it's a reason to spend my time elsewhere in the queue, I think it's not worth putting time in upgrading a test system that's "green" anyway, unless you really, really spend time to find a failure that is big enough to show a glimpse of the fail showing up in the top reporting layer.
- First commit to issue fork.
- last update
over 1 year ago 30,052 pass - π¬π§United Kingdom catch
Opened π Failing Nightwatch jobs result in a passed pipeline job Active but agreed with #23 it's not clear how useful the nightwatch suite is if it's been giving us false negatives for years.
This is also blocking further progress on π [PP-2] Speed up gitlab ci runs Postponed now since after the changes on that issue, nightwatch becomes the joint-slowest test group.
- π¦πΊAustralia mstrelan
Can we skip the failing tests and open a follow up issue for each (or all) of them?
https://nightwatchjs.org/guide/running-tests/skipping-disabling-tests.html
- π¬π§United Kingdom catch
@mstrelan yeah I think that's reasonable, otherwise any new nightwatch tests we add could also end up blocking this issue too.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
It took me a very, very long time to get Nightwatch tests to pass on GitLab CI for a contrib module I maintain.
Turns out the root cause is that the d.o GitLab template uses the Nightwatch test runner in a very good way but sadly broken way: π Impossible to run only Nightwatch tests in a given directory (f.e. for contrib modules) Needs review .
leaves me wondering if there's any use of a test subsystem that is giving a false sense of security and most probably have been doing so since it introduction without being noticed by anybody since it introduction in 2018.
I've noticed this too in the past few years, occasionally, specifically while working on Nightwatch tests. I think the very low number of Nightwatch tests in Drupal core is an important factor in how this has slipped through the cracks. Another important factor seems to be the less-than-awesome mapping of DrupalCI "number of tests" (and failures) to actual reports. (Meaning: it's AFAICT not actually limited to Nightwatch tests.)
Hopefully the transition to GitLab CI will make things more precise, standardized and reliable!
- First commit to issue fork.
- Issue was unassigned.
- π³πΏNew Zealand quietone
I had a go at rebasing this. There were conflicts in the following files and I may have not done it correctly. Nightwatch tests do not complete. They hang at installProfileTest.js. See https://git.drupalcode.org/project/drupal/-/jobs/770136
- core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroSearchFormTest.js
- core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js
- core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5CodeSyntaxTest.js
- core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js
- π¬π§United Kingdom longwave UK
π Use selenium/standalone-chrome instead of our chromedriver image Needs work landed which gives us a newer Selenium/Chrome to talk to and which may solve the issues we were seeing here.
- π¬π§United Kingdom longwave UK
Locally I bumped to Nightwatch 3.7.0 which works OK with the new Selenium setup and latest Chrome, but tests appear to crash and then the Selenium server no longer responds:
$ yarn test:nightwatch tests/Drupal/Nightwatch/Tests/loginTest.js [Tests/Login Test] Test Suite ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βΉ Connected to selenium on port 4444 (505ms). Using: chrome-headless-shell (126.0.6478.114) on LINUX. βΉ Loaded url http://ddev-drupal8-web in 446ms Running Test login: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βΉ Loaded url http://ddev-drupal8-web/user/reset/1/1721811628/FNZSmygKgxaar4E9AmDAlZ75Q61bU4ew0iwBaov3XUA/login in 440ms βΉ Loaded url http://ddev-drupal8-web/admin/people/roles/add in 133ms β Expected element <.user-role-form .machine-name-value> to be visible in 2000ms (36ms) β Testing if element <[data-drupal-messages]> contains text 'Role xt4aw4gms9 has been added.' (24ms) βΉ Loaded url http://ddev-drupal8-web/admin/people/permissions in 160ms β Element <table.permissions> was visible after 34 milliseconds. β Testing if element <[data-drupal-messages]> contains text 'The changes have been saved.' (22ms) βΉ Loaded url http://ddev-drupal8-web/user/logout/confirm in 69ms βΉ Loaded url http://ddev-drupal8-web/user/reset/1/1721811630/RH7RHeQ6JGfOHJ7RGMIXnuu3wYDMoU3KEqDnBTZrHfI/login in 83ms βΉ Loaded url http://ddev-drupal8-web/admin/people/create in 135ms β User "user" was created successfully (34ms) βΉ Loaded url http://ddev-drupal8-web/user/logout/confirm in 47ms βΉ Loaded url http://ddev-drupal8-web/user/login in 54ms β Passed [equal]: The user "user" was logged in. βΉ Loaded url http://ddev-drupal8-web/admin/reports in 76ms β Element <body> was visible after 30 milliseconds. β Testing if element <h1> contains text 'Reports' (32ms) $
I was expecting further output here, if I run this on the older version of Nightwatch it ends as follows:
β Testing if element <h1> contains text 'Reports' (29ms) β Ensuring no deprecation errors have been triggered (10ms) β¨ PASSED. 9 assertions. (3.879s) Wrote HTML report file to: /var/www/html/drupal/core/reports/nightwatch/nightwatch-html-report/index.html $
If I then run the test again it hangs:
$ yarn test:nightwatch tests/Drupal/Nightwatch/Tests/loginTest.js [Tests/Login Test] Test Suite ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β ΄ Connecting to selenium on port 4444...
Restarting the Selenium container fixes it.
Will push this branch up anyway but not sure what's happened here at all.
- π¬π§United Kingdom longwave UK
api.execute()
takes the callback as the third argument instead of the second now, it seems. - π¬π§United Kingdom longwave UK
Last run was looking promising until it appeared to hang after installProfileTest: https://git.drupalcode.org/project/drupal/-/jobs/2214554
- Status changed to Needs review
5 months ago 11:14am 24 July 2024 - π¬π§United Kingdom longwave UK
I'm slightly amazed that it was only another call to
execute()
that needed fixing, but the run is green. - π³π±Netherlands spokje
I think we can now also drop the
resloutions
section fromcore/package.json
.
These were only needed to keep the dependencies of the old version ofnightwatch
clashing with our other JS-dependencies. - π³π±Netherlands spokje
Tests are still green.
For the record, just removed the
resolutions
-section and did a$ yarn install
. - πΊπΈUnited States xjm
This should have been an 11.0.0 beta blocker, but got missed. We might make an exception to policy and commit this to 11.0.x despite that branch being almost-stable, because as @longwave points out being on a very old version of Nightwatch means being stuck with old Chrome in our tests.
If we do commit it, it should go in the release notes. The CR and release notes should also mention any gotchas that have surfaced from the updates (and linking out to Nightwatch's own release notes for more details also a good strategy).
- Status changed to Needs work
5 months ago 12:02am 5 August 2024 - πΊπΈUnited States smustgrave
Not best to review this only moving to NW for the open tags and mainly because MR needs a rebase.
- Status changed to Needs review
5 months ago 9:37am 5 August 2024 - π³π±Netherlands spokje
Removed the "Needs follow-up"-tag since my woes in #13 seem to be resolved already.
- π¬π§United Kingdom catch
I added a CR but it just points to Drupal's nightwatch docs and nightwatch's 3.x post, not sure what else there is to say tbh. https://www.drupal.org/node/3467273 β
The release note as it is looks OK except I updated the version from 2.0.0 to 3.0.0 which looked like a typo.
- π¬π§United Kingdom catch
Bumping this to critical, every other core test run fails on nightwatch random test failures, and even if this doesn't help, we need to rule it out.
- Status changed to RTBC
5 months ago 6:57pm 11 August 2024 - πΊπΈUnited States smustgrave
Leaning on the tests passing that upgrading doesn't break anything.
Not sure a good to see what contrib modules are using nightwatch tests but if being honest knowing how difficult it is to get nightwatch running locally I would bet not many would be using it. So probably safe.
- π¦πΊAustralia mstrelan
Opened follow up π Consider dropping Nightwatch in favor of Functional Javascript tests Active . Feel free to tell me it's a straight-up won't fix.
- Status changed to Fixed
5 months ago 7:20am 12 August 2024 - π¬π§United Kingdom catch
Let's get this into 11.x so if it somehow makes stability issues worse (doesn't seem possible, but who knows) we'll be able to see them with plenty of notice before the 11.1.0 release.
Automatically closed - issue fixed for 2 weeks with no activity.