From 665f2014153023a420df246cc441730adf51e24a Mon Sep 17 00:00:00 2001 From: David Adalid Date: Wed, 13 Aug 2025 12:04:34 +0200 Subject: [PATCH 1/2] test: add MTMOODLE-109 --- ..._userInsertsMathTypeFormulaInBlock.feature | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature diff --git a/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature b/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature new file mode 100644 index 0000000..a12eafd --- /dev/null +++ b/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature @@ -0,0 +1,44 @@ +@tiny @tiny_wiris @wiris_mathtype @tinymce6_insert_formula @mtmoodle-109 @wipdavid +Feature: Insert MathType formula in Block + In order to check if MathType formula can be inserted correctly in Blocks + As an admin + I need to create a MathType formula + + Background: + Given the following config values are set as admin: + | config | value | plugin | + | customtoolbar | tiny_mce_wiris_formulaEditor | editor_tiny | + And the following "courses" exist: + | fullname | shortname | format | + | Course 1 | C1 | topics | + And the following "course enrolments" exist: + | user | course | role | + | admin | C1 | editingteacher | + And the "wiris" filter is "on" + And the "mathjaxloader" filter is "off" + And the "urltolink" filter is "off" + And I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + + @javascript @5.x @5.x_tinymce6 + Scenario: MTMOODLE-109 - User inserts and render a Wiris formula in a block + # Add a block + And I add the "Text..." block + And I set the field "Content" to "First block content" + And I set the field "Text block title" to "First block header" + # Add a block + And I add the "Text..." block + And I set the field "Content" to "First block content" + And I set the field "Text block title" to "First block header" + # Insert equation + And I press "Toggle" in "Text Block" field in TinyMCE 6 editor + And I press "MathType" in "Text Block" field in TinyMCE 6 editor + And I wait until MathType editor is displayed + And I wait "2" seconds + And I set MathType formula to '12π' + And I wait "2" seconds + And I press accept button in MathType Editor + And I press "Save changes" + # Check equation + Then I wait until Wirisformula formula exists + Then a Wirisformula containing 'square root' should exist From a8f44f12ad74b242325366fc98ab293ffcbdf286 Mon Sep 17 00:00:00 2001 From: David Adalid Date: Thu, 14 Aug 2025 12:58:51 +0200 Subject: [PATCH 2/2] test: fix MTMOODLE-109, adding an extra click to avoid interception with tooltip --- .../tinymce6_userInsertsMathTypeFormulaInBlock.feature | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature b/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature index a12eafd..ad6b8c1 100644 --- a/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature +++ b/tests/behat/tinymce6_userInsertsMathTypeFormulaInBlock.feature @@ -20,18 +20,16 @@ Feature: Insert MathType formula in Block And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - @javascript @5.x @5.x_tinymce6 + @javascript @5.x @5.x_tinymce6 @wipdavid Scenario: MTMOODLE-109 - User inserts and render a Wiris formula in a block - # Add a block - And I add the "Text..." block - And I set the field "Content" to "First block content" - And I set the field "Text block title" to "First block header" # Add a block And I add the "Text..." block And I set the field "Content" to "First block content" And I set the field "Text block title" to "First block header" # Insert equation And I press "Toggle" in "Text Block" field in TinyMCE 6 editor + # Problem with a tooltip, so clicking on anywhere + And I click on "Align left" in TinyMCE 6 editor toolbar And I press "MathType" in "Text Block" field in TinyMCE 6 editor And I wait until MathType editor is displayed And I wait "2" seconds