Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
HOTFIX fix integration tests and test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Boehrsi committed Oct 25, 2019
1 parent a9d2b55 commit 388deff
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 27 deletions.
2 changes: 0 additions & 2 deletions lib/src/contact/contact_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ class _ContactListState extends State<ContactList> {
builder: (context) => FullscreenProgress(
bloc: _contactListBloc,
text: L10n.get(L.contactImportRunning),
showProgressValues: true,
showCancelButton: true,
),
);
Overlay.of(context).insert(_progressOverlayEntry);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/l10n/core_l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Map<int, String> 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),
Expand Down
5 changes: 3 additions & 2 deletions lib/src/utils/dialog_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ showConfirmationDialog(
content: new Text(content),
actions: <Widget>[
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();
Expand All @@ -101,8 +101,8 @@ showConfirmationDialog(
},
),
new AdaptiveDialogAction(
key: Key(keyConfirmationDialogPositiveButton),
child: new Text(positiveButton),
key: Key(keyDialogBuilderPositiveFlatButton),
onPressed: () {
positiveAction();
if (selfClose) {
Expand Down Expand Up @@ -131,6 +131,7 @@ showInformationDialog(
content: new Text(content),
actions: <Widget>[
new AdaptiveDialogAction(
key: Key(keyInformationDialogPositiveButton),
child: new Text(L10n.get(L.ok)),
onPressed: () {
navigation.pop(context);
Expand Down
6 changes: 4 additions & 2 deletions lib/src/utils/keyMapping.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test_driver/group_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down
12 changes: 6 additions & 6 deletions test_driver/setup/global_consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -135,12 +135,12 @@ 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);

final keyContactChangeEmailFinder = find.byValueKey(keyContactChangeEmailValidatableTextFormField);

final keyContactChangeCheckFinder = find.byValueKey(keyContactChangeCheckIconButton);

final keyDialogBuilderAlertDialogOkFlatButtonFinder = find.byValueKey(keyDialogBuilderAlertDialogOkFlatButton);
final keyDialogBuilderAlertDialogOkFlatButtonFinder = find.byValueKey(keyInformationDialogPositiveButton);
12 changes: 6 additions & 6 deletions test_driver/setup/helper_methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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) {
Expand All @@ -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));
}
14 changes: 7 additions & 7 deletions tools/test.runIntegrationTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ 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
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"

0 comments on commit 388deff

Please sign in to comment.