forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-75982 tiny_equation: add behat for equation editor
- Loading branch information
1 parent
a3bf958
commit cc93388
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
lib/editor/tiny/plugins/equation/tests/behat/equation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@editor @editor_tiny @tiny_equation | ||
Feature: Tiny equation editor | ||
To teach maths to students, I need to write equations | ||
|
||
@javascript | ||
Scenario: Create an equation using TinyMCE | ||
Given I log in as "admin" | ||
When I open my profile in edit mode | ||
And I set the field "Description" to "<p>Equation test</p>" | ||
# Set field on the bottom of page, so equation editor dialogue is visible. | ||
And I expand all fieldsets | ||
And I set the field "Picture description" to "Test" | ||
And I expand all toolbars for the "Description" TinyMCE editor | ||
And I click on the "Equation editor" button for the "Description" TinyMCE editor | ||
And the "class" attribute of "Edit equation using" "field" should contain "text-ltr" | ||
And I set the field "Edit equation using" to " = 1 \div 0" | ||
And I click on "\infty" "button" | ||
And I click on "Save equation" "button" | ||
And I click on "Update profile" "button" | ||
And I follow "Profile" in the user menu | ||
Then "\infty" "text" should exist | ||
|
||
@javascript | ||
Scenario: Edit an equation using TinyMCE | ||
Given I log in as "admin" | ||
When I open my profile in edit mode | ||
And I set the field "Description" to "<p>\( \pi \)</p>" | ||
# Set field on the bottom of page, so equation editor dialogue is visible. | ||
And I expand all fieldsets | ||
And I set the field "Picture description" to "Test" | ||
And I expand all toolbars for the "Description" TinyMCE editor | ||
And I click on the "Equation editor" button for the "Description" TinyMCE editor | ||
And the "class" attribute of "Edit equation using" "field" should contain "text-ltr" | ||
Then the field "Edit equation using" matches value " \pi " | ||
And I click on "Save equation" "button" | ||
And the field "Description" matches value "<p>\( \pi \)</p>" |