From cc93388082fdee8230208f9f54adc2a456c8e55a Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Fri, 18 Nov 2022 14:47:16 +0800 Subject: [PATCH] MDL-75982 tiny_equation: add behat for equation editor --- .../equation/tests/behat/equation.feature | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/editor/tiny/plugins/equation/tests/behat/equation.feature diff --git a/lib/editor/tiny/plugins/equation/tests/behat/equation.feature b/lib/editor/tiny/plugins/equation/tests/behat/equation.feature new file mode 100644 index 00000000000..82bf233c5ce --- /dev/null +++ b/lib/editor/tiny/plugins/equation/tests/behat/equation.feature @@ -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 "

Equation test

" + # 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 "

\( \pi \)

" + # 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 "

\( \pi \)

"