diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index 47e79b3f8..2568cd211 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -35,8 +35,6 @@ public class PatrolJUnitRunner extends AndroidJUnitRunner { public PatrolAppServiceClient patrolAppServiceClient; private Map dartTestCaseSkipMap = new HashMap<>(); - private String spaceReplacement = "__"; - @Override protected boolean shouldWaitForActivitiesToComplete() { return false; @@ -117,9 +115,8 @@ public Object[] listDartTests() { List dartTestCases = ContractsExtensionsKt.listTestsFlat(dartTestGroup, ""); List dartTestCaseNamesList = new ArrayList<>(); for (DartGroupEntry dartTestCase : dartTestCases) { - final String testName = sanitizeTestCaseName(dartTestCase.getName()); - dartTestCaseSkipMap.put(testName, dartTestCase.getSkip()); - dartTestCaseNamesList.add(testName); + dartTestCaseSkipMap.put(dartTestCase.getName(), dartTestCase.getSkip()); + dartTestCaseNamesList.add(dartTestCase.getName()); } Object[] dartTestCaseNames = dartTestCaseNamesList.toArray(); Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestCaseNames)); @@ -145,7 +142,7 @@ public RunDartTestResponse runDartTest(String name) { try { Logger.INSTANCE.i(TAG + "Requested execution"); - RunDartTestResponse response = patrolAppServiceClient.runDartTest(originalTestCaseName(name)); + RunDartTestResponse response = patrolAppServiceClient.runDartTest(name); if (response.getResult() == Contracts.RunDartTestResponseResult.failure) { throw new AssertionError("Dart test failed: " + name + "\n" + response.getDetails()); } @@ -156,19 +153,4 @@ public RunDartTestResponse runDartTest(String name) { throw new RuntimeException(e); } } - - /** - * We need to remove whitespaces from test case name in order to make in compatible with Orchestrator 1.5.0. - * New requirement can be observed (here). - * */ - private String sanitizeTestCaseName(String name) { - return name.replace(" ", spaceReplacement); - } - - /** - * When calling test on dart side, we need to bring back original test case name. - * */ - private String originalTestCaseName(String name) { - return name.replace(spaceReplacement, " "); - } } diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index f5de74ea7..05f6330e5 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -82,5 +82,5 @@ flutter { } dependencies { - androidTestUtil 'androidx.test:orchestrator:1.4.2' + androidTestUtil 'androidx.test:orchestrator:1.5.1' }