|
static | is_windows () |
| Checks if the current OS is Windows, from the point of view of task-executing-and-killing. More...
|
|
|
string | $ionicurl = '' |
| URL for running Ionic server.
|
|
|
static stdClass | $ionicrunning = null |
| Object with data about launched Ionic instance (if any)
|
|
◆ check_behat_setup()
behat_app::check_behat_setup |
( |
| ) |
|
|
protected |
Checks the Behat setup - tags and configuration.
- Exceptions
-
◆ close_ionic()
static behat_app::close_ionic |
( |
| ) |
|
|
static |
Closes Ionic (if it was started) at end of test suite.
@AfterSuite
◆ fix_moodle_setup()
behat_app::fix_moodle_setup |
( |
| ) |
|
|
protected |
Fixes the Moodle admin settings to allow mobile app use (if not already correct).
- Exceptions
-
◆ getSession()
behat_session_interface::getSession |
( |
|
$name = null | ) |
|
|
inherited |
Returns the Mink session.
- Parameters
-
string | null | $name | name of the session OR active session will be used |
- Return values
-
Implemented in behat_form_field.
◆ i_close_the_browser_tab_opened_by_the_app()
behat_app::i_close_the_browser_tab_opened_by_the_app |
( |
| ) |
|
Closes the current browser tab.
This assumes it was opened by the app and you will now get back to the app.
@Given /^I close the browser tab opened by the app$/
- Exceptions
-
DriverException | If there aren't exactly 2 tabs open |
◆ i_close_the_popup_in_the_app()
behat_app::i_close_the_popup_in_the_app |
( |
| ) |
|
Closes a popup by clicking on the 'backdrop' behind it.
@Given /^I close the popup in the app$/
- Exceptions
-
DriverException | If there isn't a popup to close |
◆ i_enter_the_app()
behat_app::i_enter_the_app |
( |
| ) |
|
Opens the Moodle app in the browser.
Requires JavaScript.
@Given /^I enter the app$/
- Exceptions
-
DriverException | Issue with configuration or feature file |
dml_exception | Problem with Moodle setup |
ExpectationException | Problem with resizing window |
◆ i_press_in_the_app()
behat_app::i_press_in_the_app |
( |
string |
$text | ) |
|
Clicks on / touches something that is visible in the app.
Note it is difficult to use the standard 'click on' or 'press' steps because those do not distinguish visible items and the app always has many non-visible items in the DOM.
@Given /^I press "(?P<text_string>(?:[^"]|::")*)" in the app$/
- Parameters
-
string | $text | Text identifying click target |
- Exceptions
-
DriverException | If the press doesn't work |
◆ i_press_near_in_the_app()
behat_app::i_press_near_in_the_app |
( |
string |
$text, |
|
|
string |
$near |
|
) |
| |
Clicks on / touches something that is visible in the app, near some other text.
This is the same as the other step, but when there are multiple matches, it picks the one nearest (in DOM terms) the second text. The second text should be an exact match, or a partial match that only has one result.
@Given /^I press "(?P<text_string>(?:[^"]|::")*)" near "(?P<nearby_string>(?:[^"]|")*)" in the app$/
- Parameters
-
string | $text | Text identifying click target |
string | $near | Text identifying a nearby unique piece of text |
- Exceptions
-
DriverException | If the press doesn't work |
◆ i_press_the_standard_button_in_the_app()
behat_app::i_press_the_standard_button_in_the_app |
( |
string |
$button | ) |
|
Presses standard buttons in the app.
@Given /^I press the (?P<button_name>back|main menu|page menu) button in the app$/
- Parameters
-
- Exceptions
-
DriverException | If the button push doesn't work |
◆ i_set_the_field_in_the_app()
behat_app::i_set_the_field_in_the_app |
( |
string |
$field, |
|
|
string |
$value |
|
) |
| |
Sets a field to the given text value in the app.
Currently this only works for input fields which must be identified using a partial or exact match on the placeholder text.
@Given /^I set the field "(?P<field_name>(?:[^"]|::")*)" to "(?P<text_string>(?:[^"]|")*)" in the app$/
- Parameters
-
string | $field | Text identifying field |
string | $value | Value for field |
- Exceptions
-
DriverException | If the field set doesn't work |
◆ i_switch_offline_mode()
behat_app::i_switch_offline_mode |
( |
string |
$offline | ) |
|
Switch navigator online mode.
@Given /^I switch offline mode to "(?P<offline_string>(?:[^"]|::")*)"$/
- Parameters
-
string | $offline | New value for navigator online mode |
- Exceptions
-
DriverException | If the navigator.online mode is not available |
◆ i_switch_to_the_browser_tab_opened_by_the_app()
behat_app::i_switch_to_the_browser_tab_opened_by_the_app |
( |
| ) |
|
Switches to a newly-opened browser tab.
This assumes the app opened a new tab.
@Given /^I switch to the browser tab opened by the app$/
- Exceptions
-
DriverException | If there aren't exactly 2 tabs open |
◆ is_windows()
static behat_app::is_windows |
( |
| ) |
|
|
staticprotected |
Checks if the current OS is Windows, from the point of view of task-executing-and-killing.
- Return values
-
◆ login()
behat_app::login |
( |
string |
$username | ) |
|
Carries out the login steps for the app, assuming the user is on the app login page.
Called from behat_auth.php.
- Parameters
-
string | $username | Username (and password) |
- Exceptions
-
◆ prepare_browser()
behat_app::prepare_browser |
( |
string |
$url | ) |
|
|
protected |
Goes to the app page and then sets up some initial JavaScript so we can use it.
- Parameters
-
- Exceptions
-
DriverException | If the app fails to load properly |
◆ press()
behat_app::press |
( |
string |
$text, |
|
|
string |
$near = '' |
|
) |
| |
|
protected |
Clicks on / touches something that is visible in the app, near some other text.
If the $near is specified then when there are multiple matches, it picks the one nearest (in DOM terms) $near. $near should be an exact match, or a partial match that only has one result.
- Parameters
-
behat_base | $base | Behat context |
string | $text | Text identifying click target |
string | $near | Text identifying a nearby unique piece of text |
- Exceptions
-
DriverException | If the press doesn't work |
◆ start_or_reuse_ionic()
behat_app::start_or_reuse_ionic |
( |
| ) |
|
|
protected |
Starts an Ionic server if necessary, or uses an existing one.
- Return values
-
string | URL to Ionic server |
- Exceptions
-
DriverException | If there's a system error starting Ionic |
◆ start_scenario()
behat_app::start_scenario |
( |
| ) |
|
Called from behat_hooks when a new scenario starts, if it has the app tag.
This updates Moodle configuration and starts Ionic running, if it isn't already.
◆ the_header_should_be_in_the_app()
behat_app::the_header_should_be_in_the_app |
( |
string |
$text | ) |
|
Checks that the current header stripe in the app contains the expected text.
This can be used to see if the app went to the expected page.
@Then /^the header should be "(?P<text_string>(?:[^"]|::")*)" in the app$/
- Parameters
-
string | $text | Expected header text |
- Exceptions
-
DriverException | If the header can't be retrieved |
ExpectationException | If the header text is different to the expected value |
◆ EXTENDED_TIMEOUT
const behat_session_interface::EXTENDED_TIMEOUT = 10 |
|
inherited |
And extended timeout for specific cases.
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_extended_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_extended_timeout()
◆ 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.
◆ REDUCED_TIMEOUT
const behat_session_interface::REDUCED_TIMEOUT = 2 |
|
inherited |
Small timeout.
A reduced timeout for cases where self::TIMEOUT is too much and a simple $this->getSession()->getPage()->find() could not be enough.
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_reduced_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_reduced_timeout()
◆ TIMEOUT
const behat_session_interface::TIMEOUT = 6 |
|
inherited |
The timeout for each Behat step (load page, wait for an element to load...).
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_timeout()
The documentation for this class was generated from the following file: