Last active
May 11, 2021 08:58
-
-
Save stoichoandreev/d9f737212113aed10af3c3af2d8e3844 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.sniper.bdd.robo.BaseRobot | |
import java.util.concurrent.TimeUnit | |
/** | |
* Use the method to run single UI test | |
* @param robot - Set your test robot (should extend BaseRobot) | |
* @param block - the block of code which needs to be executed in our test. Usually we need to place inside all steps for the test | |
* @return - TestRun data class instance, which includes the test name and the robot instance | |
*/ | |
fun <T: BaseRobot>RUN_UI_TEST( | |
robot: T, | |
block: TestRun<T>.() -> Unit | |
) : TestRun<T> { | |
val startTime = System.nanoTime() | |
println("*** UI TEST start ***") | |
val testRun = TestRun(robot, false) | |
block(testRun) | |
val difference = System.nanoTime() - startTime | |
println("*** time -> ${ TimeUnit.NANOSECONDS.toMillis(difference) } ms ***") | |
println("-----------------------------------------------------------------------------------------------") | |
return testRun | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment