Problem/Motivation

#2901792: Disable all animations in Javascript testing fixed a lot of random JS fails but we still have one in \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled

See https://www.drupal.org/pift-ci-job/1298341

Proposed resolution

Work out what's going on.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#28 3056536-3-28.patch5.17 KBalexpott
#28 27-28-interdiff.txt1.61 KBalexpott
#27 3056536-3-27.patch6.33 KBalexpott
#27 23-27-interdiff.txt1.47 KBalexpott
#26 3056536-23.patch7.88 KBalexpott
#24 3056536-3-24.patch7.4 KBalexpott
#24 23-24-interdiff.txt960 bytesalexpott
#23 3056536-23.patch7.88 KBalexpott
#22 3056536-22.patch3.89 KBalexpott
#21 3056536-21.patch4.76 KBtedbow
#21 interdiff-19-21.txt1.09 KBtedbow
#19 3056536-18.patch4.76 KBalexpott
#17 3056536-17.patch4.27 KBalexpott
#16 3056536-16.patch4.28 KBalexpott
#14 3056536-12.patch8.75 KBalexpott
#14 11-12-interdiff.txt1.01 KBalexpott
#11 3056536-11.patch8.19 KBalexpott
#11 9-11-interdiff.txt773 bytesalexpott
#9 3056536-8.patch7.95 KBalexpott
#9 7-8-interdiff.txt3.93 KBalexpott
#7 3056536-7.patch5.27 KBalexpott
#4 3056536-4.patch4.51 KBalexpott
#3 3056536-3.patch3.16 KBalexpott
#2 3056536-2.patch2.65 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Let's try to see what's happening.

alexpott’s picture

alexpott’s picture

So looking at https://dispatcher.drupalci.org/job/drupal_patches/99033/artifact/jenkin... it doesn't look like the iFrame thing :(

What really interesting is that I can't get this test to pass locally at all. I fail with

Testing Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest
E                                                                   1 / 1 (100%)

Time: 10.14 seconds, Memory: 6.00MB

There was 1 error:

1) Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled
Exception: element click intercepted: Element <input data-drupal-selector="edit-submit" type="submit" id="edit-submit--UfVqg5ISAfs" value="Search" class="button js-form-submit form-submit" disabled="" tabindex="-1"> is not clickable at point (220, 389). Other element would receive the click: <div data-drupal-selector="edit-actions" class="form-actions js-form-wrapper form-wrapper" id="edit-actions--ku6j-kPGJZY">...</div>
  (Session info: headless chrome=74.0.3729.169)
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.5 x86_64)

/Users/alex/dev/sites/drupal8alt.dev/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:144
/Users/alex/dev/sites/drupal8alt.dev/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:157
/Users/alex/dev/sites/drupal8alt.dev/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:218
/Users/alex/dev/sites/drupal8alt.dev/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:224
/Users/alex/dev/sites/drupal8alt.dev/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:775
/Users/alex/dev/sites/drupal8alt.dev/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:763
/Users/alex/dev/sites/drupal8alt.dev/vendor/behat/mink/src/Element/NodeElement.php:153
/Users/alex/dev/sites/drupal8alt.dev/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:187
/Users/alex/dev/sites/drupal8alt.dev/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:205
/Users/alex/dev/sites/drupal8alt.dev/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:114

Which is a different fail to the random one AND it's not random - it fails every time.

Wim Leers’s picture

Same here:


Testing Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest
E                                                                   1 / 1 (100%)

Time: 19.43 seconds, Memory: 6.00MB

There was 1 error:

1) Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled
Exception: element click intercepted: Element <input data-drupal-selector="edit-submit" type="submit" id="edit-submit--uDSCTVAEs7M" value="Search" class="button js-form-submit form-submit" disabled="" tabindex="-1"> is not clickable at point (220, 865). Other element would receive the click: <div data-drupal-selector="edit-actions" class="form-actions js-form-wrapper form-wrapper" id="edit-actions--VOh1Ki0xE0U">...</div>
  (Session info: chrome=74.0.3729.169)
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.4 x86_64)

/Users/wim.leers/Work/d8/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:144
/Users/wim.leers/Work/d8/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:157
/Users/wim.leers/Work/d8/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:218
/Users/wim.leers/Work/d8/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:224
/Users/wim.leers/Work/d8/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:775
/Users/wim.leers/Work/d8/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:763
/Users/wim.leers/Work/d8/vendor/behat/mink/src/Element/NodeElement.php:153
/Users/wim.leers/Work/d8/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:187
/Users/wim.leers/Work/d8/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:205
/Users/wim.leers/Work/d8/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php:114
alexpott’s picture

So here's a fix for the local fail so at least this passes for me.

What's weird is how does \WebDriver\Exception::factory() generate an \WebDriver\Exception\UnknownError on DrupalCI and not locally. If I had to guess this is because the error code is different.

Status: Needs review » Needs work

The last submitted patch, 7: 3056536-7.patch, failed testing. View results

alexpott’s picture

After talking to @tedbow we're trying the new assert from #2892440: Provide helper test method to wait for an element to be removed from the page - I don't see why this should work because the screenshots show the settings tray is still active. So I'm hoping this fails.

alexpott’s picture

So locally using chromedriver direct we error code is 64. On linux on DrupalCI using chromedriver direct it's 13 and according to @tedbow this test passes locally whilst using selenium-server to connect to chromedriver so that must be returning a 13 too. So the fix to catch the generic \Exception feel fine as we're asserting on the contents of the message - which is the same locally and with DrupalCI.

alexpott’s picture

tedbow’s picture

The test passes for me locally but I am using selenium

The failure in #5 and #6 is something we have been trying to solve in #3032275: Create a fault-tolerant method for interacting with links and fields in Javascript tests

Status: Needs review » Needs work

The last submitted patch, 11: 3056536-11.patch, failed testing. View results

alexpott’s picture

@tedbow I don't think #5and #6 are related to #3032275: Create a fault-tolerant method for interacting with links and fields in Javascript tests the code here is doing the opposite.

  protected function assertElementUnclickable(NodeElement $element) {
    try {
      $element->click();
      $tag_name = $element->getTagName();
      $this->fail(new FormattableMarkup("@tag_name was clickable when it shouldn't have been", ['@tag_name' => $tag_name]));
    }
    catch (\Exception $e) {
      $this->assertContains('is not clickable at point', $e->getMessage());
    }
  }

I.e. we want the exception we were just catching the wrong exception.

alexpott’s picture

Okay boiling this down to the simplest set of changes for locally passing and random fail fixing. Leaving the drupalci.yml changes is atm to prove that this is the fix.

alexpott’s picture

Let's see if we can change just the width.

Status: Needs review » Needs work

The last submitted patch, 17: 3056536-17.patch, failed testing. View results

alexpott’s picture

The last submitted patch, 16: 3056536-16.patch, failed testing. View results

tedbow’s picture

+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
@@ -83,6 +84,10 @@ protected function setUp() {
+    // Resize window due to bug in Chromedriver when clicking on overlays over
+    // iFrames.
+    // @see https://bugs.chromium.org/p/chromedriver/issues/detail?id=2758

Sense this issue mentions "cross domain iframe" trying with local iframe. For this test it is not important that it is remote src

alexpott’s picture

alexpott’s picture

Status: Needs review » Needs work

The last submitted patch, 24: 3056536-3-24.patch, failed testing. View results

alexpott’s picture

Back to #23. For whatever reason this fix seems to need:

  • The iFrame reduced to 1x1
  • The screen changed to 1200x1200
  • The assertNoElementAfterWait to be changed

Very very weird. Doesn't feel right at all.

alexpott’s picture

Well it might not feel right but the test is still testing and no longer randomly failing. I'd be in favour of committing this and filing a follow-up for more investigation. And obviously we need to push on #2892440: Provide helper test method to wait for an element to be removed from the page too as that's 1/3 of this.

alexpott’s picture

Remove debug stuff.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Very very weird. Doesn't feel right at all.

💯

Well it might not feel right but the test is still testing and no longer randomly failing. I'd be in favour of committing this and filing a follow-up for more investigation.

💯

alexpott’s picture

catch’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

This looks great for stopping the bleeding, fine with cleaning things up in a follow-up.

  • catch committed e46168f on 8.8.x
    Issue #3056536 by alexpott, tedbow: LayoutBuilderDisableInteractionsTest...

  • catch committed 93c269a on 8.7.x
    Issue #3056536 by alexpott, tedbow: LayoutBuilderDisableInteractionsTest...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.