Fix failing tests

Created on 27 December 2023, over 1 year ago
Updated 23 January 2024, about 1 year ago

Problem/Motivation

Two tests are now failing with GitLab CI. These should be fixed.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code (fences)

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Grevil

    So the failing tests are of not much concern, the driver has problems finding the fences settings on the UI:

    The problem has something to do with the introduction of the states api for hiding the classes fences fields/label/item/items_wrapper, if the associated "tag" element is set to "none".
    But for some reason, setting the tags first, waiting for the elements to appear, and then filling in some test classes in the appearing classes inputs won't do the trick. Apparently, the elements I am referring to inside the tests are not invisble, but instead become "stale" for some reason:

    Retries: 10 and last result:
    {"sessionId":"535bdb2b913e22de0dd086fe0b664865","status":10,"value":{"message":"stale element reference: element is not attached to the page document\n (Session info: headless chrome=74.0.3729.157)\n (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)"}}

    Maybe it has something to do, with the fact, that the fences UI appears through AJAX after a button press and inside this UI we do another AJAX call through Drupal states, this way $page->fillField suddenly tries to get an element, which got removed from the DOM (even though it's there, but not the original element but another with the same name).

    Nevertheless, this isn't really worth figuring out. Instead, I will rename the "testBasicSettings" test to "testBasicSettingsThroughUI", comment it out and create a similiar test, which sets the values programmatically instead of through the UI.

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Strange! Yes and please leave a link to this issue in the commented out code. It would still be helpful to have UI tests on that area.

    And it must work, Drupal clearly provides the toolset to test these, I think we're missing something important on the facts you mentioned.
    There are surely similar cases and tests in core and contrib that already implement a solution.

    I agree, it's not worth the time now to dig deeper. Thanks for finding this! :)

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇩🇪Germany Grevil

    Alright, I set the fences third party settings programmatically instead through the UI and created a separate UI test with the original code, which I commented out for now. All green locally.

    Please review!

  • Merge request !29Resolve #3411039 "Fix failing tests" → (Merged) created by Grevil
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    56 pass
  • 🇩🇪Germany Grevil

    All green!

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    56 pass
  • 🇩🇪Germany Grevil

    Alright, all phpstan issues fixed as well!
    Note, that the last one is probably a false positive, see https://github.com/mglaman/phpstan-drupal/issues/113#issuecomment-164904....

  • Status changed to RTBC about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica

    Very well done @Grevil, thank you for the fix!

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    56 pass
  • Status changed to Fixed about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024