Skip to content

Commit

Permalink
Merge branch 'main' into 546-playwright-refactoring-3
Browse files Browse the repository at this point in the history
  • Loading branch information
emiride committed Dec 18, 2024
2 parents ed53a5f + 9c1cb0e commit 4ef10d8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ netifas
netkey
nextest
Nodetool
NuFi
oapi
OCSP
Oleksandr
Expand Down
12 changes: 9 additions & 3 deletions catalyst_voices/apps/voices/integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:catalyst_voices/configs/bootstrap.dart';
import 'package:catalyst_voices/routes/routes.dart';
import 'package:catalyst_voices_models/catalyst_voices_models.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:go_router/go_router.dart';
import 'package:integration_test/integration_test.dart';
import 'package:patrol_finders/patrol_finders.dart';

Expand All @@ -11,12 +12,17 @@ import 'pageobject/spaces_drawer_page.dart';

void main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
late final GoRouter router;

setUpAll(() async {
router = buildAppRouter(initialLocation: const DiscoveryRoute().location);

await bootstrap(router: router);
});

patrolWidgetTest('Spaces drawer guest menu renders correctly',
(PatrolTester $) async {
final args =
await bootstrap(initialLocation: const DiscoveryRoute().location);
await $.pumpWidgetAndSettle(App(routerConfig: args.routerConfig));
await $.pumpWidgetAndSettle(App(routerConfig: router));
await $(DashboardPage.guestShortcutBtn).tap();
await $.pumpAndSettle();
await Future<void>.delayed(const Duration(seconds: 5));
Expand Down
22 changes: 15 additions & 7 deletions catalyst_voices/apps/voices/lib/configs/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,27 @@ Future<void> _doBootstrapAndRun(BootstrapWidgetBuilder builder) async {
await _runApp(app);
}

GoRouter buildAppRouter({
String? initialLocation,
}) {
return AppRouter.init(
initialLocation: initialLocation,
guards: const [
MilestoneGuard(),
],
);
}

/// Initializes the application before it can be run. Should setup all
/// the things which are necessary before the actual app is run,
/// either via [runApp] or injected into a test environment during
/// integration tests.
///
/// Initialization logic that is relevant for [runApp] scenario
/// only should be added to [_doBootstrapAndRun], not here.
Future<BootstrapArgs> bootstrap({String? initialLocation}) async {
Future<BootstrapArgs> bootstrap({
GoRouter? router,
}) async {
_loggingService
..level = kDebugMode ? Level.FINER : Level.OFF
..printLogs = kDebugMode;
Expand All @@ -94,12 +107,7 @@ Future<BootstrapArgs> bootstrap({String? initialLocation}) async {
// Key derivation needs to be initialized before it can be used
await CatalystKeyDerivation.init();

final router = AppRouter.init(
initialLocation: initialLocation,
guards: const [
MilestoneGuard(),
],
);
router ??= buildAppRouter();

Bloc.observer = AppBlocObserver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ walletConfigs.forEach((walletConfig) => {
walletConfig.extension.Name === "Lace",
"https://github.com/input-output-hk/catalyst-voices/issues/1190"
);
test.skip(
walletConfig.extension.Name === "Nufi",
"https://github.com/input-output-hk/catalyst-voices/issues/1190"
);
test.beforeAll(async () => {
browser = await restoreWallet(walletConfig);
await enableWallet(walletConfig, browser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const onboardYoroiWallet = async (
page: Page,
walletConfig: WalletConfig
): Promise<void> => {
/* cspell: disable */
await page.locator("#initialPage-tosAgreement-checkbox").check();
await page.locator("#initialPage-continue-button").click();
await page.locator("#mui-2").click();
Expand Down Expand Up @@ -32,6 +33,7 @@ export const onboardYoroiWallet = async (
await page.locator("#primaryButton").click();
await page.locator("#dialog-gotothewallet-button").click();
};
/* cspell: enable */

export const signYoroiData = async (
signTab: Page,
Expand Down

0 comments on commit 4ef10d8

Please sign in to comment.