项目作者: QAutomatron

项目描述 :
Kotlin test automation framework for Selenium/Appium
高级语言: Kotlin
项目地址: git://github.com/QAutomatron/kaper.git
创建时间: 2017-10-19T16:10:32Z
项目社区:https://github.com/QAutomatron/kaper

开源协议:Apache License 2.0

下载


Kaper Build Status Download

Test automation framework for Selenium/Appium written in Kotlin

Basics

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

Installation (Gradle)

  1. Add repository to your project:

    1. repositories {
    2. mavenCentral()
    3. jcenter()
    4. maven {
    5. url "https://dl.bintray.com/qautomatron/kaper"
    6. }
    7. }
  2. Add dependency:

    1. dependencies {
    2. compile 'com.qautomatron:kaper:0.0.16'
    3. }

How to use

  1. Create step classes inherited from Steps()
  2. Add some elements to you new step class:
    1. private val btnYes = kEl(ai("Yes")) // ai is alias for AccessibilityId
    2. private val popup = kEl(ai("SomePopup"))
  3. Add some methods to interact with elements:
    1. fun tapYes() {
    2. btnYes.click()
    3. }
  4. Or Add asserts:
    1. fun popupShouldBePresent() {
    2. assertTrue("Popup should be visible",
    3. popup.waitForVisibility())
    4. }
  5. Write test:

    1. class SampleTest {
    2. private val mySteps by lazy { MySteps() }
    3. fun example_test() {
    4. // Tap Yes
    5. mySteps.tapYes()
    6. // Check Popup visible
    7. mySteps.popupShouldBePresent()
    8. }
    9. }

Contributing

Will add info

Authors

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

  • Inspired by: