Skip to content

Commit

Permalink
add more location strategy aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
QAutomatron committed May 30, 2018
1 parent ff1b057 commit fa3f63b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/kotlin/com/qautomatron/kaper/core/common/byAlias.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ package com.qautomatron.kaper.core.common
import io.appium.java_client.MobileBy
import org.openqa.selenium.By

// General
fun id(id: String): By = By.id(id)
fun xp(xpath: String): By = By.xpath(xpath)
fun css(css: String): By = By.cssSelector(css)
fun cn(className: String): By = By.className(className)
fun ai(accessibilityId: String): By = MobileBy.AccessibilityId(accessibilityId)
fun lt(linkText: String): By = MobileBy.linkText(linkText)

// iOS only
fun ai(accessibilityId: String): By = MobileBy.AccessibilityId(accessibilityId)
fun pr(predicate: String): By = MobileBy.iOSNsPredicateString(predicate)
fun cc(chain: String): By = MobileBy.iOSClassChain(chain)

// Android
fun aa(automator: String): By = MobileBy.AndroidUIAutomator(automator)

0 comments on commit fa3f63b

Please sign in to comment.