mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 08:22:16 +03:00
add test tags
This commit is contained in:
parent
d9b5eb7413
commit
8a56a2b71a
17
dart_test.yaml
Normal file
17
dart_test.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
# define available tags
|
||||
tags:
|
||||
# Tests which we want to run on desktop
|
||||
desktop:
|
||||
|
||||
# Tests which we want to run on Android
|
||||
android:
|
||||
|
||||
# Tests consuming quiet a lot of time
|
||||
slow:
|
||||
|
||||
# Minimal tests
|
||||
# quick verification that the framework is working
|
||||
minimal:
|
||||
|
||||
# OATH tests
|
||||
oath:
|
@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@Tags(['desktop', 'android'])
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
@ -28,6 +30,10 @@ void main() {
|
||||
var binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
|
||||
|
||||
group('Startup', () {
|
||||
appTestKeyless('App starts', (WidgetTester tester) async {},
|
||||
tags: 'minimal');
|
||||
});
|
||||
group('Settings', () {
|
||||
appTestKeyless('Click through all Themes', (WidgetTester tester) async {
|
||||
var settingDrawerButton = find.byKey(settingDrawerIcon).hitTestable();
|
||||
@ -66,26 +72,42 @@ void main() {
|
||||
appTestKeyless('TOS link', (WidgetTester tester) async {
|
||||
await tester.tap(helpDrawerButton);
|
||||
await tester.longWait();
|
||||
await tester.tap(find.byKey(tosButton).hitTestable());
|
||||
await tester.longWait();
|
||||
if (isAndroid) {
|
||||
expect(find.byKey(tosButton).hitTestable(), findsOneWidget);
|
||||
} else {
|
||||
await tester.tap(find.byKey(tosButton).hitTestable());
|
||||
await tester.longWait();
|
||||
}
|
||||
});
|
||||
appTestKeyless('Privacy link', (WidgetTester tester) async {
|
||||
await tester.tap(helpDrawerButton);
|
||||
await tester.longWait();
|
||||
await tester.tap(find.byKey(privacyButton).hitTestable());
|
||||
await tester.longWait();
|
||||
if (isAndroid) {
|
||||
expect(find.byKey(privacyButton).hitTestable(), findsOneWidget);
|
||||
} else {
|
||||
await tester.tap(find.byKey(privacyButton).hitTestable());
|
||||
await tester.longWait();
|
||||
}
|
||||
});
|
||||
appTestKeyless('Feedback link', (WidgetTester tester) async {
|
||||
await tester.tap(helpDrawerButton);
|
||||
await tester.longWait();
|
||||
await tester.tap(find.byKey(feedbackButton).hitTestable());
|
||||
await tester.longWait();
|
||||
if (isAndroid) {
|
||||
expect(find.byKey(feedbackButton).hitTestable(), findsOneWidget);
|
||||
} else {
|
||||
await tester.tap(find.byKey(feedbackButton).hitTestable());
|
||||
await tester.longWait();
|
||||
}
|
||||
});
|
||||
appTestKeyless('Help link', (WidgetTester tester) async {
|
||||
await tester.tap(helpDrawerButton);
|
||||
await tester.longWait();
|
||||
await tester.tap(find.byKey(helpButton).hitTestable());
|
||||
await tester.longWait();
|
||||
if (isAndroid) {
|
||||
expect(find.byKey(helpButton).hitTestable(), findsOneWidget);
|
||||
} else {
|
||||
await tester.tap(find.byKey(helpButton).hitTestable());
|
||||
await tester.longWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
group('Troubleshooting', () {
|
||||
|
@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@Tags(['android', 'desktop', 'oath'])
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
import 'package:yubico_authenticator/app/views/keys.dart';
|
||||
@ -74,7 +76,7 @@ void main() {
|
||||
// TODO: verify one more addAccount() is not possible
|
||||
await tester.resetOATH();
|
||||
await tester.shortWait();
|
||||
});
|
||||
}, tags: ['slow']);
|
||||
// appTest('Create weird character-accounts and check byte count',
|
||||
// (WidgetTester tester) async {});
|
||||
group('TOTP account tests', () {
|
||||
|
@ -122,9 +122,10 @@ void appTestKeyless(
|
||||
WidgetTesterCallback callback, {
|
||||
bool? skip,
|
||||
Map startUpParams = const {},
|
||||
dynamic tags,
|
||||
}) {
|
||||
testWidgets(description, skip: skip, (WidgetTester tester) async {
|
||||
await tester.startUp(startUpParams);
|
||||
await callback(tester);
|
||||
});
|
||||
}, tags: tags);
|
||||
}
|
||||
|
@ -247,9 +247,10 @@ void appTest(
|
||||
WidgetTesterCallback callback, {
|
||||
bool? skip,
|
||||
Map startUpParams = const {},
|
||||
dynamic tags,
|
||||
}) {
|
||||
testWidgets(description, skip: skip, (WidgetTester tester) async {
|
||||
await tester.startUp(startUpParams);
|
||||
await callback(tester);
|
||||
});
|
||||
}, tags: tags);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user