Skip to content

Commit

Permalink
fix failing browserstack tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grodien committed Nov 11, 2024
1 parent 1550fbc commit dee27b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
33 changes: 14 additions & 19 deletions das_client/integration_test/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,20 @@ import 'auth/mqtt_client_user_connector.dart';
class IntegrationTestDI {
const IntegrationTestDI._();

static bool _initialized = false;

static Future<void> init(Flavor flavor) {
if (_initialized) {
return GetIt.I.allReady();
} else {
Fimber.i('Initialize integration test dependency injection');
GetIt.I.registerFlavor(flavor);
GetIt.I.registerTokenSpecProvider();
GetIt.I.registerOidcClient();
_registerIntegrationTestAuthenticator();
GetIt.I.registerSferaComponents();
GetIt.I.registerMqttComponent();

GetIt.I.unregister<MqttClientConnector>();
_registerMqttClientConnector();

_initialized = true;
}
static Future<void> init(Flavor flavor) async {
Fimber.i('Initialize integration test dependency injection');
await GetIt.I.reset();

GetIt.I.registerFlavor(flavor);
GetIt.I.registerTokenSpecProvider();
GetIt.I.registerOidcClient();
_registerIntegrationTestAuthenticator();
GetIt.I.registerSferaComponents();
GetIt.I.registerMqttComponent();

GetIt.I.unregister<MqttClientConnector>();
_registerMqttClientConnector();

return GetIt.I.allReady();
}

Expand Down
4 changes: 3 additions & 1 deletion das_client/integration_test/test/train_journey_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ void main() {
await tester.tap(primaryButton);

// wait for train journey to load
await tester.pumpAndSettle(const Duration(seconds: 1));
await tester.pumpAndSettle();

// check if station is present
expect(find.text('SO_W'), findsOneWidget);

await tester.pumpAndSettle();
});
});
}
4 changes: 2 additions & 2 deletions das_client/integration_test/test/train_search_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void main() {

await tester.enterText(trainNumberText, '');

await tester.pump(const Duration(seconds: 1));
await tester.pumpAndSettle();

// check that the primary button is disabled
var primaryButton = find.byWidgetPredicate((widget) => widget is SBBPrimaryButton).first;
Expand Down Expand Up @@ -169,7 +169,7 @@ void main() {

await tester.enterText(trainNumberText, '1234');

await tester.pump(const Duration(seconds: 1));
await tester.pumpAndSettle();

// check that the primary button is disabled
var primaryButton = find.byWidgetPredicate((widget) => widget is SBBPrimaryButton).first;
Expand Down

0 comments on commit dee27b3

Please sign in to comment.