Closed imgeopineda closed 4 months ago
We use MacBook Pro with M1 Max and MacStudio with M2 Ultra. It is not unusual for it to take 5 seconds or more in one action.
Shirates is very rich in features, but has limitation of performance in iOS. This limitation is due to the performance of the getPageSource function of the iOS Driver, and is caused by lack of efficient API of iOS to retrieve entire elements.
If you want your test faster in iOS, consider following items.
If you can reduce screen elements by reducing test data, that's the best way to deal this problem. Many cells and elements in the table make your test slower.
shirates-stub is useful to change test data pattern on demand. https://github.com/ldi-github/shirates-stub
By default, screenshots are taken on change detected. You can disable this feature in testrun.properties (or testrun.global.properties).
For example, you can disable auto screenshot on condition block and action block.
## Screenshot --------------------
onCondition=false
onAction=false
Direct Access Mode is faster than Cache Mode (Cache Mode is default). But you can not use powerful functions derived from Cache Mode (e.g. relative selector)
This is not cross platform approach but fast. Note that you can not get enough reports and screenshots automatically.
Get the latest shirates-core repository. In shirates-core project kotlin/tutorial/inaction/DirectAccessModeIos.kt
@Test
@Order(25)
fun appiumDriverTest() {
disableCache()
scenario {
case(1) {
condition {
appiumDriver.findElement(By.id("General")).click()
}.action {
appiumDriver.findElement(By.id("About")).click()
}.expectation {
appiumDriver.findElement(By.id("Name"))
.toTestElement().isFound.thisIsTrue("<Name > exists")
}
}
}
}
Really appreciate the response. I see it is nice to know that its api limited and not because of my configurations. Thank you so much
Anyway to make it more faster? Best Configs to use for iOS?
Using Mac mini M2 16 GB
OS: Sonoma 14.5 Appium : 2.5.4