AuthTest class

Test helper class for authentication-related integration tests.

Provides high-level and low-level test methods for:

  • User registration (admin and non-admin)
  • Login/logout flows
  • Password change/reset
  • Tenant setup
  • Trial welcome handling
  • Payment/subscription flows

Constructors

AuthTest()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

changePassword(WidgetTester tester, {required String newPassword, required String confirmPassword}) Future<void>
Complete the password change form.
clearDemoData(WidgetTester tester) Future<void>
completeAuthenticationFlow(WidgetTester tester, {required String companyName, required Currency currency, bool demoData = false, int maxAttempts = 10}) Future<bool>
Complete the entire post-login authentication flow.
completeTenantSetup(WidgetTester tester, {required String companyName, required Currency currency, bool demoData = false}) Future<void>
Complete the tenant setup dialog.
createNewAdminAndCompany(WidgetTester tester, User user, Company company) Future<void>
Create a new admin user and company.
enterCompanyName(WidgetTester tester, String name) Future<void>
enterCurrency(WidgetTester tester, Currency currency) Future<void>
enterEmailAddress(WidgetTester tester, String emailAddress) Future<void>
enterFirstName(WidgetTester tester, String firstName) Future<void>
enterLastname(WidgetTester tester, String lastName) Future<void>
enterLoginName(WidgetTester tester, String loginName) Future<void>
enterPassword(WidgetTester tester, String password) Future<void>
gotoMainMenu(WidgetTester tester) Future<void>
handleTrialWelcome(WidgetTester tester) Future<bool>
Handle the trial welcome dialog if displayed.
hasErrorMessage(WidgetTester tester, String errorText) Future<bool>
Verify error message is displayed.
hasSuccessMessage(WidgetTester tester, String successText) Future<bool>
Verify success message is displayed.
hasValidationError(WidgetTester tester, String fieldKey) Future<bool>
Verify the form validation message is displayed.
isAuthenticated(WidgetTester tester) Future<bool>
Check if user is authenticated (dashboard visible).
isLoginFormDisplayed(WidgetTester tester) Future<bool>
Check if login form is displayed.
isPasswordChangeDisplayed(WidgetTester tester) Future<bool>
Check if password change form is displayed.
isTenantSetupDisplayed(WidgetTester tester) Future<bool>
Check if tenant setup dialog is displayed.
isTrialWelcomeDialogDisplayed(WidgetTester tester) Future<bool>
Check if TrialWelcome dialog (new flow) is displayed.
isTrialWelcomeDisplayed(WidgetTester tester) Future<bool>
Check if trial welcome dialog is displayed. Checks for both TrialWelcomeDialog (startTrial) and TrialWelcomeHelper (getStarted).
login(WidgetTester tester, String loginName, String password) Future<void>
Login with existing credentials.
loginIfRequired(WidgetTester tester, String loginName, String password) Future<void>
Login only if not already authenticated.
pressLogin(WidgetTester tester) Future<void>
pressLoginButton(WidgetTester tester) Future<void>
pressNewCompany(WidgetTester tester) Future<void>
registerNewAdmin(WidgetTester tester, {required String firstName, required String lastName, required String email}) Future<String>
Register a new admin user (opens registration, fills form).
requestPasswordReset(WidgetTester tester, {required String email}) Future<void>
Request password reset.
togglePasswordVisibility(WidgetTester tester) Future<void>
Toggle password visibility in login/password forms.
waitForDashboard(WidgetTester tester, {int maxSeconds = 10}) Future<void>
Wait for authentication to complete and reach dashboard.