From f412ed526f14fd3ee614f07ab90e98241dc804e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 20 Nov 2024 18:11:36 +0300 Subject: [PATCH 1/2] Remove ignoring e2eCreateOrderTest --- .../kotlin/com/woocommerce/android/e2e/tests/ui/OrdersUITest.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/tests/ui/OrdersUITest.kt b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/tests/ui/OrdersUITest.kt index 80f221c6580..f6b83aac465 100644 --- a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/tests/ui/OrdersUITest.kt +++ b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/tests/ui/OrdersUITest.kt @@ -20,7 +20,6 @@ import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest import org.json.JSONObject import org.junit.Before -import org.junit.Ignore import org.junit.Rule import org.junit.Test @@ -55,7 +54,6 @@ class OrdersUITest : TestBase() { @Retry(numberOfTimes = 1) @Test - @Ignore fun e2eCreateOrderTest() { val note = "Just a placeholder text" val ordersJSONArray = MocksReader().readOrderToArray() From e3a32352f1ba9df02ed918ccce0ab4c7c4950abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 20 Nov 2024 18:12:00 +0300 Subject: [PATCH 2/2] Fix failing e2eCreateOrderTest --- .../android/e2e/screens/orders/SingleOrderScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/screens/orders/SingleOrderScreen.kt b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/screens/orders/SingleOrderScreen.kt index 67f4fc349f2..7d5fa194892 100644 --- a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/screens/orders/SingleOrderScreen.kt +++ b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/e2e/screens/orders/SingleOrderScreen.kt @@ -6,6 +6,7 @@ import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.hasDescendant import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withParentIndex import androidx.test.espresso.matcher.ViewMatchers.withText import com.woocommerce.android.R import com.woocommerce.android.e2e.helpers.util.NestedScrollViewExtension @@ -43,7 +44,7 @@ class SingleOrderScreen : Screen(R.id.orderStatus_subtitle) { } fun assertOrderId(orderId: Int): SingleOrderScreen { - Espresso.onView(withId(R.id.toolbar)) + Espresso.onView(Matchers.allOf(withId(R.id.toolbar), withParentIndex(0))) .check(ViewAssertions.matches(hasDescendant(withText("Order #$orderId")))) .check(ViewAssertions.matches(isDisplayed())) return this