diff --git a/common/src/main/java/com/progressive/kherkin/common/steps/actions/WaitSteps.kt b/common/src/main/java/com/progressive/kherkin/common/steps/actions/WaitSteps.kt new file mode 100644 index 0000000..f4a3fba --- /dev/null +++ b/common/src/main/java/com/progressive/kherkin/common/steps/actions/WaitSteps.kt @@ -0,0 +1,13 @@ +package com.progressive.kherkin.common.steps.actions + +import android.os.SystemClock +import com.progressive.kherkin.common.testcore.Gherkin +import com.progressive.kherkin.common.testcore.TimeoutConstants.EXTRA_LONG_TIMEOUT + +/** + * Waits for [timeoutInMillis] or a default of [EXTRA_LONG_TIMEOUT] milliseconds. Recommended to + * only use for debugging purposes. + */ +fun Gherkin.IWaitLong(timeoutInMillis: Long = EXTRA_LONG_TIMEOUT) { + SystemClock.sleep(timeoutInMillis) +} \ No newline at end of file diff --git a/espresso/src/main/java/com/progressive/kherkin/espresso/steps/actions/WaitSteps.kt b/espresso/src/main/java/com/progressive/kherkin/espresso/steps/actions/WaitSteps.kt index 972494c..420f797 100644 --- a/espresso/src/main/java/com/progressive/kherkin/espresso/steps/actions/WaitSteps.kt +++ b/espresso/src/main/java/com/progressive/kherkin/espresso/steps/actions/WaitSteps.kt @@ -130,14 +130,6 @@ fun Gherkin.IWaitToSeeAlert(timeoutInMillis: Long = EXTRA_LONG_TIMEOUT) { IShouldSeeAlert() } -/** - * Waits for [timeoutInMillis] or a default of [EXTRA_LONG_TIMEOUT] milliseconds. Recommended to - * only use for debugging purposes. - */ -fun Gherkin.IWaitLong(timeoutInMillis: Long = EXTRA_LONG_TIMEOUT) { - SystemClock.sleep(timeoutInMillis) -} - /** * Waits to see a view outside the context of the current activity with text containing * [expectedText] for [timeoutInMillis] or a default of [LONG_TIMEOUT] milliseconds and diff --git a/sampleapp/src/androidTest/java/com/progressive/sampleapp/tests/espresso/TestWaitSteps.kt b/sampleapp/src/androidTest/java/com/progressive/sampleapp/tests/espresso/TestWaitSteps.kt index d122da4..81d0ccc 100644 --- a/sampleapp/src/androidTest/java/com/progressive/sampleapp/tests/espresso/TestWaitSteps.kt +++ b/sampleapp/src/androidTest/java/com/progressive/sampleapp/tests/espresso/TestWaitSteps.kt @@ -1,9 +1,9 @@ package com.progressive.sampleapp.tests.espresso import androidx.test.espresso.matcher.ViewMatchers.withId +import com.progressive.kherkin.common.steps.actions.IWaitLong import com.progressive.kherkin.sampleapp.R import com.progressive.kherkin.espresso.steps.actions.ITouchButton -import com.progressive.kherkin.espresso.steps.actions.IWaitLong import com.progressive.kherkin.espresso.steps.actions.IWaitToDismissSharesheetContainingText import com.progressive.kherkin.espresso.steps.actions.IWaitToSeeTextOnCurrentScreen import com.progressive.kherkin.espresso.steps.actions.IWaitToSeeViewContainingTextOnCurrentScreen