Skip to content
Permalink
Browse files

MDL-63977 Behat: Rename Ionic config variables for consistency

  • Loading branch information...
sammarshallou committed Feb 11, 2019
1 parent 079eae3 commit ff3ccab52e1b3abdd479b9de4625d9db3c28e24c
@@ -24,7 +24,7 @@
$string['aim'] = 'This administration tool helps developers and test writers to create .feature files describing Moodle\'s functionalities and run them automatically. Step definitions available for use in .feature files are listed below.';
$string['allavailablesteps'] = 'All available step definitions';
$string['errorapproot'] = '$CFG->behat_approot is not pointing to a valid Moodle Mobile developer install.';
$string['errorapproot'] = '$CFG->behat_ionic_dirroot is not pointing to a valid Moodle Mobile developer install.';
$string['errorbehatcommand'] = 'Error running behat CLI command. Try running "{$a} --help" manually from CLI to find out more about the problem.';
$string['errorcomposer'] = 'Composer dependencies are not installed.';
$string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.';
@@ -869,11 +869,11 @@
// define('BEHAT_DISABLE_HISTOGRAM', true);
//
// Mobile app Behat testing requires this option, pointing to a developer Moodle Mobile directory:
// $CFG->behat_approot = '/where/I/keep/my/git/checkouts/moodlemobile2';
// $CFG->behat_ionic_dirroot = '/where/I/keep/my/git/checkouts/moodlemobile2';
//
// The following option can be used to indicate a running Ionic server (otherwise Behat will start
// one automatically for each test run, which is convenient but takes ages):
// $CFG->behat_ionicaddress = 'http://localhost:8100';
// $CFG->behat_ionic_wwwroot = 'http://localhost:8100';
//
//=========================================================================
// 12. DEVELOPER DATA GENERATOR
@@ -220,7 +220,7 @@ public static function behat_setup_problem() {
}
// If app config is supplied, check the value is correct.
if (!empty($CFG->behat_approot) && !file_exists($CFG->behat_approot . '/ionic.config.json')) {
if (!empty($CFG->behat_ionic_dirroot) && !file_exists($CFG->behat_ionic_dirroot . '/ionic.config.json')) {
self::output_msg(get_string('errorapproot', 'tool_behat'));
return BEHAT_EXITCODE_CONFIG;
}
@@ -705,12 +705,12 @@ protected function get_behat_profile($profile, $values) {
protected function get_mobile_version_tags() : string {
global $CFG;
if (empty($CFG->behat_approot)) {
if (empty($CFG->behat_ionic_dirroot)) {
return '';
}
// Get app version.
$jsonpath = $CFG->behat_approot . '/package.json';
$jsonpath = $CFG->behat_ionic_dirroot . '/package.json';
$json = @file_get_contents($jsonpath);
if (!$json) {
throw new coding_exception('Unable to load app version from ' . $jsonpath);
@@ -1360,7 +1360,7 @@ protected function get_behat_features_for_theme($theme) {
// Mobile app tests are not theme-specific, so run only for the default theme (and if
// configured).
if (empty($CFG->behat_approot) || $theme !== $this->get_default_theme()) {
if (empty($CFG->behat_ionic_dirroot) || $theme !== $this->get_default_theme()) {
$themeblacklisttags[] = '@app';
}
@@ -103,8 +103,8 @@ protected function check_behat_setup() {
}
// Check the config settings are defined.
if (empty($CFG->behat_ionicaddress) && empty($CFG->behat_approot)) {
throw new DriverException('$CFG->behat_ionicaddress or $CFG->behat_approot must be defined.');
if (empty($CFG->behat_ionic_wwwroot) && empty($CFG->behat_ionic_dirroot)) {
throw new DriverException('$CFG->behat_ionic_wwwroot or $CFG->behat_ionic_dirroot must be defined.');
}
}
@@ -176,15 +176,15 @@ protected function fix_moodle_setup() {
protected function start_or_reuse_ionic() {
global $CFG;
if (!empty($CFG->behat_ionicaddress)) {
if (!empty($CFG->behat_ionic_wwwroot)) {
// Use supplied Ionic server which should already be running.
$url = $CFG->behat_ionicaddress;
$url = $CFG->behat_ionic_wwwroot;
} else if (self::$ionicrunning) {
// Use existing Ionic instance launched previously.
$url = self::$ionicrunning->url;
} else {
// Open Ionic process in relevant path.
$path = realpath($CFG->behat_approot);
$path = realpath($CFG->behat_ionic_dirroot);
$stderrfile = $CFG->dataroot . '/behat/ionic-stderr.log';
$prefix = '';
// Except on Windows, use 'exec' so that we get the pid of the actual Node process

0 comments on commit ff3ccab

Please sign in to comment.
You can’t perform that action at this time.