From 1ec95b669519c59e34a0c40336933ff90da3c1ab Mon Sep 17 00:00:00 2001 From: Zhu Zhanyan Date: Wed, 13 Nov 2024 15:26:02 +0800 Subject: [PATCH] test(mobile): only tap congestion point if one exists in e2e_routing_test --- integration_test/e2e_routing_test.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration_test/e2e_routing_test.dart b/integration_test/e2e_routing_test.dart index 4b6e3e1..0d7ec54 100644 --- a/integration_test/e2e_routing_test.dart +++ b/integration_test/e2e_routing_test.dart @@ -55,6 +55,9 @@ void main() { // transition: home screen -> congestion rating screen final congestionRobot = CongestionRatingRobot(tester: tester); + // check at least one congestion point is listed + final nCongestionPoints = + await congestionRobot.countPrefixed(WidgetKeys.congestionPointPrefix); // check congestion markers are drawn for every congestion point // check at least one route step is shown final nRouteSteps = @@ -62,7 +65,9 @@ void main() { expect(nRouteSteps, greaterThan(0)); // tap congestion point to reveal visuals (graph, camera image view) for point - await congestionRobot.tapCongestionPoint(0); + if (nCongestionPoints > 0) { + await congestionRobot.tapCongestionPoint(0); + } }); }); }