Rename environment monkey-test to test
Because we will add Appium test in the future.
This commit is contained in:
parent
37f1a3a437
commit
282805fe8f
|
@ -1,7 +0,0 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="Sanmill-monkey" type="FlutterRunConfigurationType" factoryName="Flutter">
|
|
||||||
<option name="additionalArgs" value="--dart-define monkey_test=true" />
|
|
||||||
<option name="filePath" value="$PROJECT_DIR$/src/ui/flutter_app/lib/main.dart" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Sanmill-test" type="FlutterRunConfigurationType" factoryName="Flutter">
|
||||||
|
<option name="additionalArgs" value="--dart-define test=true" />
|
||||||
|
<option name="filePath" value="$PROJECT_DIR$/src/ui/flutter_app/lib/main.dart" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -30,14 +30,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Sanmill-monkey",
|
"name": "Sanmill-test",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"cwd": "src/ui/flutter_app",
|
"cwd": "src/ui/flutter_app",
|
||||||
"program": "lib/main.dart",
|
"program": "lib/main.dart",
|
||||||
"args": [
|
"args": [
|
||||||
"--dart-define",
|
"--dart-define",
|
||||||
"monkey_test=true"
|
"test=true"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"ALIGNAS",
|
"ALIGNAS",
|
||||||
"appbundle",
|
"appbundle",
|
||||||
|
"Appium",
|
||||||
"APSTUDIO",
|
"APSTUDIO",
|
||||||
"ARGB",
|
"ARGB",
|
||||||
"autobuild",
|
"autobuild",
|
||||||
|
|
|
@ -73,7 +73,7 @@ Run `./flutter-init.sh` , copy `src/ui/flutter_app/android/key.properties.exampl
|
||||||
|
|
||||||
We use compile-time environment configs to enable specific parts of the code:
|
We use compile-time environment configs to enable specific parts of the code:
|
||||||
|
|
||||||
* `monkey_test` to prepare the app for monkey tests. (References to external sites are going to be disabled.)
|
* `test` to prepare the app for Monkey and Appium testing. (References to external sites are going to be disabled.)
|
||||||
* `dev_mode` to show the developer mode without needing to enable it first.
|
* `dev_mode` to show the developer mode without needing to enable it first.
|
||||||
* `catcher` to control the use of catcher. (This is on by default and needs to be disabled when required.)
|
* `catcher` to control the use of catcher. (This is on by default and needs to be disabled when required.)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ part 'package:sanmill/services/init_system_ui.dart';
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
debugPrint('Environment [catcher]: ${EnvironmentConfig.catcher}');
|
debugPrint('Environment [catcher]: ${EnvironmentConfig.catcher}');
|
||||||
debugPrint('Environment [dev_mode]: ${EnvironmentConfig.devMode}');
|
debugPrint('Environment [dev_mode]: ${EnvironmentConfig.devMode}');
|
||||||
debugPrint('Environment [monkey_test]: ${EnvironmentConfig.monkeyTest}');
|
debugPrint('Environment [test]: ${EnvironmentConfig.test}');
|
||||||
|
|
||||||
await LocalDatabaseService.initStorage();
|
await LocalDatabaseService.initStorage();
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,13 @@
|
||||||
class EnvironmentConfig {
|
class EnvironmentConfig {
|
||||||
const EnvironmentConfig._();
|
const EnvironmentConfig._();
|
||||||
|
|
||||||
/// gets weather we build for a monkey test
|
/// Gets whether we build for Monkey/Appium testing
|
||||||
static const monkeyTest = bool.fromEnvironment('monkey_test');
|
static const test = bool.fromEnvironment('test');
|
||||||
|
|
||||||
/// gets weather we build for devMode
|
/// Gets whether we build for devMode
|
||||||
static const devMode = bool.fromEnvironment('dev_mode');
|
static const devMode = bool.fromEnvironment('dev_mode');
|
||||||
|
|
||||||
/// gets weather we want catcher to be enabled
|
/// Gets whether we want catcher to be enabled
|
||||||
/// defaults to true
|
/// defaults to true
|
||||||
static const catcher = bool.fromEnvironment('catcher', defaultValue: true);
|
static const catcher = bool.fromEnvironment('catcher', defaultValue: true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue