| Línea 16... | Línea 16... | 
          
            | 16 |     And I set the field "Edit equation using" to " = 1 \div 0"
 | 16 |     And I set the field "Edit equation using" to " = 1 \div 0"
 | 
          
            | 17 |     And I click on "\infty" "button"
 | 17 |     And I click on "\infty" "button"
 | 
          
            | 18 |     And I click on "Save equation" "button"
 | 18 |     And I click on "Save equation" "button"
 | 
          
            | 19 |     And I click on "Update profile" "button"
 | 19 |     And I click on "Update profile" "button"
 | 
          
            | 20 |     And I follow "Profile" in the user menu
 | 20 |     And I follow "Profile" in the user menu
 | 
          
            | - |   | 21 |     # MathJax 3.2.2 renders matemathical equation using css classes, so it will not work against the pre-rendered code like "\infty".
 | 
          
            | - |   | 22 |     # That said, we can instead check the rendered text using the rendered equation or symbol "∞".
 | 
          
            | 21 |     Then "\infty" "text" should exist
 | 23 |     Then "∞" "text" should exist
 | 
          
            | Línea 22... | Línea 24... | 
          
            | 22 |  
 | 24 |  
 | 
          
            | 23 |   @javascript
 | 25 |   @javascript
 | 
          
            | 24 |   Scenario: Edit an equation using TinyMCE
 | 26 |   Scenario: Edit an equation using TinyMCE
 | 
          
            | 25 |     Given I log in as "admin"
 | 27 |     Given I log in as "admin"
 | 
          
            | Línea 32... | Línea 34... | 
          
            | 32 |     And I click on the "Equation editor" button for the "Description" TinyMCE editor
 | 34 |     And I click on the "Equation editor" button for the "Description" TinyMCE editor
 | 
          
            | 33 |     And the "class" attribute of "Edit equation using" "field" should contain "text-ltr"
 | 35 |     And the "class" attribute of "Edit equation using" "field" should contain "text-ltr"
 | 
          
            | 34 |     Then the field "Edit equation using" matches value " \pi "
 | 36 |     Then the field "Edit equation using" matches value " \pi "
 | 
          
            | 35 |     And I click on "Save equation" "button"
 | 37 |     And I click on "Save equation" "button"
 | 
          
            | 36 |     And the field "Description" matches value "<p>\( \pi \)</p>"
 | 38 |     And the field "Description" matches value "<p>\( \pi \)</p>"
 | 
          
            | - |   | 39 |  
 | 
          
            | - |   | 40 |   @javascript
 | 
          
            | - |   | 41 |   Scenario: Permissions can be configured to control access to equation editor
 | 
          
            | - |   | 42 |     Given the following "users" exist:
 | 
          
            | - |   | 43 |       | username | firstname | lastname | email                |
 | 
          
            | - |   | 44 |       | teacher1 | Teacher   | 1        | teacher1@example.com |
 | 
          
            | - |   | 45 |       | teacher2 | Teacher   | 2        | teacher2@example.com |
 | 
          
            | - |   | 46 |     And the following "courses" exist:
 | 
          
            | - |   | 47 |       | fullname | shortname | format |
 | 
          
            | - |   | 48 |       | Course 1 | C1        | topics |
 | 
          
            | - |   | 49 |     And the following "roles" exist:
 | 
          
            | - |   | 50 |       | name           | shortname | description         | archetype      |
 | 
          
            | - |   | 51 |       | Custom teacher | custom1   | Limited permissions | editingteacher |
 | 
          
            | - |   | 52 |     And the following "course enrolments" exist:
 | 
          
            | - |   | 53 |       | user     | course | role           |
 | 
          
            | - |   | 54 |       | teacher1 | C1     | editingteacher |
 | 
          
            | - |   | 55 |       | teacher2 | C1     | custom1        |
 | 
          
            | - |   | 56 |     And the following "activity" exists:
 | 
          
            | - |   | 57 |       | activity | assign          |
 | 
          
            | - |   | 58 |       | course   | C1              |
 | 
          
            | - |   | 59 |       | name     | Test assignment |
 | 
          
            | - |   | 60 |     And the following "permission overrides" exist:
 | 
          
            | - |   | 61 |       | capability        | permission | role    | contextlevel | reference |
 | 
          
            | - |   | 62 |       | tiny/equation:use | Prohibit   | custom1 | Course       | C1        |
 | 
          
            | - |   | 63 |     # Check plugin access as a role with prohibited permissions.
 | 
          
            | - |   | 64 |     And I log in as "teacher2"
 | 
          
            | - |   | 65 |     And I am on the "Test assignment" Activity page
 | 
          
            | - |   | 66 |     And I navigate to "Settings" in current page administration
 | 
          
            | - |   | 67 |     When I click on the "Insert" menu item for the "Activity instructions" TinyMCE editor
 | 
          
            | - |   | 68 |     Then I should not see "Equation editor"
 | 
          
            | - |   | 69 |     # Check plugin access as a role with allowed permissions.
 | 
          
            | - |   | 70 |     And I log in as "teacher1"
 | 
          
            | - |   | 71 |     And I am on the "Test assignment" Activity page
 | 
          
            | - |   | 72 |     And I navigate to "Settings" in current page administration
 | 
          
            | - |   | 73 |     And I click on the "Insert" menu item for the "Activity instructions" TinyMCE editor
 | 
          
            | - |   | 74 |     And I should see "Equation editor"
 |