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 |
* Behat grade related step definition overrides for the Classic theme.
|
|
|
19 |
*
|
|
|
20 |
* @package theme_classic
|
|
|
21 |
* @category test
|
|
|
22 |
* @copyright 2019 Michael Hawkins
|
|
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
|
|
|
27 |
|
|
|
28 |
require_once(__DIR__ . '/../../../../grade/tests/behat/behat_grade.php');
|
|
|
29 |
|
|
|
30 |
use Behat\Gherkin\Node\TableNode as TableNode;
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* Behat grade overrides for the Classic theme.
|
|
|
34 |
*
|
|
|
35 |
* @package theme_classic
|
|
|
36 |
* @category test
|
|
|
37 |
* @copyright 2019 Michael Hawkins
|
|
|
38 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
39 |
*/
|
|
|
40 |
class behat_theme_classic_behat_grade extends behat_grade {
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* Navigates to the course gradebook and selects a specified item from the grade navigation tabs.
|
|
|
44 |
*
|
|
|
45 |
* @param string $gradepath
|
|
|
46 |
*/
|
|
|
47 |
public function i_navigate_to_in_the_course_gradebook($gradepath) {
|
|
|
48 |
// If we are not on one of the gradebook pages already, follow "Grades" link in the navigation block.
|
|
|
49 |
$xpath = '//div[contains(@class,\'grade-navigation\')]';
|
|
|
50 |
if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) {
|
|
|
51 |
$this->execute("behat_general::i_click_on_in_the", array(get_string('grades'), 'link',
|
|
|
52 |
get_string('pluginname', 'block_navigation'), 'block'));
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
$this->execute('behat_forms::i_set_the_field_to', [get_string('gradebooknavigationmenu', 'grades'), $gradepath]);
|
|
|
56 |
}
|
|
|
57 |
}
|