matrix_app_tests library
The tests that the matrix of CI adds to the apps of the modules of
smf create, for tool/matrix.dart and for the app of several
providers of the fixture registry. No library of the binary imports it.
Constants
- homeTextsFile → const String
-
The path in an app of what the matrix writes for the tests of the home
module:
homeTexts, the texts of the screen of the module (HomeModule.texts), each by its name, in each language of the app, by the code of the language. The languages are those of the localization role of the app (LocalizationRole.localesIn), in its order, and English alone in an app without the role, whose screen has the English texts. - languagesAndTextsFile → const String
-
The path in an app of the languages and the texts of the app, which the
matrix writes for the test of the localization role:
appLanguages, the codes of the languages that the role chose, in their order;probedLanguages, the first of them, at most languagesProbeLimit, which the probe of the role goes through on a device;savedLanguageKey, the key of the role in the preferences of the app (LocalizationRole.localeKey); andappTextChecks, the texts of the app in the order of the role (LocalizationRole.textsIn), each with its name, such astext title of the module settings, a function that reads it throughcontext.l10nof the role, and what it reads in each language of the app: its translation, or its English text. - languageSettingFile → const String
-
The path in an app of what the matrix writes for the test of the setting
of the language:
languageSetting, the type of the widget of the entry that the template of the localization role gives the settings screen role;savedLanguageKey, the key of the role in the preferences of the app (LocalizationRole.localeKey);languageLabels, what the setting shows for each language of the app, by the code of the language, its name in that language (LocalizationRole.languageNames) or its code; andsettingTitlesanddeviceOptions, the title of the setting and its option of the languages of the device in each language of the app. - languagesProbeLimit → const int
- The most languages that the probe of the test of the localization role goes through on a device, the first of the app: for each, the screen settles once, and the probes of an app share a minute.
- messageLanguagesFile → const String
-
The path in an app of what the matrix writes for the test of the
language of the messages of Firebase Authentication that the
firebase_auth module keeps in its
app_tests/firebase_auth:messageLanguages, the codes of the languages in which the app asks Firebase for its messages, those of the app (LocalizationRole.localesIn), andchooseLanguage(), which chooses one of them for the app as its user does, or lets the app follow the device again. - onboardingStartScreenFile → const String
-
The path in an app of what the matrix writes for the tests of the
onboarding module:
startScreen, the type of the screen that the app starts on, which the app shows once the onboarding is finished. - onboardingTextsFile → const String
-
The path in an app of what the matrix writes for the test of the first
launch of the onboarding module:
onboardingTexts, the texts of the module (OnboardingModule.texts), each by its name, in each language of the app, by the code of the language. The languages are those of the localization role of the app (LocalizationRole.localesIn), in its order, and English alone in an app without the role, whose onboarding has the English texts. - registeredServicesFile → const String
-
The path in an app of the services that its modules register, which the
matrix writes for the test of the DI role:
registeredServices, the services in the order of their registration (DiGraph.ordered), each with its name, such asFixtureZone "utc", its lifetime, such aslazySingleton, and a function that resolves it withresolve()of the service locator of the role, by its type and its instance name. - routerWalkFile → const String
-
The path in an app of the locations that the walk of the test of the
router role goes to, which the matrix writes:
walkedLocations, the locations of the routes that need no values, each with the full name of its route (FacadeRoute.fullName), the location, created asconstfrom its class of the navigation of the role, and the type of the screen that the route shows. They are in the order of the routes of the app (RouterFacade.routes). - routerWalkLimit → const int
- The most locations that the walk of the test of the router role goes to, the first of routerWalkFile.
- settingsLanguagesFile → const String
-
The path in an app of what the matrix writes for the test of the
language of the settings screen that the settings module keeps in its
app_tests/settings:appLanguages, the codes of the languages of the app (LocalizationRole.localesIn), andchooseLanguage(), which chooses one of them for the app as its user does and completes once the app saved the choice. - settingsOfAppFile → const String
-
The path in an app of what the matrix writes for the tests of the group
and of the back button of the settings screen that the settings module
keeps in its
app_tests/settings:settingsEntryCount, how many entries the screen has, andsettingsInMainNavigation, whether the screen is a destination of the main navigation of the app. - settingsScreenFile → const String
-
The path in an app of what the matrix writes for the tests of the
settings screen role that the CLI keeps in its
app_tests/settings_screen_role:settingsLocation, the location of the route that the provider of the role names as the settings screen (SettingsScreenRole.screenIn), created asconstfrom its class of the navigation of the router role,settingsScreen, the type of the screen that the route shows, andsettingsEntries, the types of the widgets of the entries of the screen, in the order of the role (SettingsScreenRole.entriesIn). - signInOfAppFile → const String
-
The path in an app of what the matrix writes for the tests of the
sign-in module:
startScreen, the type of the screen that the app starts on, which the app shows once its user may see it;otherPages, a location of the app that is neither the one that the app starts on nor in the flow of a guard, with the type of its screen, or nothing in an app without such a route;settingsLocationandsettingsScreen, the location of the route that the provider of the settings screen role names as the settings screen and the type of that screen,settingsInMainNavigation, whether that screen is a destination of the main navigation of the app, andaccountEntry, the type of the widget of the entry that the module gives that screen; andsignInTexts, the texts of the module (SignInModule.texts), each by its name, in each language of the app, by the code of the language. The languages are those of the localization role of the app (LocalizationRole.localesIn), in its order, and English alone in an app without the role, whose screens have the English texts. - themeSettingFile → const String
-
The path in an app of what the matrix writes for the test of the entry
of the theme mode that the CLI keeps in its
app_tests/theme_setting:settingsLocation, the location of the route that the provider of the settings screen role names as the settings screen (SettingsScreenRole.screenIn), created asconstfrom its class of the navigation of the router role, andthemeModeEntry, the type of the widget of the entry that the template of the theme role gives the settings screen.
Functions
-
authRoleAppTest(
) → Future< MatrixAppTest> -
The test of the auth role that the CLI keeps in its
app_tests/auth_role, for the apps with the role, whichever module provides it, in each mode of the role. Each of its four files runs the start-up of the app once, withbootstrap(): -
diRoleAppTest(
{Set< DiLifetime> lifetimes = const {}}) → Future<MatrixAppTest> -
The test of the DI role that the CLI keeps in its
app_tests/di_role, for the apps with the role, whichever module provides it, whose modules register services, at least one of each oflifetimes: once the start-up of the app ran, every service resolves, a singleton and a lazy singleton to one instance;resetDependencies()removes them all, andregisterDependencies()registers them again. -
eventsRoleAppTest(
{bool among(MatrixApp app)?}) → Future< MatrixAppTest> -
The test of the events role that the CLI keeps in its
app_tests/events_role, for the apps with the role, whichever module provides it, thatamongaccepts, or all of them: once the start-up of the app ran, every listener of a type gets each event of that type once, in the order the events were fired; a listener of another type gets none of them, and no error; an event fired before the stream ofon<T>()is listened to is not in it, even afteron<T>()returned the stream; and a cancelled subscription gets no more events. -
languageSettingAppTest(
) → Future< MatrixAppTest> -
The test of the setting of the language, the entry that the template of
the localization role gives the settings screen, which the CLI keeps in
its
app_tests/language_setting, for the apps with the localization role and the settings screen role, whichever modules provide them. On the settings screen, the setting shows its title and, as the value of its row, the choice of the user, the languages of the device while the user chose none. A tap opens a sheet over the main navigation of the app, with an option for the languages of the device and one for each language of the app, by its name in that language, or its code, with the chosen one selected and checked. A tap on an option closes the sheet: the app and the texts of the setting are in the language of the option, which is saved underLocalizationRole.localeKey, and the option of the device removes what was saved. On a small phone with a large text size, the choice is below the title of the setting, and the sheet scrolls. A second file of the test starts the app on a device that prefers the last language of the app: the app and the setting follow the device, the setting names a choice of that same language that code makes, the next start restores the language that was saved, and the sheet has no option but those of the app and of the device. -
localizationRoleAppTest(
{bool among(MatrixApp app)?}) → Future< MatrixAppTest> -
The test of the localization role that the CLI keeps in its
app_tests/localization_role, for the apps with the role, whichever module provides it, thatamongaccepts, or all of them: the root of the app supports the languages of the app and no other, and has, for each of them, a delegate of each kind of localizations that supports it; once the user chose a language, the app is in it, and each text of the app reads in it, or in English when it has no translation into it; while the user chose none, the app and its texts are in the language that the device prefers among those of the app; a choice is saved underLocalizationRole.localeKey, and removed when the app follows the device again; and the next start,initPreferences()again, restores the language that was saved. -
preferencesRoleAppTest(
{bool among(MatrixApp app)?}) → Future< MatrixAppTest> -
The test of the preferences role that the CLI keeps in its
app_tests/preferences_role, for the apps with the role, whichever module provides it, thatamongaccepts, or all of them: once the start-up of the app opened the preferences, a value of each type is read back as it was saved, and asnullby the reads of the other types, which do not throw; a key that was removed has no value; a write replaces what its key had, a value of another type too; the preferences keep a copy of a list that they are given, and a read returns a copy of it; and the next start,initPreferences()again, reads what was saved and nothing that was removed. -
routerWalkAppTest(
{bool among(MatrixApp app)?}) → Future< MatrixAppTest> -
The test of the router role that the CLI keeps in its
app_tests/router_walk, for the apps with the role, whichever module provides it, thatamongaccepts, or all of them: it starts the app withmain()and goes to each location of the app that needs no values, at most routerWalkLimit, withgo()of the navigator of the role. Each must show the page named after its route on top of the innermost navigator on the screen, and the screen of the route, without anErrorWidgeton the screen or an error that Flutter reports. -
smfAppTests(
) → Future< MatrixAppTests> -
The tests that the matrix of the modules of
smf createadds to its apps, which the CLI and the packages of its modules keep in theirapp_tests, and the roles whose contract they check with every provider;tool/matrix.dartruns them in CI. -
themeRoleAppTest(
{bool among(MatrixApp app)?}) → Future< MatrixAppTest> -
The test of the theme role that the CLI keeps in its
app_tests/theme_role, for the apps with the role, whichever module provides it, thatamongaccepts, or all of them. Once the app started withmain(), it follows the device; a choice of a mode withappThemeMode.choose()reaches the rootMaterialApp, which takes the mode, and the screen below it gets the light theme of the provider in the light mode and its dark theme in the dark mode, the same colour schemes thatcreateLightTheme()andcreateDarkTheme()return for the context of the root. A choice is saved under the key of the role, as the name of the mode, and the next start,initPreferences()again, has the mode whose name the test wrote under that key.