michallaskowski / kuiks Goto Github PK
View Code? Open in Web Editor NEWKotlin Multiplatform based testing framework for Android and iOS
License: Apache License 2.0
Kotlin Multiplatform based testing framework for Android and iOS
License: Apache License 2.0
Hi I'm interested in this project. I would like to know if you are using this at your work, or if this is just experimental?
I like the idea of using the same tools to test that we are familiar with, rather than learn a new tool like Appium. Also it seems like it closer to using the native tools and would be easy to customise if we needed particular features of either XCTest or Espresso.
However I'm hesitant to start using it, as I would be asking QA team to help write the tests and they don't have android experience. What would you recommend?
Dear Sir
Google next UI is Jetpack Compose
and JB use it do "Compose for Desktop" !!
the project can support compose ?
THX
@michallaskowski I really like the idea of using one code base to test iOS and Android, I was wondering is there anything I would need to do to set up this for my own project?
@michallaskowski Here is an API proposal for a standardised UI test framework which is heavily influenced by XCUITest, can I have your thoughts?
package com.laskowski.kuiks
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
typealias TimeInterval = Double
interface UIElement: UIElementInteraction, UIElementWaitForElement {
/**
* Check if element exists
*/
val exists: Boolean
val isEnabled: Boolean
/**
* Check if element is hittable
*/
val isHittable: Boolean
val isSelected: Boolean
val isVisible: Boolean
/**
* Print out view hierarchy
*/
val debugDescription: String
fun element(): UIElement
val hasKeyboardFocus: Boolean
fun isKeyboardKeyAvaliable(key: String): Boolean
fun dismissKeyboard()
val label: String
val identifier: String
val value: String
}
interface UIElementInteraction {
fun tap()
fun forceTap()
fun doubleTap()
fun press(forDuration: TimeInterval)
fun press(forDuration: TimeInterval, thenDragTo: UIElement)
fun swipeUp()
fun swipeDown()
fun swipeLeft()
fun swipeRight()
fun pinch(scale: Double, velocity: Double)
fun rotate(rotation: Double, withVelocity: Double)
/**
* Scroll to Element
*/
fun scrollTo(targetElement: UIElement, scrollView: UIElement, direction: ScrollDirection, maximumAttempts: Int, scrollDistance: Double)
fun typeText(text: String)
fun adjustSlider(position: Double)
}
interface UIElementWaitForElement {
fun waitForElementToExistence(timeout: TimeInterval): Boolean
fun waitForElementToBecomeHittable(timeout: TimeInterval): Boolean
fun waitForElementToBecomeSelected(timeout: TimeInterval): Boolean
}
interface UIElementWaitForMultipleElement {
fun waitForMultipleElementsToBecomeInToExistence(timeout: TimeInterval): Boolean
fun waitForMultipleElementsToBecomeUnavailable(timeout: TimeInterval): Boolean
}
enum class ScrollDirection {
down,
up,
left,
right
}
enum class Timeout (val rawValue: Double) {
ExtraSmall(1.0),
Small(3.0),
Medium(5.0),
Large(10.0),
ExtraLarge(15.0),
ExtraExtraLarge(30.0),
ExtraSuperLarge(45.0),
Mega(240.0);
companion object {
operator fun invoke(rawValue: TimeInterval) = Timeout.values().firstOrNull { it.rawValue == rawValue }
}
}
Hello, I try to used part of code in this repo to apply our iOS UI test as experiment purpose. But I found below import is unresolved sharedCode/../actual.kt, which I think it is needed to call XCTest framework in KMM project from Xcode.
And now I could open and run the sample-iOS app in Xcode and Android Studio successfully. But I'm unable to run the UI test case defined in this project, the reason could be XCTest is not recognized. Could you give me some clue what step I'm missing?
import platform.XCTest.*
import platform.Foundation.*
language = Objective-C
package = platform.XCTest
depends = UIKit
modules = XCTest
linkerOpts= -weak_framework XCTest -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/
compilerOpts= -weak_framework XCTest -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/
And I see in the doc this step, so do I need to create cinterop binding manually for this project?
Create a .def file describing what to include into bindings.
Use the cinterop tool to produce Kotlin bindings.
Run the Kotlin/Native compiler on an application to produce the final executable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.