diff --git a/integration_test/Readme.md b/integration_test/Readme.md index 461cbd44..33d451d1 100644 --- a/integration_test/Readme.md +++ b/integration_test/Readme.md @@ -14,11 +14,11 @@ Located in the `integration_test/env` folder and managed by the hooks in `integr [~] tor status+reset [~] shutdown cwtch [ ] 2. global settings (verify functionality) - [ ] language - [ ] theme+color theme + [_] language # blocked by dropdown + [_] theme+color theme # blocked by dropdown [ ] column mode -> background? so all tests check both modes? - [ ] block unknown - [ ] streamer mode + [X] block unknown + [X] streamer mode [ ] 3. experiments ( [ ] group chat -> needs many [ ] server hosting -> also many @@ -26,14 +26,16 @@ Located in the `integration_test/env` folder and managed by the hooks in `integr [ ] image previews [ ] clickable links (how much to test?) [ ] 4. profile mgmt - [ ] create+delete - [ ] default+password load + [X] create+delete + [X] default+password load + [X] name change [ ] password change [ ] known server mgmt [ ] 5. p2p chat [ ] add, remove, block, archive [ ] invite accept+reject - [ ] send+receive inc acks + [X] send+receive + [ ] acks [ ] try to send a long message [ ] malformed messages, replies [ ] overlays (invite, file/image) diff --git a/integration_test/env/aliceandbob1/dev/profiles/648b3aac5a139faadf74661983ab072e/SALT b/integration_test/env/aliceandbob1/dev/profiles/648b3aac5a139faadf74661983ab072e/SALT new file mode 100644 index 00000000..0c8668b0 --- /dev/null +++ b/integration_test/env/aliceandbob1/dev/profiles/648b3aac5a139faadf74661983ab072e/SALT @@ -0,0 +1 @@ +q3 ҎB7 (ʖvQBɱFz\\UG[/ ?u\;]yHG|,3xeE0 !S͞ onBeforeRun(TestConfiguration config) async { // initialize @env:persist + await Process.run("rm", ["-rf", "integration_test/env/temp-persist"]); await Process.run("cp", ["-R", "integration_test/env/persist", "integration_test/env/temp-persist"]); return super.onBeforeRun(config); diff --git a/integration_test/steps/overrides.dart b/integration_test/steps/overrides.dart index 48ce16f3..6a666b78 100644 --- a/integration_test/steps/overrides.dart +++ b/integration_test/steps/overrides.dart @@ -198,6 +198,30 @@ StepDefinitionGeneric WaitUntilTextExists() { ); } +StepDefinitionGeneric WaitUntilTooltipExists() { + return then2( + 'I wait until the tooltip {string} is {existence}', + (ofType, existence, context) async { + await context.world.appDriver.waitUntil( + () async { + await context.world.appDriver.waitForAppToSettle(); + + return existence == Existence.absent + ? context.world.appDriver.isAbsent( + context.world.appDriver.findBy(ofType, FindType.tooltip), + ) + : context.world.appDriver.isPresent( + context.world.appDriver.findBy(ofType, FindType.tooltip), + ); + }, + timeout: Duration(seconds: 120), + ); + }, + configuration: StepDefinitionConfiguration() + ..timeout = const Duration(days: 1), + ); +} + mixin _SwipeHelper on When4WithWorld { Future swipeOnFinder( diff --git a/lib/views/addcontactview.dart b/lib/views/addcontactview.dart index 3cee78c1..49edc309 100644 --- a/lib/views/addcontactview.dart +++ b/lib/views/addcontactview.dart @@ -138,6 +138,7 @@ class _AddContactViewState extends State { height: 20, ), CwtchTextField( + testKey: Key("txtAddP2P"), controller: ctrlrContact, validator: (value) { if (value == "") { diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 5b733587..71e8a5a3 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -107,7 +107,7 @@ class _GlobalSettingsViewState extends State { items: themes.keys.map>((String themeId) { return DropdownMenuItem( value: themeId, - child: Text("ddi_$themeId", key: Key("ddi_$themeId")), //getThemeName(context, themeId)), + child: Text(getThemeName(context, themeId)), //"ddi_$themeId", key: Key("ddi_$themeId")), ); }).toList()), leading: Icon(CwtchIcons.change_theme, color: settings.current().mainTextColor), diff --git a/lib/widgets/folderpicker.dart b/lib/widgets/folderpicker.dart index 90268052..2b1f586e 100644 --- a/lib/widgets/folderpicker.dart +++ b/lib/widgets/folderpicker.dart @@ -64,6 +64,7 @@ class _CwtchFolderPickerState extends State { print(e); } }, + onChanged: widget.onSave, icon: Icon(Icons.folder), tooltip: widget.tooltip, ))); diff --git a/lib/widgets/textfield.dart b/lib/widgets/textfield.dart index 7545618b..793077ff 100644 --- a/lib/widgets/textfield.dart +++ b/lib/widgets/textfield.dart @@ -8,7 +8,7 @@ doNothing(String x) {} // Provides a styled Text Field for use in Form Widgets. // Callers must provide a text controller, label helper text and a validator. class CwtchTextField extends StatefulWidget { - CwtchTextField({required this.controller, this.hintText = "", this.validator, this.autofocus = false, this.onChanged = doNothing, this.number = false, this.multiLine = false, this.key}); + CwtchTextField({required this.controller, this.hintText = "", this.validator, this.autofocus = false, this.onChanged = doNothing, this.number = false, this.multiLine = false, this.key, this.testKey}); final TextEditingController controller; final String hintText; final FormFieldValidator? validator; @@ -17,6 +17,7 @@ class CwtchTextField extends StatefulWidget { final bool multiLine; final bool number; final Key? key; + final Key? testKey; @override _CwtchTextFieldState createState() => _CwtchTextFieldState(); @@ -41,6 +42,7 @@ class _CwtchTextFieldState extends State { Widget build(BuildContext context) { return Consumer(builder: (context, theme, child) { return TextFormField( + key: widget.testKey, controller: widget.controller, validator: widget.validator, onChanged: widget.onChanged, diff --git a/run-tests.sh b/run-tests.sh index 7b1af78b..bb6e046e 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -12,7 +12,7 @@ sed "s|featurePaths: REPLACED_BY_SCRIPT|featurePaths: [$paths]|" integra flutter pub run build_runner clean flutter pub run build_runner build --delete-conflicting-outputs pkill tor -LD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart +LD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --headless --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart node index2.js if [ "$HEADLESS" = "false" ]; then xdg-open integration_test/gherkin/reports/cucumber_report.html