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

Behat step to set form fields in the container does not work for editor fields

    XMLWordPrintable

Details

    Description

      Here is the diff how to demonstrate the problem:

      diff --git a/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature b/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature
      index d3e06d544b1..3a2d1ac8e50 100644
      --- a/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature
      +++ b/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature
      @@ -27,7 +27,7 @@ Feature: Using the glossary activities which support point scale
         Scenario: Glossary rescale grade should not be possible when users are graded
           Given I am on the "Test glossary name" "glossary activity" page logged in as student1
           And I press "Add entry"
      -    And I set the following fields to these values:
      +    And I set the following fields in the "region-main" "region" to these values:
             | Concept    | Testing score                   |
             | Definition | Scoring high on tests           |
           And I press "Save changes"
      

      After this change behat starts failing:

      ......F--------------
       
      --- Failed steps:
       
      001 Scenario: Glossary rescale grade should not be possible when users are graded   # /var/www/html/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature:27
            And I set the following fields in the "region-main" "region" to these values: # /var/www/html/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature:30
              The "((//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//*
              [self::input[not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'radio' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'checkbox' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'file')] | self::textarea][not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'submit' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'button' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'reset' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'hidden')][((./@id = 'Definition' or ./@name = 'Definition') or ./@id = //label[contains(normalize-space(string(.)), 'Definition')]/@for or ./@placeholder = 'Definition')] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//label[contains(normalize-space(string(.)), 'Definition')]//.//*[self::input[not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'radio' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'checkbox' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'file')] | self::textarea][not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'submit' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'button' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'reset' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'hidden')] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//*
              [self::input[translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'radio' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'checkbox' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'file'] | self::select][not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'submit' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'button' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'reset' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'hidden')][((./@id = 'Definition' or ./@name = 'Definition') or ./@id = //label[contains(normalize-space(string(.)), 'Definition')]/@for)] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//label[contains(normalize-space(string(.)), 'Definition')]//.//*[self::input[translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'radio' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'checkbox' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'file'] | self::select][not(translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'submit' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'button' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'reset' or translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'hidden')] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']
                  /descendant::input[@id = substring-before(//p[contains(normalize-space(string(.)), 'Definition')]/@id, '_label')] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//*[@data-passwordunmask='wrapper']
                  /descendant::input[@id = 'Definition' or @id = //label[contains(normalize-space(string(.)), 'Definition')]/@for] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//descendant::span[@data-inplaceeditable][descendant::a[contains(./@title, 'Definition')]] | (//html/.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = 'region-main'])[1]/.//fieldset[(./@id = 'Definition' or ./legend[normalize-space(text())='Definition']) and (@data-fieldtype='date' or @data-fieldtype='date_time')])[1]" xpath node is not visible and it should be visible (Behat\Mink\Exception\ExpectationException)
      
      

      Attachments

        Issue Links

          Activity

            People

              marina Marina Glancy
              marina Marina Glancy
              Carlos Castillo Carlos Castillo
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                22/Aug/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 20 minutes
                  3h 20m