Adding some documentation regarding

This commit is contained in:
Joakim Troëng 2023-12-04 15:28:07 +01:00
parent eb4e854ed5
commit 1e3c933902
10 changed files with 27 additions and 44 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -78,7 +78,7 @@ void main() {
var usbPivKey = _getCapabilityWidgetKey(true, 'PIV');
var pivChip = await _getCapabilityWidget(usbPivKey);
// find USB OTP capability
// find USB PIV capability
if (pivChip != null) {
expect(pivChip.selected, equals(true));
await tester.tap(find.byKey(usbPivKey));
@ -91,7 +91,7 @@ void main() {
}
await tester.openManagementScreen();
if (pivChip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect PIV to be enabled on the Key for this test
await tester.tap(find.byKey(usbPivKey));
await tester.shortWait();
await tester.tap(find.byKey(management_keys.saveButtonKey));
@ -107,11 +107,11 @@ void main() {
appTest('Toggle OATH', (WidgetTester tester) async {
await tester.openManagementScreen();
// find USB OTP capability
// find USB OATH capability
var usbOathKey = _getCapabilityWidgetKey(true, 'OATH');
var oathChip = await _getCapabilityWidget(usbOathKey);
if (oathChip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect OATH to be enabled on the Key for this test
expect(oathChip.selected, equals(true));
await tester.tap(find.byKey(usbOathKey));
await tester.shortWait();
@ -137,11 +137,11 @@ void main() {
appTest('Toggle OpenPGP', (WidgetTester tester) async {
await tester.openManagementScreen();
// find USB OTP capability
// find USB OPENPGP capability
var usbPgpKey = _getCapabilityWidgetKey(true, 'OpenPGP');
var pgpChip = await _getCapabilityWidget(usbPgpKey);
if (pgpChip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect OPENPGP to be enabled on the Key for this test
expect(pgpChip.selected, equals(true));
await tester.tap(find.byKey(usbPgpKey));
await tester.shortWait();
@ -167,11 +167,11 @@ void main() {
appTest('Toggle YubiHSM Auth', (WidgetTester tester) async {
await tester.openManagementScreen();
// find USB OTP capability
// find USB YubiHSM Auth capability
var usbHsmKey = _getCapabilityWidgetKey(true, 'YubiHSM Auth');
var hsmChip = await _getCapabilityWidget(usbHsmKey);
if (hsmChip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect YubiHSM Auth to be enabled on the Key for this test
expect(hsmChip.selected, equals(true));
await tester.tap(find.byKey(usbHsmKey));
await tester.shortWait();
@ -198,11 +198,11 @@ void main() {
appTest('Toggle FIDO U2F', (WidgetTester tester) async {
await tester.openManagementScreen();
// find USB OTP capability
// find USB FIDO U2F capability
var usbU2fKey = _getCapabilityWidgetKey(true, 'FIDO U2F');
var u2fChip = await _getCapabilityWidget(usbU2fKey);
if (u2fChip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect FIDO U2F to be enabled on the Key for this test
expect(u2fChip.selected, equals(true));
await tester.tap(find.byKey(usbU2fKey));
await tester.shortWait();
@ -228,11 +228,11 @@ void main() {
appTest('Toggle FIDO2', (WidgetTester tester) async {
await tester.openManagementScreen();
// find USB OTP capability
// find USB FIDO2 capability
var usbFido2Key = _getCapabilityWidgetKey(true, 'FIDO2');
var fido2Chip = await _getCapabilityWidget(usbFido2Key);
if (fido2Chip != null) {
// we expect OTP to be enabled on the Key for this test
// we expect FIDO2 to be enabled on the Key for this test
expect(fido2Chip.selected, equals(true));
await tester.tap(find.byKey(usbFido2Key));
await tester.shortWait();

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,11 +42,6 @@ String generateRandomName() {
return 'n${randomPadded()}';
}
String generateRandomSecret() {
final random = Random.secure();
return base64Encode(List.generate(10, (_) => random.nextInt(256)));
}
void main() {
var binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
@ -305,8 +300,8 @@ void main() {
var firstPassword = 'firstPassword';
var secondPassword = 'secondPassword';
var thirdPassword = 'thirdPassword';
appTest('Set first OATH password', (WidgetTester tester) async {
// await tester.resetOath();
appTest('Reset OATH', (WidgetTester tester) async {
await tester.resetOATH();
});
appTest('Set first OATH password', (WidgetTester tester) async {
// Sets a password for OATH

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -19,7 +19,10 @@ either be defined as an anvironment variable on execution, or in a CSV-file with
$ /yubioath-flutter/integration_test/test_res/resources/approved_serial_numbers.csv
This file is part of .gitignore, and should never be committed.
This file is part of .gitignore, and should never be committed. If you do not wish to add serial
numbers to a file like above, you can also initiate the test runs by expressing a dart-define:
$ flutter --dart-define=YA_TEST_APPROVED_KEY_SN=SN1,SN2,...,SNn test integration_test
=== Desktop
Running the tests for the CI environment:

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,21 +21,6 @@ import 'package:yubico_authenticator/piv/keys.dart';
import 'test_util.dart';
class Account {
final String? issuer;
final String name;
final String secret;
const Account({
this.issuer,
this.name = '',
this.secret = 'abcdefghabcdefgh',
});
@override
String toString() => '$issuer/$name';
}
extension PIVFunctions on WidgetTester {
/// Open the PIV Configuration
Future<void> configurePiv() async {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Yubico.
* Copyright (C) 2023 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.