Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

TinyMCE custom steps definitions.

Copyright: 2022 Andrew Lyons <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 295 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 lib/behat/behat_base.php
 lib/editor/tiny/tests/behat/editor_tiny_helpers.php

Defines 1 class


Class: behat_editor_tiny  - X-Ref

TinyMCE custom behat step definitions.

set_default_editor_flag(BeforeScenarioScope $scope)   X-Ref
Set Tiny as default editor before executing Tiny tests.

This step is required to ensure that TinyMCE is set as the current default editor as it may
not always be the default editor.

Any Scenario, or Feature, which has the `editor_tiny` tag, or any `tiny_*` tag will have
this step executed before the Scenario.

param: BeforeScenarioScope $scope The Behat Scope

i_click_on_button(string $button, string $locator)   X-Ref
Click on a button for the specified TinyMCE editor.

param: string $button The label of the button
param: string $locator The locator for the editor

button_state_is(string $button, string $locator, string $state)   X-Ref
Confirm that the button state of the specified button/editor combination matches the expectation.

param: string $button The text name of the button
param: string $locator The locator string for the editor
param: string $state The state of the button

i_click_on_menuitem_in_menu(string $menuitem, string $locator)   X-Ref
Click on a button for the specified TinyMCE editor.

param: string $menuitem The label of the menu item
param: string $locator The locator for the editor

select_text(string $textlocator, int $position, string $locator)   X-Ref
Select the element type/index for the specified TinyMCE editor.

param: string $textlocator The type of element to select (for example `p` or `span`)
param: int $position The zero-indexed position
param: string $locator The editor to select within

i_upload_a_file_in_the_filepicker(string $filepath)   X-Ref
Upload a file in the file picker using the repository_upload plugin.

Note: This step assumes we are already in the file picker.
Note: This step is for use by TinyMCE and will be removed once an appropriate step is added to core.
See MDL-76001 for details.


select_in_editor(string $locator, string $type, string $editorlocator)   X-Ref
Select in the editor.

param: string $locator
param: string $type
param: string $editorlocator

expand_all_toolbars(string $editorlocator)   X-Ref
Expand all of the TinyMCE toolbars.

param: string $locator

switch_to_tiny_iframe(string $editorlocator)   X-Ref
Switch to the TinyMCE iframe using a selector.

param: string $editorlocator