Rename environment monkey-test to test

Because we will add Appium test in the future.
This commit is contained in:
Calcitem 2021-11-28 09:26:40 +08:00
parent 37f1a3a437
commit 282805fe8f
No known key found for this signature in database
GPG Key ID: F67E4F8CB7B5EED2
7 changed files with 16 additions and 15 deletions

View File

@ -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>

View File

@ -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>

4
.vscode/launch.json vendored
View File

@ -30,14 +30,14 @@
]
},
{
"name": "Sanmill-monkey",
"name": "Sanmill-test",
"type": "dart",
"request": "launch",
"cwd": "src/ui/flutter_app",
"program": "lib/main.dart",
"args": [
"--dart-define",
"monkey_test=true"
"test=true"
]
},
{

View File

@ -2,6 +2,7 @@
"cSpell.words": [
"ALIGNAS",
"appbundle",
"Appium",
"APSTUDIO",
"ARGB",
"autobuild",

View File

@ -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:
* `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.
* `catcher` to control the use of catcher. (This is on by default and needs to be disabled when required.)

View File

@ -43,7 +43,7 @@ part 'package:sanmill/services/init_system_ui.dart';
Future<void> main() async {
debugPrint('Environment [catcher]: ${EnvironmentConfig.catcher}');
debugPrint('Environment [dev_mode]: ${EnvironmentConfig.devMode}');
debugPrint('Environment [monkey_test]: ${EnvironmentConfig.monkeyTest}');
debugPrint('Environment [test]: ${EnvironmentConfig.test}');
await LocalDatabaseService.initStorage();

View File

@ -22,13 +22,13 @@
class EnvironmentConfig {
const EnvironmentConfig._();
/// gets weather we build for a monkey test
static const monkeyTest = bool.fromEnvironment('monkey_test');
/// Gets whether we build for Monkey/Appium testing
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');
/// gets weather we want catcher to be enabled
/// Gets whether we want catcher to be enabled
/// defaults to true
static const catcher = bool.fromEnvironment('catcher', defaultValue: true);
}