WIP
This commit is contained in:
parent
a6dafe8b1e
commit
e4915e7c0e
|
@ -40,20 +40,20 @@ void main() {
|
|||
//init integration test
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// WelcomeTest.signInToSignUp();
|
||||
// WelcomeTest.signUpToSignIn();
|
||||
// //
|
||||
// AuthenticationTest.signIn();
|
||||
// AuthenticationTest.signUp();
|
||||
// AuthenticationTest.signOut();
|
||||
WelcomeTest.signInToSignUp();
|
||||
WelcomeTest.signUpToSignIn();
|
||||
|
||||
// ModularizationTest.switchLicense();
|
||||
// ModularizationTest.containLicense();
|
||||
//
|
||||
// MenuTest.navToEntries();
|
||||
// MenuTest.containEntries();
|
||||
// MenuTest.labels2AppbarConsistency();
|
||||
//
|
||||
// LocalsTest.setLocal();
|
||||
AuthenticationTest.signIn();
|
||||
AuthenticationTest.signUp();
|
||||
AuthenticationTest.signOut();
|
||||
|
||||
ModularizationTest.switchLicense();
|
||||
ModularizationTest.containLicense();
|
||||
|
||||
MenuTest.navToEntries();
|
||||
MenuTest.containEntries();
|
||||
MenuTest.labels2AppbarConsistency();
|
||||
|
||||
LocalsTest.setLocal();
|
||||
LocalsTest.unlinkLocal();
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ class AuthenticationTest {
|
|||
'Sign-In with erro@exemplo.com',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Authentication Test - Sign-In with error@exemplo.com');
|
||||
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||
final Map<String, String> credentials = {
|
||||
'emailTextFormField': 'erro@exemplo.com',
|
||||
|
@ -24,15 +26,20 @@ class AuthenticationTest {
|
|||
'Sign-In with email_app@exemplo.com',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Authentication Test - Sign-In with email_app@exemplo.com');
|
||||
|
||||
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||
final Map<String, String> credentials = {
|
||||
'emailTextFormField': 'email_app@exemplo.com',
|
||||
'passwordTextFormField': '12345678',
|
||||
};
|
||||
|
||||
await _unlogged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await _navigateToSignIn($);
|
||||
await _auth(credentials, $, throwsException);
|
||||
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
},
|
||||
);
|
||||
|
@ -43,6 +50,9 @@ class AuthenticationTest {
|
|||
'Sign Up - credenciais já registradas',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Authentication Test - Sign-Up: credenciais já registradas');
|
||||
|
||||
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||
final Map<String, String> credentials = {
|
||||
'nameTextFormField': 'app',
|
||||
|
@ -61,6 +71,9 @@ class AuthenticationTest {
|
|||
'Sign Up - credenciais novas',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester
|
||||
.printToConsole('Authentication Test - Sign-Up: credenciais novas');
|
||||
|
||||
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||
final name = _generateRandomString(7);
|
||||
final email = '$name@example.com';
|
||||
|
@ -87,16 +100,25 @@ class AuthenticationTest {
|
|||
'Deslogar da Conta',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Authentication Test - Sign-Out: Deslogar da Conta');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
await $.pumpWidget(const App());
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
await $(Icons.menu_rounded).tap();
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
|
||||
await $(Icons.menu_rounded) //
|
||||
.waitUntilVisible()
|
||||
.tap();
|
||||
|
||||
await $.waitUntilVisible($(MenuListView));
|
||||
|
||||
await $(Icons.exit_to_app)
|
||||
.waitUntilVisible()
|
||||
.tap(settlePolicy: SettlePolicy.trySettle);
|
||||
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
},
|
||||
);
|
||||
|
|
|
@ -6,6 +6,8 @@ class LocalsTest {
|
|||
'Selecionar um local disponível', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Locals Test - Selecionar um local disponível');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
|
@ -44,88 +46,79 @@ class LocalsTest {
|
|||
}
|
||||
|
||||
static Future unlinkLocal() async {
|
||||
// patrolWidgetTest('Desvincular do local selecionado', //
|
||||
// (PatrolTester tester) async {
|
||||
// $ = tester;
|
||||
// await _logged();
|
||||
// await $.pumpWidgetAndSettle(const App());
|
||||
// await $.waitUntilVisible($(MenuStaggeredView));
|
||||
// Future.delayed(const Duration(milliseconds: 500));
|
||||
//
|
||||
// final PatrolFinder gridView = await $(GridView) //
|
||||
// .waitUntilVisible();
|
||||
// final PatrolFinder entries = await $(gridView)
|
||||
// .$(ButtonMenuItem) //
|
||||
// .waitUntilVisible();
|
||||
//
|
||||
// await $.pumpAndSettle();
|
||||
// expect(entries, findsWidgets);
|
||||
// final PatrolFinder settings = await $(gridView) //
|
||||
// .$(Icons.settings)
|
||||
// .waitUntilVisible();
|
||||
// expect(settings, findsOneWidget);
|
||||
//
|
||||
// await $(settings).tap();
|
||||
//
|
||||
// final PatrolFinder unlinkButton = await $(Symbols.digital_out_of_home) //
|
||||
// .waitUntilVisible();
|
||||
// expect(unlinkButton, findsOneWidget);
|
||||
// await $(unlinkButton).tap();
|
||||
//
|
||||
// await $('Sim') //
|
||||
// .waitUntilVisible()
|
||||
// .tap(settlePolicy: SettlePolicy.noSettle);
|
||||
//
|
||||
// await $.pump();
|
||||
// await $.pump(const Duration(seconds: 1));
|
||||
// await $.pump();
|
||||
//
|
||||
// final PatrolFinder bottomSheetFinder =
|
||||
// await $(BottomArrowLinkedLocalsComponentWidget) //
|
||||
// .waitUntilVisible();
|
||||
//
|
||||
// await $.pump(const Duration(seconds: 1));
|
||||
// expect(bottomSheetFinder, findsOneWidget);
|
||||
// await $.pump(const Duration(seconds: 1));
|
||||
//
|
||||
// await $.pump(const Duration(seconds: 1));
|
||||
// final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
|
||||
// .$(ListView)
|
||||
// .waitUntilVisible();
|
||||
//
|
||||
// expect(listViewFinder, findsOneWidget);
|
||||
//
|
||||
// await $.pump(const Duration(seconds: 1));
|
||||
//
|
||||
// final PatrolFinder entriesFinder = await $(listViewFinder)
|
||||
// .$(CardItemTemplateComponentWidget)
|
||||
// .waitUntilVisible();
|
||||
//
|
||||
// expect(entriesFinder, findsWidgets);
|
||||
// await Future.delayed(const Duration(milliseconds: 500));
|
||||
// return;
|
||||
// });
|
||||
patrolWidgetTest('Desvincular do local selecionado', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Locals Test - Desvincular do local selecionado');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
final PatrolFinder gridView = await $(GridView) //
|
||||
.waitUntilVisible();
|
||||
final PatrolFinder entries = await $(gridView)
|
||||
.$(ButtonMenuItem) //
|
||||
.waitUntilVisible();
|
||||
|
||||
await $.pumpAndSettle();
|
||||
expect(entries, findsWidgets);
|
||||
final PatrolFinder settings = await $(gridView) //
|
||||
.$(Icons.settings)
|
||||
.waitUntilVisible();
|
||||
expect(settings, findsOneWidget);
|
||||
|
||||
await $(settings).tap();
|
||||
|
||||
final PatrolFinder unlinkButton = await $(Symbols.digital_out_of_home) //
|
||||
.waitUntilVisible();
|
||||
expect(unlinkButton, findsOneWidget);
|
||||
await $(unlinkButton).tap();
|
||||
|
||||
await $('Sim') //
|
||||
.waitUntilVisible()
|
||||
.tap(settlePolicy: SettlePolicy.noSettle);
|
||||
|
||||
await $.pump();
|
||||
await $.pump(const Duration(seconds: 1));
|
||||
await $.pump();
|
||||
|
||||
final PatrolFinder bottomSheetFinder =
|
||||
await $(BottomArrowLinkedLocalsComponentWidget) //
|
||||
.waitUntilVisible();
|
||||
|
||||
await $.pump(const Duration(seconds: 1));
|
||||
expect(bottomSheetFinder, findsOneWidget);
|
||||
await $.pump(const Duration(seconds: 1));
|
||||
|
||||
await $.pump(const Duration(seconds: 1));
|
||||
final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
|
||||
.$(ListView)
|
||||
.waitUntilVisible();
|
||||
|
||||
expect(listViewFinder, findsOneWidget);
|
||||
|
||||
await $.pump(const Duration(seconds: 1));
|
||||
|
||||
final PatrolFinder entriesFinder = await $(listViewFinder)
|
||||
.$(CardItemTemplateComponentWidget)
|
||||
.waitUntilVisible();
|
||||
|
||||
expect(entriesFinder, findsWidgets);
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return;
|
||||
});
|
||||
|
||||
patrolWidgetTest(
|
||||
'Vincular um local desvinculado', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Locals Test - Vincular um local desvinculado');
|
||||
|
||||
await _logged(false);
|
||||
await $.pumpWidget(const App());
|
||||
|
||||
final loc = ff.FFLocalizations.of(navigatorKey.currentContext!);
|
||||
|
||||
//
|
||||
// await $.waitUntilVisible($(MenuStaggeredView));
|
||||
// await $.waitUntilVisible($(LocalProfileComponentWidget));
|
||||
//
|
||||
// final PatrolFinder profileFinder =
|
||||
// $(#AsyncLocalProfileComponentWidget_InkWell);
|
||||
// expect(profileFinder, findsOneWidget);
|
||||
//
|
||||
// await $(profileFinder).tap();
|
||||
// await $.pump(const Duration(milliseconds: 500));
|
||||
|
||||
final PatrolFinder bottomSheetFinder =
|
||||
await $(BottomArrowLinkedLocalsComponentWidget) //
|
||||
.waitUntilVisible();
|
||||
|
@ -145,9 +138,8 @@ class LocalsTest {
|
|||
|
||||
if (entriesFinder.evaluate().isNotEmpty) {
|
||||
await $(entriesFinder.first).waitUntilVisible().tap();
|
||||
final String accept =
|
||||
loc.getVariableText(enText: 'Yes', ptText: 'Sim');
|
||||
await $(accept).waitUntilVisible().tap();
|
||||
|
||||
await $(#AcceptOptionKey).waitUntilVisible().tap();
|
||||
}
|
||||
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
|
|
@ -6,6 +6,9 @@ class MenuTest {
|
|||
'As labels dos menuItems correspondem aos títulos das AppBars?', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Menu Test - As labels dos menuItems correspondem aos títulos das AppBars?');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
|
@ -54,6 +57,7 @@ class MenuTest {
|
|||
'HomeMenu contém seus itens?', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Menu Test - HomeMenu contém seus itens?');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
|
@ -94,6 +98,7 @@ class MenuTest {
|
|||
'DrawerMenu contém seus itens?', //
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Menu Test - DrawerMenu contém seus itens?');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
|
@ -141,6 +146,7 @@ class MenuTest {
|
|||
'Navegação entre items do Menu',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Menu Test - Navegação entre items do Menu');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
|
|
|
@ -5,6 +5,9 @@ class ModularizationTest {
|
|||
patrolWidgetTest('Os modulos de licença está sendo processados?',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole(
|
||||
'Modularization Test - Os modulos de licença está sendo processados?');
|
||||
|
||||
await _logged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
|
@ -31,6 +34,8 @@ class ModularizationTest {
|
|||
'Licença está sendo atualizada?',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Licença está sendo atualizada?');
|
||||
|
||||
await _logged();
|
||||
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
|
|
|
@ -49,12 +49,12 @@ Future<void> _unlogged() async {
|
|||
}
|
||||
|
||||
Future<void> _navigateToSignIn(PatrolTester $) async {
|
||||
final signInButton = $(#toggleSignInPage);
|
||||
final signInButton = $(#toggleSignInPage).waitUntilVisible();
|
||||
await signInButton.tap();
|
||||
}
|
||||
|
||||
Future<void> _navigateToSignUp(PatrolTester $) async {
|
||||
final signUpButton = $(#toggleSignUpPage);
|
||||
final signUpButton = $(#toggleSignUpPage).waitUntilVisible();
|
||||
await signUpButton.tap();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ class WelcomeTest {
|
|||
'Sign-In to Sign-Up',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Welcome Test - Sign-In to Sign-Up');
|
||||
await _unlogged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await _navigateToSignIn($);
|
||||
|
@ -19,6 +20,7 @@ class WelcomeTest {
|
|||
'Sign-Up to Sign-In',
|
||||
(PatrolTester tester) async {
|
||||
$ = tester;
|
||||
$.tester.printToConsole('Welcome Test - Sign-Up to Sign-In');
|
||||
await _unlogged();
|
||||
await $.pumpWidgetAndSettle(const App());
|
||||
await _navigateToSignUp($);
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'qr_code_pass_key_template_component_model.dart';
|
||||
|
||||
export 'qr_code_pass_key_template_component_model.dart';
|
||||
|
||||
class QrCodePassKeyTemplateComponentWidget extends StatefulWidget {
|
||||
|
|
|
@ -390,6 +390,7 @@ String formatNumber(
|
|||
}
|
||||
|
||||
DateTime get getCurrentTimestamp => DateTime.now();
|
||||
|
||||
DateTime dateTimeFromSecondsSinceEpoch(int seconds) {
|
||||
return DateTime.fromMillisecondsSinceEpoch(seconds * 1000);
|
||||
}
|
||||
|
@ -400,8 +401,11 @@ extension DateTimeConversionExtension on DateTime {
|
|||
|
||||
extension DateTimeComparisonOperators on DateTime {
|
||||
bool operator <(DateTime other) => isBefore(other);
|
||||
|
||||
bool operator >(DateTime other) => isAfter(other);
|
||||
|
||||
bool operator <=(DateTime other) => this < other || isAtSameMomentAs(other);
|
||||
|
||||
bool operator >=(DateTime other) => this > other || isAtSameMomentAs(other);
|
||||
}
|
||||
|
||||
|
@ -457,14 +461,18 @@ Rect? getWidgetBoundingBox(BuildContext context) {
|
|||
}
|
||||
|
||||
bool get isAndroid => !kIsWeb && Platform.isAndroid;
|
||||
|
||||
bool get isiOS => !kIsWeb && Platform.isIOS;
|
||||
|
||||
bool get isWeb => kIsWeb;
|
||||
|
||||
const kBreakpointSmall = 479.0;
|
||||
const kBreakpointMedium = 767.0;
|
||||
const kBreakpointLarge = 991.0;
|
||||
|
||||
bool isMobileWidth(BuildContext context) =>
|
||||
MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||
|
||||
bool responsiveVisibility({
|
||||
required BuildContext context,
|
||||
bool phone = true,
|
||||
|
@ -493,6 +501,7 @@ const kTextValidatorWebsiteRegex =
|
|||
|
||||
extension FFTextEditingControllerExt on TextEditingController? {
|
||||
String get text => this == null ? '' : this!.text;
|
||||
|
||||
set text(String newText) => this?.text = newText;
|
||||
}
|
||||
|
||||
|
@ -574,6 +583,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
|||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
key: ValueKey<String>('AlertDialogKey'),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
title: Text(title,
|
||||
style: TextStyle(
|
||||
|
@ -593,6 +603,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
FFButtonWidget(
|
||||
key: ValueKey<String>('RejectOptionKey'),
|
||||
onPressed: () => context.pop(), //Navigator.pop(context),
|
||||
options: FFButtonOptions(
|
||||
width: MediaQuery.of(context).size.width * 0.3,
|
||||
|
@ -615,6 +626,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
|||
),
|
||||
),
|
||||
FFButtonWidget(
|
||||
key: ValueKey<String>('AcceptOptionKey'),
|
||||
onPressed: () async {
|
||||
action();
|
||||
},
|
||||
|
@ -707,6 +719,7 @@ extension StatefulWidgetExtensions on State<StatefulWidget> {
|
|||
// For iOS 16 and below, set the status bar color to match the app's theme.
|
||||
// https://github.com/flutter/flutter/issues/41067
|
||||
Brightness? _lastBrightness;
|
||||
|
||||
void fixStatusBarOniOS16AndBelow(BuildContext context) {
|
||||
if (!isiOS) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue