|
|
@ -96,7 +96,8 @@ class MemorySharedPreferences implements SharedPreferences { |
|
|
|
|
|
|
|
|
|
|
|
Future pumpAppPage( |
|
|
|
Future pumpAppPage( |
|
|
|
final WidgetTester tester, |
|
|
|
final WidgetTester tester, |
|
|
|
final IntegrationTestWidgetsFlutterBinding binding, { |
|
|
|
final IntegrationTestWidgetsFlutterBinding binding, |
|
|
|
|
|
|
|
final PackageInfo packageInfo, { |
|
|
|
required final Widget Function(BuildContext, Function(NextcloudTheme)) builder, |
|
|
|
required final Widget Function(BuildContext, Function(NextcloudTheme)) builder, |
|
|
|
final Account? account, |
|
|
|
final Account? account, |
|
|
|
}) async { |
|
|
|
}) async { |
|
|
@ -106,8 +107,6 @@ Future pumpAppPage( |
|
|
|
final requestManager = RequestManager(); |
|
|
|
final requestManager = RequestManager(); |
|
|
|
final allAppImplementations = getAppImplementations(sharedPreferences, requestManager, platform); |
|
|
|
final allAppImplementations = getAppImplementations(sharedPreferences, requestManager, platform); |
|
|
|
|
|
|
|
|
|
|
|
final packageInfo = await PackageInfo.fromPlatform(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final globalOptions = GlobalOptions( |
|
|
|
final globalOptions = GlobalOptions( |
|
|
|
Storage('global', sharedPreferences), |
|
|
|
Storage('global', sharedPreferences), |
|
|
|
packageInfo, |
|
|
|
packageInfo, |
|
|
@ -123,7 +122,7 @@ Future pumpAppPage( |
|
|
|
allAppImplementations, |
|
|
|
allAppImplementations, |
|
|
|
); |
|
|
|
); |
|
|
|
if (account != null) { |
|
|
|
if (account != null) { |
|
|
|
accountsBloc.addAccount(account..setupClient(packageInfo)); |
|
|
|
accountsBloc.addAccount(account); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final pushNotificationsBloc = PushNotificationsBloc( |
|
|
|
final pushNotificationsBloc = PushNotificationsBloc( |
|
|
@ -220,14 +219,17 @@ Future main() async { |
|
|
|
assert(Platform.isAndroid, 'Screenshots need to be taken on Android'); |
|
|
|
assert(Platform.isAndroid, 'Screenshots need to be taken on Android'); |
|
|
|
|
|
|
|
|
|
|
|
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); |
|
|
|
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); |
|
|
|
|
|
|
|
late PackageInfo packageInfo; |
|
|
|
final account = Account( |
|
|
|
late Account account; |
|
|
|
serverURL: 'http://10.0.2.2', |
|
|
|
|
|
|
|
username: 'user1', |
|
|
|
|
|
|
|
password: 'user1', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setUpAll(() async { |
|
|
|
setUpAll(() async { |
|
|
|
|
|
|
|
packageInfo = await PackageInfo.fromPlatform(); |
|
|
|
|
|
|
|
account = Account( |
|
|
|
|
|
|
|
serverURL: 'http://10.0.2.2', |
|
|
|
|
|
|
|
username: 'user1', |
|
|
|
|
|
|
|
password: 'user1', |
|
|
|
|
|
|
|
)..setupClient(packageInfo); |
|
|
|
|
|
|
|
|
|
|
|
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); |
|
|
|
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -235,6 +237,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
builder: (final context, final _) => const LoginPage(), |
|
|
|
builder: (final context, final _) => const LoginPage(), |
|
|
|
); |
|
|
|
); |
|
|
|
await prepareScreenshot(tester, binding); |
|
|
|
await prepareScreenshot(tester, binding); |
|
|
@ -253,6 +256,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
@ -270,6 +274,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
@ -322,6 +327,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
@ -396,6 +402,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
@ -454,15 +461,23 @@ Future main() async { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
testWidgets('notifications', (final tester) async { |
|
|
|
testWidgets('notifications', (final tester) async { |
|
|
|
await account.client.notifications.sendAdminNotification( |
|
|
|
await (Account( |
|
|
|
userId: account.username, |
|
|
|
serverURL: 'http://10.0.2.2', |
|
|
|
shortMessage: 'Notifications demo', |
|
|
|
username: 'admin', |
|
|
|
longMessage: 'This is a notifications demo of the Neon app', |
|
|
|
password: 'admin', |
|
|
|
); |
|
|
|
)..setupClient(packageInfo)) |
|
|
|
|
|
|
|
.client |
|
|
|
|
|
|
|
.notifications |
|
|
|
|
|
|
|
.sendAdminNotification( |
|
|
|
|
|
|
|
userId: account.username, |
|
|
|
|
|
|
|
shortMessage: 'Notifications demo', |
|
|
|
|
|
|
|
longMessage: 'This is a notifications demo of the Neon app', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
@ -482,6 +497,7 @@ Future main() async { |
|
|
|
await pumpAppPage( |
|
|
|
await pumpAppPage( |
|
|
|
tester, |
|
|
|
tester, |
|
|
|
binding, |
|
|
|
binding, |
|
|
|
|
|
|
|
packageInfo, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
builder: (final context, final onThemeChanged) => HomePage( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|