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

[WIP] [UI Tests] PTR if Stats card is not loaded. #20448

Closed
wants to merge 9 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ package org.wordpress.android.e2e.pages
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.swipeDown
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers
import org.hamcrest.Matchers
import org.wordpress.android.R
import org.wordpress.android.support.WPSupportUtils
import org.wordpress.android.support.WPSupportUtils.isElementDisplayed
import org.wordpress.android.support.WPSupportUtils.waitForElementToBeDisplayedWithoutFailure
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel
import org.wordpress.android.util.StatsKeyValueData
import org.wordpress.android.util.StatsVisitsData
Expand Down Expand Up @@ -99,6 +102,13 @@ class StatsPage {
)
)
)

if (!isElementDisplayed(cardStructure)) {
cardStructure.perform(swipeDown());
}

waitForElementToBeDisplayedWithoutFailure(cardStructure)

cardStructure.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
return this
}
Expand Down
Loading