Test go to restore sentance generation

This commit is contained in:
poka 2021-04-24 20:27:18 +02:00
parent a85229048c
commit e8aaa0e2c0
16 changed files with 106 additions and 58 deletions

View File

@ -25,7 +25,7 @@ class CommonElements {
);
}
Widget bubbleSpeakRich(List<TextSpan> text) {
Widget bubbleSpeakRich(List<TextSpan> text, {Key textKey}) {
return Bubble(
padding: BubbleEdges.all(18),
elevation: 5,
@ -33,13 +33,14 @@ class CommonElements {
margin: BubbleEdges.fromLTRB(10, 0, 20, 10),
// nip: BubbleNip.leftTop,
child: RichText(
key: textKey,
text: TextSpan(
style: TextStyle(
fontSize: 18.0,
color: Colors.black,
),
children: text,
)),
style: TextStyle(
fontSize: 18.0,
color: Colors.black,
),
children: text,
)),
);
}

View File

@ -31,6 +31,7 @@ class NoKeyChainScreen extends StatelessWidget {
child: Material(
color: Color(0xffFFD58D), // button color
child: InkWell(
key: Key('goStep1'),
splashColor: Color(0xffD28928), // inkwell color
child: Padding(
padding: EdgeInsets.all(8),

View File

@ -22,8 +22,8 @@ class OnboardingStepOne extends StatelessWidget {
common.onboardingProgressBar(
context, 'Nouveau portefeuilles', progress),
common.bubbleSpeak(
"Il semblerait que vous nayez pas encore de trousseau.\n\nUn trousseau vous permet de gérer un ou plusieurs portefeuilles.",
),
"Il semblerait que vous nayez pas encore de trousseau.\n\nUn trousseau vous permet de gérer un ou plusieurs portefeuilles.",
textKey: Key('step1')),
SizedBox(height: 90),
Image.asset(
'assets/onBoarding/keys-and-wallets-horizontal.png',
@ -36,6 +36,7 @@ class OnboardingStepOne extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep2'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -21,7 +21,9 @@ class OnboardingStepTwelve extends StatelessWidget {
common.onboardingProgressBar(
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Si un jour vous changez de téléphone, votre code secret sera différent, mais il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau."),
"Si un jour vous changez de téléphone, votre code secret sera différent, mais il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau.",
textKey: Key('step10'),
),
SizedBox(height: 10),
Image.asset(
'assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png',
@ -34,6 +36,7 @@ class OnboardingStepTwelve extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep11'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -35,17 +35,20 @@ class OnboardingStepThirteen extends StatelessWidget {
}),
common.onboardingProgressBar(
context, 'Ma phrase de restauration', progress),
common.bubbleSpeakRich(<TextSpan>[
TextSpan(
text:
"Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé "),
TextSpan(
text: 'à chaque fois',
style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(
text:
" que vous voudrez effectuer un paiement sur cet appareil."),
]),
common.bubbleSpeakRich(
<TextSpan>[
TextSpan(
text:
"Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé "),
TextSpan(
text: 'à chaque fois',
style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(
text:
" que vous voudrez effectuer un paiement sur cet appareil."),
],
textKey: Key('step11'),
),
SizedBox(height: 100),
Container(
child: Stack(
@ -97,6 +100,7 @@ class OnboardingStepThirteen extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep12'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -42,7 +42,9 @@ class OnboardingStepFourteen extends StatelessWidget {
common.onboardingProgressBar(
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Avez-vous bien mémorisé votre code secret ?\n\nVérifions ça ensemble !\n\nTapez votre code secret dans le champ ci-dessous (après cest fini, promis-juré-gecko)."),
"Avez-vous bien mémorisé votre code secret ?\n\nVérifions ça ensemble !\n\nTapez votre code secret dans le champ ci-dessous (après cest fini, promis-juré-gecko).",
textKey: Key('step12'),
),
SizedBox(height: isTall ? 80 : 10),
pinForm(context, _walletOptions, _pinLenght, 1, 3)
]),

View File

@ -21,6 +21,7 @@ class OnboardingStepFiveteen extends StatelessWidget {
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Top !\n\nVotre trousseau de clef et votre portefeuille ont été créés avec un immense succès.\n\nFélicitations !",
textKey: Key('step13'),
),
SizedBox(height: isTall ? 20 : 10),
Image.asset(
@ -34,6 +35,7 @@ class OnboardingStepFiveteen extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goWalletHome'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -24,6 +24,7 @@ class OnboardingStepTwo extends StatelessWidget {
context, 'Nouveau portefeuilles', progress),
common.bubbleSpeak(
"Un trousseau est créé à partir dune phrase de restauration.",
textKey: Key('step2'),
),
SizedBox(height: 70),
Image.asset(
@ -35,6 +36,7 @@ class OnboardingStepTwo extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep3'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -22,6 +22,7 @@ class OnboardingStepFor extends StatelessWidget {
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Si un jour vous changez de téléphone, il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau.",
textKey: Key('step3'),
),
SizedBox(height: isTall ? 15 : 0),
// Row(children: <Widget>[
@ -40,6 +41,7 @@ class OnboardingStepFor extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep4'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -22,6 +22,7 @@ class OnboardingStepFive extends StatelessWidget {
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Par contre, attention :\n\nDans une blockchain, il ny a pas de procédure de récupération de trousseau.\n\nSi vous perdez votre phrase de restauration, je ne pourrai pas vous la communiquer, et vous ne pourrez donc plus jamais accéder à votre compte.",
textKey: Key('step4'),
),
SizedBox(height: isTall ? 30 : 10),
Image.asset(
@ -35,6 +36,7 @@ class OnboardingStepFive extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep5'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -30,6 +30,7 @@ class OnboardingStepSeven extends StatelessWidget {
text:
"afin de pouvoir noter votre phrase de restauration."),
],
textKey: Key('step5'),
),
Expanded(
child: Align(
@ -52,6 +53,7 @@ class OnboardingStepSeven extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep6'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -23,6 +23,7 @@ class OnboardingStepEight extends StatelessWidget {
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Jai généré votre phrase de restauration !\nTâchez de la garder bien secrète, car elle permet à quiconque la connaît daccéder à tous vos portefeuilles.",
textKey: Key('step6'),
),
SizedBox(height: isTall ? 61 : 31),
// SizedBox(height: 30),
@ -35,6 +36,7 @@ class OnboardingStepEight extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep7'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -29,6 +29,7 @@ class OnboardingStepNine extends StatelessWidget {
context, 'Ma phrase de restauration', progress),
common.bubbleSpeak(
"Cest le moment de noter votre phrase !",
textKey: Key('step7'),
long: 60,
),
SizedBox(height: isTall ? 100 : 70),
@ -71,6 +72,7 @@ class OnboardingStepNine extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep8'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -46,19 +46,22 @@ class OnboardingStepTen extends StatelessWidget {
child: Column(children: <Widget>[
common.onboardingProgressBar(
context, 'Valider ma phrase de restauration', progress),
common.bubbleSpeakRich(<TextSpan>[
TextSpan(
text:
"Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le ",
style: TextStyle(fontSize: 16 * ratio)),
TextSpan(
text: '${_generateWalletProvider.nbrWord + 1}ème mot',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 16 * ratio)),
TextSpan(
text: " de votre phrase de restauration :",
style: TextStyle(fontSize: 16 * ratio)),
]),
common.bubbleSpeakRich(
<TextSpan>[
TextSpan(
text:
"Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le ",
style: TextStyle(fontSize: 16 * ratio)),
TextSpan(
text: '${_generateWalletProvider.nbrWord + 1}ème mot',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 16 * ratio)),
TextSpan(
text: " de votre phrase de restauration :",
style: TextStyle(fontSize: 16 * ratio)),
],
textKey: Key('step8'),
),
// LayoutBuilder(builder: (builder, constraints) {
// // 2
@ -154,6 +157,7 @@ class OnboardingStepTen extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep9'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -20,15 +20,18 @@ class OnboardingStepEleven extends StatelessWidget {
child: Column(children: <Widget>[
common.onboardingProgressBar(
context, 'Ma phrase de restauration', progress),
common.bubbleSpeakRich(<TextSpan>[
TextSpan(text: "Super !\n\nJe vais maintenant créer votre "),
TextSpan(
text: 'code secret.',
style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(
text:
" \n\nVotre code secret chiffre votre trousseau de clefs, ce qui le rend inutilisable par dautres, par exemple si vous perdez votre téléphone ou si on vous le vole."),
]),
common.bubbleSpeakRich(
<TextSpan>[
TextSpan(text: "Super !\n\nJe vais maintenant créer votre "),
TextSpan(
text: 'code secret.',
style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(
text:
" \n\nVotre code secret chiffre votre trousseau de clefs, ce qui le rend inutilisable par dautres, par exemple si vous perdez votre téléphone ou si on vous le vole."),
],
textKey: Key('step8'),
),
SizedBox(height: isTall ? 50 : 10),
Image.asset(
'assets/onBoarding/treasure-chest-gecko-souligne.png',
@ -41,6 +44,7 @@ class OnboardingStepEleven extends StatelessWidget {
width: 400,
height: 62,
child: ElevatedButton(
key: Key('goStep10'),
style: ElevatedButton.styleFrom(
elevation: 5,
primary: Color(0xffD28928),

View File

@ -26,23 +26,37 @@ void main() {
}
});
test('Open wallets management - OnBoarding', () async {
await driver.runUnsynchronized(() async {
// First, tap the button manage wallets
await driver.tap(manageWalletsFinder);
test('OnBoarding - Open wallets management', (
{timeout: const Duration(seconds: 2)}) async {
// await driver.runUnsynchronized(() async { // Needed if we want to manage async drivers
await driver.tap(manageWalletsFinder);
// Get the SerializableFinder for text widget with key 'textOnboarding'
SerializableFinder textOnboarding = find.byValueKey(
'textOnboarding',
);
// Get the SerializableFinder for text widget with key 'textOnboarding'
SerializableFinder textOnboarding = find.byValueKey(
'textOnboarding',
);
print(
'####################################################################');
print(
'####################################################################');
// Verify onboarding is starting, with text
expect(await driver.getText(textOnboarding),
"Je ne connais pour linstant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant.");
});
// Verify onboarding is starting, with text
expect(await driver.getText(textOnboarding),
"Je ne connais pour linstant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant.");
});
test('OnBoarding - Go to create restore sentance', (
{timeout: const Duration(seconds: 5)}) async {
await driver.tap(find.byValueKey('goStep1'));
await driver.tap(find.byValueKey('goStep2'));
await driver.tap(find.byValueKey('goStep3'));
await driver.tap(find.byValueKey('goStep4'));
await driver.tap(find.byValueKey('goStep5'));
expect(
await driver.getText(find.byValueKey(
'step5',
)),
"Munissez-vous d'un papier et dun crayon\nafin de pouvoir noter votre phrase de restauration.");
});
});
}