Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84867

Behat SCSS deprecation failures are unhelpful

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-84867-404
    • MDL-84867-405
    • MDL-84867-main
    • Hide

      Setup

      1. Apply the MDL-84867-test.patch patch (This will add an usage of the deprecated styles)

        git apply MDL-84867-test.patch

      Behat checker test

      1. Initialise behat without the new --scss-deprecations flag:

        php admin/tool/behat/cli/init.php
        

      2. Run behat using a course specific scenario (with the added deprecated styles):

        php admin/tool/behat/cli/run.php --name="Teacher can see the activity type tooltip only while editing."
        

        1. Confirm that you see the following output at the top:

          Run optional tests:
          - Accessibility: Yes
          - SCSS deprecations: No
          - Icon deprecations: Yes
          

        2. Confirm that the test passes
      3. Re-initialise behat with the --scss-deprecations flag:

        php admin/tool/behat/cli/init.php --scss-deprecations
        

      4. Run behat using a course specific scenario:

        php admin/tool/behat/cli/run.php --name="Teacher can see the activity type tooltip only while editing."
        

        1. Confirm that you see the following output at the top:

          Run optional tests:
          - Accessibility: Yes
          - SCSS deprecations: Yes
          - Icon deprecations: Yes
          

        2. Confirm that the test fails with the following output (indicating the deprecated styles failing and the complete element classlist:

          001 Scenario: Teacher can see the activity type tooltip only while editing. # /moodles/stable_main/moodle/course/format/tests/behat/activity_icon_tooltip.feature:26
                Given I am on the "C1" "Course" page logged in as "teacher1"          # /home/mikel/moodles/stable_main/moodle/course/format/tests/behat/activity_icon_tooltip.feature:27
                  Deprecated styles found:
                    .mr (found in: mr-2)
                    .badge-pill (found in: badge badge-pill badge-danger)
                   (Exception)
           
          1 scenario (1 failed)
          10 steps (4 passed, 1 failed, 5 skipped)
          

      5. Run behat using a course specific scenario without @javascript

        php admin/tool/behat/cli/run.php --name="Teacher should see the automatic completion criterias of activities"

      6. Confirm that the test passes without errors
      Show
      Setup Apply the MDL-84867-test.patch patch (This will add an usage of the deprecated styles) git apply MDL-84867-test.patch Behat checker test Initialise behat without the new --scss-deprecations flag: php admin/tool/behat/cli/init.php Run behat using a course specific scenario (with the added deprecated styles): php admin/tool/behat/cli/run.php --name="Teacher can see the activity type tooltip only while editing." Confirm that you see the following output at the top: Run optional tests: - Accessibility: Yes - SCSS deprecations: No - Icon deprecations: Yes Confirm that the test passes Re-initialise behat with the --scss-deprecations flag: php admin/tool/behat/cli/init.php --scss-deprecations Run behat using a course specific scenario: php admin/tool/behat/cli/run.php --name="Teacher can see the activity type tooltip only while editing." Confirm that you see the following output at the top: Run optional tests: - Accessibility: Yes - SCSS deprecations: Yes - Icon deprecations: Yes Confirm that the test fails with the following output (indicating the deprecated styles failing and the complete element classlist: 001 Scenario: Teacher can see the activity type tooltip only while editing. # /moodles/stable_main/moodle/course/format/tests/behat/activity_icon_tooltip.feature:26 Given I am on the "C1" "Course" page logged in as "teacher1" # /home/mikel/moodles/stable_main/moodle/course/format/tests/behat/activity_icon_tooltip.feature:27 Deprecated styles found: .mr (found in: mr-2) .badge-pill (found in: badge badge-pill badge-danger) (Exception)   1 scenario (1 failed) 10 steps (4 passed, 1 failed, 5 skipped) Run behat using a course specific scenario without @javascript php admin/tool/behat/cli/run.php --name="Teacher should see the automatic completion criterias of activities" Confirm that the test passes without errors
    • Hide

      Code verified against automated checks.

      Checked MDL-84867 using repository: https://github.com/roland04/moodle.git

      More information about this report

      Built on: Fri Mar 14 09:39:51 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84867 using repository: https://github.com/roland04/moodle.git main (0 errors / 0 warnings) [branch: MDL-84867-main | CI Job ] More information about this report Built on: Fri Mar 14 09:39:51 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84867 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18596/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63705/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64050/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64051/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63708/ App tests (stable app version) Built on: Fri Mar 14 16:30:18 UTC 2025
    • 3
    • HQ 2025 Sprint I1.3 Moppies

      Currently, if behat is initialized with scss deprecations check php admin/tool/behat/cli/init.php --scss-deprecations the failures don't give enough information to detect the deprecated style to fix it (Only displaying Deprecated style in use).

      001 Scenario: Teacher can enable anonymous submissions               # /moodle/mod/assign/tests/behat/assign_anonymous_submission.feature:24
            And I navigate to "Submissions" in current page administration # /moodle/mod/assign/tests/behat/assign_anonymous_submission.feature:34
              Deprecated style in use (Exception)
       
      1 scenario (1 failed)
      21 steps (9 passed, 1 failed, 11 skipped)
      0m21.10s (88.37Mb)
      

      We should show the deprecated class that is raising the error, and also the complete class list of the element will be helpful to find the code to fix.

      Something like:

      001 Scenario: Teacher can enable anonymous submissions               # /moodle/mod/assign/tests/behat/assign_anonymous_submission.feature:24
            And I navigate to "Submissions" in current page administration # /moodle/mod/assign/tests/behat/assign_anonymous_submission.feature:34
              Deprecated styles found:
                .text-left (found in: btn dropdown-toggle d-flex text-left align-items-center p-0)
                .pr (found in: pr-3 text-truncate)
               (Behat\Mink\Exception\ExpectationException)
      

        1. MDL-84867-test.patch
          0.6 kB
        2. 1.png
          1.png
          76 kB
        3. 2.png
          2.png
          117 kB
        4. 3.png
          3.png
          119 kB

            mikelmartíncorrales Mikel Martín Corrales
            mikelmartíncorrales Mikel Martín Corrales
            Carlos Escobedo Carlos Escobedo
            Simey Lameze Simey Lameze
            Stevani Andolo Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours, 30 minutes
                2d 2h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.