Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable TestWeChatPay #9348

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import com.stripe.android.paymentsheet.example.playground.settings.CustomerSetti
import com.stripe.android.paymentsheet.example.playground.settings.CustomerType
import com.stripe.android.paymentsheet.example.playground.settings.SupportedPaymentMethodsSettingsDefinition
import com.stripe.android.test.core.TestParameters
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith

@Ignore("Currently flaky. Let's investigate why.")
@RunWith(AndroidJUnit4::class)
internal class TestWeChatPay : BasePlaygroundTest() {
private val testParameters = TestParameters.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,14 @@ internal class PlaygroundTestDriver(
.text(testParameters.isSetupMode),
className = "android.widget.TextView",
device = device
) {}.click()
) {
override fun click() {
if (testParameters.paymentMethodCode == "wechat_pay") {
wait(5000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use a compose.waitUntil here instead of a hard-coded delay?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you do this, then maybe you could just unconditionally add this, instead of having to add it just for wechat pay. And then we won't see issues like this for other LPMs in the future (if it started happening for other LPMs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because the web view isn't compose based

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense. Do we want to add a potentially unnecessary delay for all e2e test though?

}
super.click()
}
}.click()
Log.e("Stripe", "Fail authorization was a text view not a button this time")
}
}
Expand Down
Loading