chore: Maestro restructure, remove Marionette, add Makefile e2e commands

This commit is contained in:
2026-02-26 16:07:43 +05:30
parent c69949abf4
commit fd43494bd4
25 changed files with 289 additions and 314 deletions

View File

@@ -11,6 +11,7 @@ class UiTextField extends StatelessWidget {
const UiTextField({
super.key,
this.semanticsIdentifier,
this.label,
this.hintText,
this.onChanged,
@@ -29,6 +30,8 @@ class UiTextField extends StatelessWidget {
this.onTap,
this.validator,
});
/// Optional semantics identifier for E2E testing (e.g. Maestro).
final String? semanticsIdentifier;
/// The label text to display above the text field.
final String? label;
@@ -90,7 +93,9 @@ class UiTextField extends StatelessWidget {
Text(label!, style: UiTypography.body4m.textSecondary),
const SizedBox(height: UiConstants.space1),
],
TextFormField(
Builder(
builder: (BuildContext context) {
final Widget field = TextFormField(
controller: controller,
onChanged: onChanged,
keyboardType: keyboardType,
@@ -113,6 +118,15 @@ class UiTextField extends StatelessWidget {
? Icon(suffixIcon, size: 20, color: UiColors.iconSecondary)
: suffix,
),
);
if (semanticsIdentifier != null) {
return Semantics(
identifier: semanticsIdentifier!,
child: field,
);
}
return field;
},
),
],
);

View File

@@ -52,6 +52,7 @@ class _ClientSignInFormState extends State<ClientSignInForm> {
children: <Widget>[
// Email Field
UiTextField(
semanticsIdentifier: 'sign_in_email',
label: i18n.email_label,
hintText: i18n.email_hint,
controller: _emailController,
@@ -61,6 +62,7 @@ class _ClientSignInFormState extends State<ClientSignInForm> {
// Password Field
UiTextField(
semanticsIdentifier: 'sign_in_password',
label: i18n.password_label,
hintText: i18n.password_hint,
controller: _passwordController,

View File

@@ -70,6 +70,7 @@ class _ClientSignUpFormState extends State<ClientSignUpForm> {
children: <Widget>[
// Company Name Field
UiTextField(
semanticsIdentifier: 'sign_up_company',
label: i18n.company_label,
hintText: i18n.company_hint,
controller: _companyController,
@@ -79,6 +80,7 @@ class _ClientSignUpFormState extends State<ClientSignUpForm> {
// Email Field
UiTextField(
semanticsIdentifier: 'sign_up_email',
label: i18n.email_label,
hintText: i18n.email_hint,
controller: _emailController,
@@ -89,6 +91,7 @@ class _ClientSignUpFormState extends State<ClientSignUpForm> {
// Password Field
UiTextField(
semanticsIdentifier: 'sign_up_password',
label: i18n.password_label,
hintText: i18n.password_hint,
controller: _passwordController,
@@ -108,6 +111,7 @@ class _ClientSignUpFormState extends State<ClientSignUpForm> {
// Confirm Password Field
UiTextField(
semanticsIdentifier: 'sign_up_confirm_password',
label: i18n.confirm_password_label,
hintText: i18n.confirm_password_hint,
controller: _confirmPasswordController,

View File

@@ -1,4 +1,4 @@
// ignore_for_file: always_specify_types, depend_on_referenced_packages, dead_code, dead_null_aware_expression, unused_local_variable, unused_import, sort_constructors_first, prefer_final_fields, prefer_const_constructors, deprecated_member_use, implicit_call_tearoffs, implementation_imports
// ignore_for_file: always_specify_types, depend_on_referenced_packages, dead_code, dead_null_aware_expression, unused_local_variable, unused_import, sort_constructors_first, prefer_final_fields, prefer_const_constructors, deprecated_member_use, implicit_call_tearoffs, implementation_imports
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -75,10 +75,7 @@ class _OtpInputFieldState extends State<OtpInputField> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(6, (int index) {
return SizedBox(
width: 45,
height: 56,
child: TextField(
final TextField field = TextField(
controller: _controllers[index],
focusNode: _focusNodes[index],
keyboardType: TextInputType.number,
@@ -112,7 +109,16 @@ class _OtpInputFieldState extends State<OtpInputField> {
),
onChanged: (String value) =>
_onChanged(context: context, index: index, value: value),
),
);
return SizedBox(
width: 45,
height: 56,
child: index == 0
? Semantics(
identifier: 'staff_otp_input',
child: field,
)
: field,
);
}),
),

View File

@@ -82,17 +82,20 @@ class _PhoneInputFormFieldState extends State<PhoneInputFormField> {
),
const SizedBox(width: UiConstants.space2),
Expanded(
child: TextField(
controller: _controller,
keyboardType: TextInputType.phone,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly,
LengthLimitingTextInputFormatter(11),
],
decoration: InputDecoration(
hintText: t.staff_authentication.phone_input.hint,
child: Semantics(
identifier: 'staff_phone_input',
child: TextField(
controller: _controller,
keyboardType: TextInputType.phone,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly,
LengthLimitingTextInputFormatter(11),
],
decoration: InputDecoration(
hintText: t.staff_authentication.phone_input.hint,
),
onChanged: widget.onChanged,
),
onChanged: widget.onChanged,
),
),
],