1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* The Interface for a behat root context.
|
|
|
19 |
*
|
|
|
20 |
* @package core
|
|
|
21 |
* @category test
|
|
|
22 |
* @copyright 2020 Andrew Nicols <andrew@nicols.co.uk>
|
|
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
/**
|
|
|
27 |
* The Interface for a behat root context.
|
|
|
28 |
*
|
|
|
29 |
* This interface should be implemented by the behat_base context, and behat form fields, and it should be paired with
|
|
|
30 |
* the behat_session_trait.
|
|
|
31 |
*
|
|
|
32 |
* It should not be necessary to implement this interface, and the behat_session_trait trait in normal circumstances.
|
|
|
33 |
*
|
|
|
34 |
* @package core
|
|
|
35 |
* @category test
|
|
|
36 |
* @copyright 2020 Andrew Nicols <andrew@nicols.co.uk>
|
|
|
37 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
38 |
*/
|
|
|
39 |
interface behat_session_interface {
|
|
|
40 |
/**
|
|
|
41 |
* The JS code to check that the page is ready.
|
|
|
42 |
*
|
|
|
43 |
* The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.
|
|
|
44 |
*/
|
|
|
45 |
const PAGE_READY_JS = "document.readyState === 'complete' && " .
|
|
|
46 |
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
|
|
|
47 |
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)";
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* Returns the Mink session.
|
|
|
51 |
*
|
|
|
52 |
* @param string|null $name name of the session OR active session will be used
|
|
|
53 |
* @return \Behat\Mink\Session
|
|
|
54 |
*/
|
|
|
55 |
public function getSession($name = null);
|
|
|
56 |
}
|