Test automation framework for Selenium/Appium written in Kotlin
Base structure is: Test - Steps - Elements
All step classes should be inherited from Step()
All steps in test should be init by lazy {}
: private val mySteps by lazy { MySteps() }
First call to any step in test will invoke WebDriver
or AppiumDriver
creation. One Driver per thread
Every element in steps should be wrapped in kEl(By)
Could use TestNG listener KListener
Could use AspectJ step logger com.qautomatron.kaper.core.listener.StepLogger
- Add repository to your project:
repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/qautomatron/kaper"
}
}
- Add dependency:
dependencies {
compile 'com.qautomatron:kaper:0.0.16'
}
- Create step classes inherited from
Steps()
- Add some elements to you new step class:
private val btnYes = kEl(ai("Yes")) // ai is alias for AccessibilityId
private val popup = kEl(ai("SomePopup"))
- Add some methods to interact with elements:
fun tapYes() {
btnYes.click()
}
- Or Add asserts:
fun popupShouldBePresent() {
assertTrue("Popup should be visible",
popup.waitForVisibility())
}
- Write test:
class SampleTest {
private val mySteps by lazy { MySteps() }
fun example_test() {
// Tap Yes
mySteps.tapYes()
// Check Popup visible
mySteps.popupShouldBePresent()
}
}
Will add info
- Evgenii S - Initial work - QAutomatron
This project is licensed under the Apache 2.0 License - see the LICENSE file for details
- Inspired by: