diff --git a/mod/glossary/tests/behat/behat_mod_glossary.php b/mod/glossary/tests/behat/behat_mod_glossary.php new file mode 100644 index 00000000000..4d272685cab --- /dev/null +++ b/mod/glossary/tests/behat/behat_mod_glossary.php @@ -0,0 +1,58 @@ +. + +/** + * Steps definitions related with the glossary activity. + * + * @package mod_glossary + * @category test + * @copyright 2013 David Monllaó + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../lib/behat/behat_base.php'); + +use Behat\Behat\Context\Step\Given as Given, + Behat\Gherkin\Node\TableNode as TableNode, + Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; + +/** + * Glossary-related steps definitions. + * + * @package mod_glossary + * @category test + * @copyright 2013 David Monllaó + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_mod_glossary extends behat_base { + + /** + * Adds an entry to the current glossary with the provided data. You should be in the glossary page. + * + * @Given /^I add a glossary entry with the following data:$/ + * @param TableNode $data + */ + public function i_add_a_glossary_entry_with_the_following_data(TableNode $data) { + return array( + new Given('I press "' . get_string('addentry', 'mod_glossary') . '"'), + new Given('I fill the moodle form with:', $data), + new Given('I press "Save changes"') + ); + } + +}