Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
behat_editor_tiny Class Reference

TinyMCE custom behat step definitions. More...

Inheritance diagram for behat_editor_tiny:
behat_base core_behat\settable_editor behat_session_interface

Public Member Functions

 button_state_is (string $button, string $locator, string $state)
 Confirm that the button state of the specified button/editor combination matches the expectation.
 
 getSession ($name=null)
 Returns the Mink session.
 
 i_click_on_button (string $button, string $locator)
 Click on a button for the specified TinyMCE editor.
 
 i_click_on_menuitem_in_menu (string $menuitem, string $locator)
 Click on a button for the specified TinyMCE editor.
 
 select_text (string $textlocator, int $position, string $locator)
 Select the element type/index for the specified TinyMCE editor.
 
 set_default_editor_flag (BeforeScenarioScope $scope)
 Set Tiny as default editor before executing Tiny tests.
 
 set_editor_value (string $editorid, string $value)
 Set the editor value.
 

Public Attributes

const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Detailed Description

TinyMCE custom behat step definitions.

Member Function Documentation

◆ button_state_is()

behat_editor_tiny::button_state_is ( string $button,
string $locator,
string $state )

Confirm that the button state of the specified button/editor combination matches the expectation.

@Then /^the "(?P<button_string>(?:[^"]|::")*)" button of the "(?P<locator_string>(?:[^"]|")*)" TinyMCE editor has state "(?P<state_string>(?:[^"]|::")*)"$/

Parameters
string$buttonThe text name of the button
string$locatorThe locator string for the editor
string$stateThe state of the button
Exceptions
ExpectationExceptionThrown if the button state is not correct

◆ getSession()

behat_session_interface::getSession ( $name = null)
inherited

Returns the Mink session.

Parameters
string | null$namename of the session OR active session will be used
Return values
Behat\Mink\Session

Implemented in behat_form_field.

◆ i_click_on_button()

behat_editor_tiny::i_click_on_button ( string $button,
string $locator )

Click on a button for the specified TinyMCE editor.

@When /^I click on the "(?P<button_string>(?:[^"]|::")*)" button for the "(?P<locator_string>(?:[^"]|")*)" TinyMCE editor$/

Parameters
string$buttonThe label of the button
string$locatorThe locator for the editor

◆ i_click_on_menuitem_in_menu()

behat_editor_tiny::i_click_on_menuitem_in_menu ( string $menuitem,
string $locator )

Click on a button for the specified TinyMCE editor.

@When /^I click on the "(?P<menuitem_string>(?:[^"]|::")*)" menu item for the "(?P<locator_string>(?:[^"]|")*)" TinyMCE editor$/

Parameters
string$menuitemThe label of the menu item
string$locatorThe locator for the editor

◆ select_text()

behat_editor_tiny::select_text ( string $textlocator,
int $position,
string $locator )

Select the element type/index for the specified TinyMCE editor.

@When /^I select the "(?P<textlocator_string>(?:[^"]|::")*)" element in position "(?P<position_int>(?:[^"]|")*)" of the "(?P<locator_string>(?:[^"]|::")*)" TinyMCE editor$/

Parameters
string$textlocatorThe type of element to select (for example p or span)
int$positionThe zero-indexed position
string$locatorThe editor to select within

◆ set_default_editor_flag()

behat_editor_tiny::set_default_editor_flag ( BeforeScenarioScope $scope)

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.

@BeforeScenario

Parameters
BeforeScenarioScope$scopeThe Behat Scope

◆ set_editor_value()

core_behat\settable_editor::set_editor_value ( string $editorid,
string $value )
inherited

Set the editor value.

Parameters
string$editoridThe id of the editor within the page
string$valueThe intended content of the editor

Implemented in behat_editor_atto, and behat_editor_textarea.

Member Data Documentation

◆ PAGE_READY_JS

const behat_session_interface::PAGE_READY_JS
inherited
Initial value:
= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"

The JS code to check that the page is ready.

The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.


The documentation for this class was generated from the following file: