From dca22d7cc1b59a4504f89cede7cf5d5ce6b002be Mon Sep 17 00:00:00 2001 From: David Monllao Date: Wed, 10 Oct 2012 10:21:10 +0800 Subject: [PATCH] MDL-37046 behat: Basic web execution wrapper --- admin/tool/behat/index.php | 12 ++++++++---- admin/tool/behat/lang/en/tool_behat.php | 12 ++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/admin/tool/behat/index.php b/admin/tool/behat/index.php index da7f7aa8e49..4fc15fcb889 100644 --- a/admin/tool/behat/index.php +++ b/admin/tool/behat/index.php @@ -24,12 +24,16 @@ require(__DIR__ . '/../../../config.php'); require_once($CFG->libdir.'/adminlib.php'); +require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/behat/locallib.php'); + +$action = optional_param('action', 'info', PARAM_ALPHAEXT); admin_externalpage_setup('toolbehat'); +$title = get_string('pluginname', 'tool_behat') . ' - ' . get_string('command' . $action, 'tool_behat'); echo $OUTPUT->header(); -echo $OUTPUT->heading(get_string('pluginname', 'tool_behat')); -echo $OUTPUT->box_start(); -echo get_string('installationinfo', 'tool_behat'); -echo $OUTPUT->box_end(); +echo $OUTPUT->heading($title); + +call_user_func('tool_behat::' . $action); + echo $OUTPUT->footer(); diff --git a/admin/tool/behat/lang/en/tool_behat.php b/admin/tool/behat/lang/en/tool_behat.php index 4627cc2f1b6..1525cd4fd09 100644 --- a/admin/tool/behat/lang/en/tool_behat.php +++ b/admin/tool/behat/lang/en/tool_behat.php @@ -22,5 +22,13 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = 'Behat'; -$string['installationinfo'] = ''; \ No newline at end of file +$string['actionnotsupported'] = 'Action not supported'; +$string['commandbuildconfigfile'] = 'Build config file'; +$string['commandinfo'] = 'Info'; +$string['commandruntests'] = 'Run tests'; +$string['commandstepsdefinitions'] = 'Steps definitions list'; +$string['finished'] = 'Process finished'; +$string['nobehatpath'] = 'You must specify the path to moodle-acceptance-tests.'; +$string['nostepsdefinitions'] = 'There aren\'t steps definitions matching this filter'; +$string['pluginname'] = 'Acceptance test tool'; +$string['wrongbehatsetup'] = 'Something is wrong with the setup, check moodle-acceptance-tests runs well on CLI and check your \'behatpath\' setting value is pointing to the right directory'; \ No newline at end of file -- 2.43.0