Write functional javascript test for block visibility vertical tabs

Created on 13 December 2024, 5 months ago

Problem/Motivation

๐Ÿ› Block visibility settings have summary duplicated in the title Active showed that we are missing test coverage for block visibility vertical tabs.

We should add some explicit coverage, specifically that the summaries have the correct text in them (the regression from the other issue), but would also be good to check clicking on one tab to make sure the correct form opens or similar.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

block.module

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @catch
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    I have reviewed the related issue and added test coverage to address the mentioned points. I have attempted to test all the scenarios outlined in the issue. Could you please review this and let me know if thereโ€™s anything that needs to be updated or improved?

  • Pipeline finished with Success
    5 months ago
    Total: 1037s
    #373801
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalina_jha I think test coverage should be failing. Since the fix is in the related issue's (3493182) MR/ fork. So this test is running against the existing code which will contain the bug.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalini_jha I think adding asserts to the test to check that if there are > 1 vertical tabs that the text is repeated x times where x is the number of tabs: that will be fine.

  • Pipeline finished with Success
    5 months ago
    Total: 914s
    #374520
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalini_jha I have made slight changes making the code a bit simpler and more specific. Ready for review.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @oily Thanks for your review . Based on the previous issue, i have tried to show the test coverage for vertical tab summary text is appended to all vertical tabs label. Additionally, I have implemented checks to confirm that clicking on any tab opens the corresponding form. we can wait for review whether we need to update this.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalina_jha Yes i noticed that you have stuck closely to the requirements of the parent issue. Looks good. I am not sure if using ->find('css', [some class or id]) loops through each of the tabs. If so then maybe it finds if any of the tabs have the 'bad text' repeated in the title. It might also just find the first element that matches and apply the assert to that? But then ignore the other tabs. If it checks all the matching elements and applies the assert to all of them then that is not good in my opinion.

    If for any reason the 'bad text' appeared in all except one of the tabs then that is something we would want the test to find and fail on.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    A way to verify that this tests the specific bug in ๐Ÿ› Block visibility settings have summary duplicated in the title Active would be to add an additional branch here, revert the commit from that issue, and open a draft MR - then we should be able to see the new test coverage fail.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @catch Thank you. That sound like the way ahead..

  • Pipeline finished with Failed
    5 months ago
    Total: 697s
    #375448
  • Pipeline finished with Canceled
    5 months ago
    Total: 368s
    #375470
  • Pipeline finished with Success
    5 months ago
    Total: 444s
    #375474
  • Pipeline finished with Running
    5 months ago
    #375492
  • Pipeline finished with Failed
    5 months ago
    Total: 647s
    #375510
  • Pipeline finished with Failed
    5 months ago
    Total: 777s
    #375521
  • Pipeline finished with Canceled
    5 months ago
    Total: 630s
    #375530
  • Pipeline finished with Failed
    5 months ago
    Total: 671s
    #375534
  • Pipeline finished with Failed
    5 months ago
    Total: 219s
    #375544
  • Pipeline finished with Failed
    5 months ago
    Total: 659s
    #375550
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Thanks for working on this. I left some comments in the MR.

  • Pipeline finished with Failed
    5 months ago
    Total: 240s
    #375561
  • Pipeline finished with Success
    5 months ago
    Total: 608s
    #375567
  • Pipeline finished with Canceled
    5 months ago
    Total: 295s
    #375571
  • Pipeline finished with Success
    5 months ago
    Total: 447s
    #375578
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @quietone Thank you for the code suggestions.

  • Pipeline finished with Failed
    5 months ago
    Total: 490s
    #375585
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    I applied the suggestion of @catch at #12. The new branch and MR are visible above. Not yet sure why but the FunctionalJavascript tests keep passing in the pipeline. But locally in DDEV the test fails and the ouput seems correct See screenshot โ†’

  • Pipeline finished with Failed
    5 months ago
    Total: 649s
    #375594
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    There is one failing FJ test in PerformanceTest.php. Seems unrelated to this issue. It is the result of a rebase I did.

    Changing to Needs Review.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Pipeline all green.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    While i am checking the feedback changes from initial work, observe the failure in MR 10635 , I have check this and its a random failure and re run this. now its fixed. Thanks @oily for updating the feedback. leaving this as NR.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Thank you, @shalini_jha, glad to help.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @oily , As i have already debug and worked on the test coverage and moved this ticket to NR for the feedback what need to be change or update, Please Left this issue for 2nd review.i want to try 2nd review.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    The branch at https://git.drupalcode.org/project/drupal/-/merge_requests/10635/diffs looks like the branch has been rolled back to before the commit, then the tests here added. This will pass against HEAD because the test process merges that branch into HEAD, which means it's just adding the test without reverting the fix.

    To get the MR to fail, instead you'd need to do git revert 89a009ac - this will make a new commit reversing the fix, then that will get get applied when the pipeline runs.

  • Pipeline finished with Success
    5 months ago
    Total: 773s
    #377766
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    I have Tried to follow the #25 , same way first i have rebase the MR(10635) and then applied this "git revert 89a009ac" and pushed the changes to the https://git.drupalcode.org/project/drupal/-/merge_requests/10635/diffs, same mentioned this has generated the new commit to revert the fix for the issue. However, the pipeline is still passing here, but when I run the test locally, it is failing in this branch.

  • Pipeline finished with Success
    5 months ago
    Total: 935s
    #377782
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    For debugging tried to Run pipeline again but it still passing , the reverted code is there in MR , but pipeline not showing the failing test , but locally it is working.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @catch Thank you for the advice.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalini_jha Yes, @catch has advised on how to proceed. It wont work until we follow #25.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @oily I have already followed the step mentioned by @catch in #25, You can check #26 comment, pipeline is still passing.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Ok, maybe @catch will advise or can reach out on Slack

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    Hi @catch,
    Could you please provide some guidance? I have followed the steps mentioned by you in #25 exactly as outlined. However, the functional JavaScript test is still passing, which suggests that it might still be working against the HEAD. Iโ€™m unsure why this test is passing. Any insights would be greatly appreciated.Thank you!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    There are 2 open MRs when there should only be 1.

    Issue summary is also incomplete

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    oily โ†’ changed the visibility of the branch 3493914-revert-to-just-before-parent-issue-commit-for-tests to hidden.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    I used my testing issue to revert commit 89a009ac124657011ecaa0830a2950da48fa37ad and then apply the diff from this issue. I get the same results as @shalini_jha. That is, BlockAddTest fails locally but passes on GitLab. And worse, the GitLab artifact does not contain the browser output from that test, while it does for other tests.

    Asked in Slack about this and learned about ๐Ÿ› Functional Javascript test false postive and missing browser output Active

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    @smustgrave the second MR open here is to try to demonstrate that the tests fail without a bug fix from a previous issue, unfortunately it looks like functional js tests aren't failing properly on gitlab, but it's here for a good reason and not a reason to mark the issue needs work.

    fwiw the test-only MR looks right and I think we're just running into the gitlab bug, good that @quietone was able to see the failure locally (and find out about the bug in general, that's very confusing).

    Issue summary looks fine now so moving to RTBC.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Sorry but weโ€™ve moved other issues with multiple MRs and incomplete issue summaries to NW thatโ€™s why I did

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Thank you @smustgrave, @quietone and @catch for moving this along.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Thanks you @shalini_jha for building the test.

  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    4 months ago
    Total: 437s
    #402415
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    Fixed Bot reported error, so i am moving this NR instead of RTBC.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Restoring status.

    • catch โ†’ committed acd9aa03 on 11.x
      Issue #3493914 by oily, shalini_jha, quietone: Write functional...
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Committed/pushed to 11.x, thanks!

  • Status changed to Fixed 3 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024