From 388deff3c435163466c9e5dfd3d7cc5c863ab5ed Mon Sep 17 00:00:00 2001 From: "daniel.boehrs" Date: Fri, 25 Oct 2019 15:33:09 +0200 Subject: [PATCH] HOTFIX fix integration tests and test script --- lib/src/contact/contact_list.dart | 2 -- lib/src/l10n/core_l10n.dart | 2 +- lib/src/utils/dialog_builder.dart | 5 +++-- lib/src/utils/keyMapping.dart | 6 ++++-- test_driver/group_test.dart | 2 +- test_driver/setup/global_consts.dart | 12 ++++++------ test_driver/setup/helper_methods.dart | 12 ++++++------ tools/test.runIntegrationTests.sh | 14 +++++++------- 8 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/src/contact/contact_list.dart b/lib/src/contact/contact_list.dart index 8d36f689..98616ae1 100644 --- a/lib/src/contact/contact_list.dart +++ b/lib/src/contact/contact_list.dart @@ -250,8 +250,6 @@ class _ContactListState extends State { builder: (context) => FullscreenProgress( bloc: _contactListBloc, text: L10n.get(L.contactImportRunning), - showProgressValues: true, - showCancelButton: true, ), ); Overlay.of(context).insert(_progressOverlayEntry); diff --git a/lib/src/l10n/core_l10n.dart b/lib/src/l10n/core_l10n.dart index 1f6d1ac5..cd61c88d 100644 --- a/lib/src/l10n/core_l10n.dart +++ b/lib/src/l10n/core_l10n.dart @@ -59,7 +59,7 @@ Map getStringMap(BuildContext context) { 10: L10n.get(L.video), 11: L10n.get(L.audio), 12: L10n.get(L.file), - 13: "${L10n.get(L.profileDefaultStatus)}: $projectUrl", + 13: "${L10n.get(L.profileDefaultStatus)} - $projectUrl", 14: L10n.get(L.groupNewDraft), 15: L10n.get(L.groupNameChanged), 16: L10n.get(L.groupImageChanged), diff --git a/lib/src/utils/dialog_builder.dart b/lib/src/utils/dialog_builder.dart index 1431915e..f3f1152e 100644 --- a/lib/src/utils/dialog_builder.dart +++ b/lib/src/utils/dialog_builder.dart @@ -89,10 +89,10 @@ showConfirmationDialog( content: new Text(content), actions: [ new AdaptiveDialogAction( + key: Key(keyConfirmationDialogCancelButton), child: new Text(negativeButton != null && negativeButton.isNotEmpty ? negativeButton : L10n.get(L.cancel)), - key: Key(keyDialogBuilderCancelFlatButton), onPressed: () { if (negativeAction != null) { negativeAction(); @@ -101,8 +101,8 @@ showConfirmationDialog( }, ), new AdaptiveDialogAction( + key: Key(keyConfirmationDialogPositiveButton), child: new Text(positiveButton), - key: Key(keyDialogBuilderPositiveFlatButton), onPressed: () { positiveAction(); if (selfClose) { @@ -131,6 +131,7 @@ showInformationDialog( content: new Text(content), actions: [ new AdaptiveDialogAction( + key: Key(keyInformationDialogPositiveButton), child: new Text(L10n.get(L.ok)), onPressed: () { navigation.pop(context); diff --git a/lib/src/utils/keyMapping.dart b/lib/src/utils/keyMapping.dart index ba21158c..5ebb330e 100644 --- a/lib/src/utils/keyMapping.dart +++ b/lib/src/utils/keyMapping.dart @@ -56,8 +56,10 @@ const keyUserSettingsCheckIconButton = "keyUserSettingsCheckIconButton"; const keyUserSettingsUserSettingsUsernameLabel = "key_UserSettingsUserSettingsUsernameLabel"; -const keyDialogBuilderPositiveFlatButton = "keyDialogBuilderImportFlatButton"; -const keyDialogBuilderCancelFlatButton = "keyDialogBuilderCancelFlatButton"; +const keyInformationDialogPositiveButton = "keyDialogBuilderImportFlatButton"; + +const keyConfirmationDialogPositiveButton = "keyDialogBuilderImportFlatButton"; +const keyConfirmationDialogCancelButton = "keyDialogBuilderCancelFlatButton"; const keyContactListPersonAddFloatingActionButton = "key_ContactListPersonAddFloatingActionButton"; diff --git a/test_driver/group_test.dart b/test_driver/group_test.dart index 69006cd7..832750dd 100644 --- a/test_driver/group_test.dart +++ b/test_driver/group_test.dart @@ -184,7 +184,7 @@ void main() { await setup.driver.tap(find.text(newNameTestGroup)); await setup.driver.tap(find.byValueKey(keyChatNameText)); await setup.driver.tap(find.byValueKey(keyChatProfileGroupDelete)); - await setup.driver.tap(find.byValueKey(keyDialogBuilderPositiveFlatButton)); + await setup.driver.tap(find.byValueKey(keyConfirmationDialogPositiveButton)); await catchScreenshot(setup.driver, 'screenshots/leave.png'); await setup.driver.waitForAbsent(find.text(newNameTestGroup)); }); diff --git a/test_driver/setup/global_consts.dart b/test_driver/setup/global_consts.dart index 3e3898e5..267cc612 100644 --- a/test_driver/setup/global_consts.dart +++ b/test_driver/setup/global_consts.dart @@ -93,13 +93,13 @@ const newMe = 'newMe'; const mailCom = 'Mail.com'; -const profileUserStatus = 'Sent with OX COI Messenger - https://github.com/open-xchange/ox-coi'; +const profileUserStatus = 'Sent with OX COI Messenger - https://coi.me'; const searchString = 'Douglas0'; -const typeSomethingComposePlaceholder = 'Type something...'; +final typeSomethingComposePlaceholder = L.getKey(L.typeSomething); -const helloWorld = 'Hello word'; +const helloWorld = 'Hello world'; final typeSomethingComposePlaceholderFinder = find.byValueKey(typeSomethingComposePlaceholder); @@ -125,7 +125,7 @@ final providerEmailFinder = find.byValueKey(keyProviderSignInEmailTextField); final providerPasswordFinder = find.byValueKey(keyProviderSignInPasswordTextField); -final cancelFinder = find.byValueKey(keyDialogBuilderCancelFlatButton); +final cancelFinder = find.byValueKey(keyConfirmationDialogCancelButton); final createChatFinder = find.byValueKey(keyChatListChatFloatingActionButton); @@ -135,7 +135,7 @@ final userProfileEditRaisedButtonFinder = find.byValueKey(keyUserProfileEditProf final userSettingsCheckIconButtonFinder = find.byValueKey(keyUserSettingsCheckIconButton); -final positiveFinder = find.byValueKey(keyDialogBuilderPositiveFlatButton); +final positiveFinder = find.byValueKey(keyConfirmationDialogPositiveButton); final keyContactChangeNameFinder = find.byValueKey(keyContactChangeNameValidatableTextFormField); @@ -143,4 +143,4 @@ final keyContactChangeEmailFinder = find.byValueKey(keyContactChangeEmailValidat final keyContactChangeCheckFinder = find.byValueKey(keyContactChangeCheckIconButton); -final keyDialogBuilderAlertDialogOkFlatButtonFinder = find.byValueKey(keyDialogBuilderAlertDialogOkFlatButton); +final keyDialogBuilderAlertDialogOkFlatButtonFinder = find.byValueKey(keyInformationDialogPositiveButton); diff --git a/test_driver/setup/helper_methods.dart b/test_driver/setup/helper_methods.dart index 70002a03..6dc79141 100644 --- a/test_driver/setup/helper_methods.dart +++ b/test_driver/setup/helper_methods.dart @@ -203,7 +203,7 @@ Future unFlaggedMessage( ) async { await driver.tap(find.byValueKey(keyChatListGetFlaggedActionIconButton)); await driver.waitFor(messageToUnFlaggedFinder); - await driver.scroll(messageToUnFlaggedFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(messageToUnFlaggedFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text(flagUnFlag)); } @@ -212,20 +212,20 @@ Future flaggedMessage( String flagUnFlag, SerializableFinder messageToFlaggedFinder, ) async { - await driver.scroll(messageToFlaggedFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(messageToFlaggedFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text(flagUnFlag)); } Future deleteMessage(SerializableFinder textToDeleteFinder, FlutterDriver driver) async { - await driver.scroll(textToDeleteFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(textToDeleteFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text('Delete locally')); await catchScreenshot(driver, 'screenshots/chatAfterdDelete.png'); } Future copyAndPasteMessage(FlutterDriver driver, String copy, String paste) async { - await driver.scroll(helloWorldFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(helloWorldFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text(copy)); - await driver.scroll(typeSomethingComposePlaceholderFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(typeSomethingComposePlaceholderFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text(paste)); await driver.tap(find.byValueKey(KeyChatComposerMixinOnSendTextIcon)); if (helloWorldFinder.serialize().length <= 2) { @@ -235,7 +235,7 @@ Future copyAndPasteMessage(FlutterDriver driver, String copy, String paste) asyn } Future forwardMessageTo(FlutterDriver driver, String contactToForward, String forward) async { - await driver.scroll(helloWorldFinder, 0, 0, Duration(milliseconds: 5000)); + await driver.scroll(helloWorldFinder, 0, 0, Duration(milliseconds: 1000)); await driver.tap(find.text(forward)); await driver.tap(find.text(contactToForward)); } diff --git a/tools/test.runIntegrationTests.sh b/tools/test.runIntegrationTests.sh index e8c2322a..726409d3 100755 --- a/tools/test.runIntegrationTests.sh +++ b/tools/test.runIntegrationTests.sh @@ -17,13 +17,13 @@ touch ${LOG_FILE} for test in test_driver/* do if [[ -f "$test" ]]; then - echo "Running test: $test" + echo "### Running test: $test" flutter drive --target=test_driver/setup/app.dart --driver=${test} --flavor development >> ${LOG_FILE} 2>&1 if [[ $? -eq 0 ]]; then - echo "$test successfully finished" + echo " [OK] $test" ((success++)) else - echo "$test failed - See more information in test_driver/log.txt" + echo " [FAIL] $test - See (test_driver/log.txt)" ((failed++)) fi fi @@ -31,7 +31,7 @@ done echo testCount=$((success + failed)) -echo "Test suite finished" -echo "All tests: $testCount" -echo "Successful: $success" -echo "Failed: $failed" +echo "### Test suite finished" +echo " [All]: $testCount" +echo " [OK]: $success successfully finished" +echo " [FAIL]: $failed errors occurred"