Skip to content

Commit

Permalink
2.5.0-alpha05
Browse files Browse the repository at this point in the history
KMP Publishing
  • Loading branch information
alex-tiurin committed Jun 24, 2024
1 parent be9e769 commit e0f2a60
Show file tree
Hide file tree
Showing 26 changed files with 513 additions and 261 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master ]

jobs:
run_tests_on_api_29:
compileKotlin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,4 +17,4 @@ jobs:
java-version: '17'

- name: Compile framework
run: ./gradlew :ultron:compileDebugKotlin
run: ./gradlew compileDebugKotlin
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy docs
on:
push:
branches:
- kmp
- master

jobs:
github-pages:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish to Maven Central

permissions:
contents: read

on:
push:
tags:
- 'v*'

jobs:
publish:
env:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
OSSRH_GPG_SECRET_KEY_ID: ${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}

strategy:
matrix:
include:
- target: :ultron-compose:publishToSonatype
os: ubuntu-latest
- target: :ultron-android:publishToSonatype
os: ubuntu-latest
- target: :ultron-allure:publishToSonatype
os: ubuntu-latest
- target: :ultron-common:publishToSonatype
os: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: "zulu"

- name: Setup Gradle cache
uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

- name: Gradle publish
run: ./gradlew "${{ matrix.target }}" closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_TOKEN }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
SIGNING_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Ultron can be easially customised and extended. Wish you exclusively stable test
<img src="https://user-images.githubusercontent.com/12834123/252498170-61e5a440-c2b5-42ea-8bfb-91ee12248422.png#gh-dark-mode-only" width=600>
</p>

## [Documentation](https://open-tool.github.io/ultron/) | [Releases](https://github.com/open-tool/ultron/releases)

## What are the benefits of using the framework?

- Exceptional support for [**Compose**](https://github.com/open-tool/ultron/wiki/Compose)
Expand Down Expand Up @@ -247,21 +249,11 @@ For the complete guide, refer to the [wiki](https://github.com/open-tool/ultron/
fun setConfig() {
UltronConfig.applyRecommended()
UltronAllureConfig.applyRecommended()
UltronComposeConfig.applyRecommended()
}
```
![allure](https://github.com/open-tool/ultron/assets/12834123/c05c813a-ece6-45e6-a04f-e1c92b82ffb1)

for Compose add 4 lines more
```kotlin
@BeforeClass @JvmStatic
fun setConfig() {
...
UltronComposeConfig.applyRecommended()
UltronComposeConfig.addListener(ScreenshotAttachListener())
UltronComposeConfig.addListener(WindowHierarchyAttachListener())
UltronComposeConfig.addListener(DetailedOperationAllureListener())
}
```
![allure compose](https://github.com/open-tool/ultron/assets/12834123/1f751f3d-fc58-4874-a850-acd9181bfb70)


Expand All @@ -274,7 +266,7 @@ repositories {
}
dependencies {
androidTestImplementation 'com.atiurin:ultron:<latest_version>'
androidTestImplementation 'com.atiurin:ultron-android:<latest_version>'
androidTestImplementation 'com.atiurin:ultron-allure:<latest_version>'
androidTestImplementation 'com.atiurin:ultron-compose:<latest_version>'
}
Expand All @@ -284,8 +276,3 @@ Please, read [gradle dependencies management](https://github.com/open-tool/ultro
## AndroidX

It is required to use AndroidX libraries. You can get some problems with Android Support ones.

## Roadmap

- https://github.com/open-tool/ultron/issues/50 Meta information for UI elements
- https://github.com/open-tool/ultron/issues/33 Screenshot testign ?
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.compose.internal.utils.getLocalProperty

buildscript {
extra.apply {
set("RELEASE_REPOSITORY_URL", "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
Expand All @@ -7,6 +9,7 @@ buildscript {
repositories {
google()
mavenCentral()
mavenLocal()
}
dependencies {
classpath(Plugins.kotlinGradle)
Expand All @@ -25,13 +28,28 @@ plugins {
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.compose.compiler) apply false
id("io.github.gradle-nexus.publish-plugin").version("2.0.0-rc-1")
}

nexusPublishing {
repositories {
sonatype {
username
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(getLocalProperty("ossrhToken") ?: System.getenv("OSSRH_TOKEN"))
password.set(getLocalProperty("ossrhTokenPassword") ?: System.getenv("OSSRH_PASSWORD"))
stagingProfileId.set(getLocalProperty("sonatype.stagingProfileId") ?: System.getenv("OSSRH_STAGING_PROFILE_ID"))
}
}
}


allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
gradlePluginPortal()
}
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ object Versions {
const val kotlin = "2.0.0"
const val androidToolsBuildGradle = "8.3.1"
const val androidMavenGradlePlugin = "2.1"
const val publishPlugin = "0.13.0"
const val dokkaPlugin = "1.4.30"
const val publishPlugin = "0.29.0"
const val dokkaPlugin = "1.9.20"

const val recyclerView = "1.2.1"
const val espresso = "3.4.0"
Expand Down
37 changes: 10 additions & 27 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ plugins {
}

kotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(project.projectDir.path)
}
}
}
}
binaries.executable()
}

androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
Expand All @@ -49,16 +32,16 @@ kotlin {

jvm("desktop")

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
// listOf(
// iosX64(),
// iosArm64(),
// iosSimulatorArm64()
// ).forEach { iosTarget ->
// iosTarget.binaries.framework {
// baseName = "ComposeApp"
// isStatic = true
// }
// }

sourceSets {
val desktopMain by getting
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/common/allure.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ You can attach artifact using 2 types of Ultron listeners:

- [UltronRunListener](https://github.com/open-tool/ultron/blob/master/ultron/src/main/java/com/atiurin/ultron/runner/UltronRunListener.kt) which is inherited from [RunListener](https://github.com/open-tool/ultron/blob/master/ultron/src/main/java/com/atiurin/ultron/runner/RunListener.kt). This type can be used to add artifact in different test lifecycle state. Sample - [WindowHierarchyAttachRunListener.kt](https://github.com/open-tool/ultron/blob/master/ultron-allure/src/main/java/com/atiurin/ultron/allure/runner/WindowHierarchyAttachRunListener.kt)

Refer to the [Listeners wiki page](../common/listeners.md) for details.
Refer to the [Listeners doc page](../common/listeners.md) for details.
2 changes: 1 addition & 1 deletion docs/docs/compose/lazylist.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ object ComposeListPage : Page<ComposeListPage>() {

## `UltronComposeListItem` API

It's pretty much the same as [simple node api](https://github.com/open-tool/ultron/wiki/Compose#ultron--compose-api), but extends it mostly for internal features.
It's pretty much the same as [simple node api](../compose/api.md), but extends it mostly for internal features.

***
## Efficient Strategies for Locating Items in Compose LazyList
Expand Down
22 changes: 11 additions & 11 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ You don't need to learn any new classes or special syntax. All magic actions and

## What are the benefits of using the framework?

- Exceptional support for [**Compose**](https://github.com/open-tool/ultron/wiki/Compose)
- Out-of-the-box generation of [**Allure report**](https://github.com/open-tool/ultron/wiki/Allure) (Now, for Android UI tests only)
- Exceptional support for [**Compose**](./compose/index.md)
- Out-of-the-box generation of [**Allure report**](./common/allure.md) (Now, for Android UI tests only)
- A straightforward and expressive syntax
- Ensured **Stability** for all actions and assertions
- Complete control over every action and assertion
- Incredible interaction with [**RecyclerView**](https://github.com/open-tool/ultron/wiki/RecyclerView) and [**Compose lists**](https://github.com/open-tool/ultron/wiki/Compose#ultron-compose-lazycolumnlazyrow).
- Incredible interaction with [**RecyclerView**](./android/recyclerview.md) and [**Compose lists**](./compose/lazylist.md).
- An **Architectural** approach to developing UI tests
- An incredible mechanism for setups and teardowns (You can even set up preconditions for a single test within a test class, without affecting the others)
- [The ability to effortlessly extend the framework with your own operations](https://github.com/open-tool/ultron/wiki/Ultron-Extension)
- [The ability to effortlessly extend the framework with your own operations](./common/extension.md)
- Accelerated UI Automator operations
- Ability to monitor each stage of operation execution with [Listeners](https://github.com/open-tool/ultron/wiki/Listeners)
- Ability to monitor each stage of operation execution with [Listeners](./common/listeners.md)
- [Custom operation assertions](https://github.com/open-tool/ultron/wiki/Custom-operation-assertions)

***
Expand All @@ -35,7 +35,7 @@ The standard syntax provided by Google is intricate and not intuitive. This is e

Let's explore some examples:

#### 1. Simple compose operation (refer to the wiki [here](https://github.com/open-tool/ultron/wiki/Compose#ultron-compose))
#### 1. Simple compose operation (refer to the doc [here](./compose/index.md))

_Compose framework_

Expand All @@ -50,7 +50,7 @@ hasTestTag("Continue").click()
hasText("Welcome").assertIsDisplayed()
```

#### 2. Compose list operation (refer to the wiki [here](https://github.com/open-tool/ultron/wiki/Compose#ultron-compose-lazycolumnlazyrow))
#### 2. Compose list operation (refer to the [doc](./compose/lazylist.md))

_Compose framework_

Expand Down Expand Up @@ -85,7 +85,7 @@ withId(R.id.send_button).isDisplayed().click()
```
This presents a cleaner approach. Ultron's operation names mirror Espresso's, while also providing additional operations.

Refer to the [wiki](https://github.com/open-tool/ultron/wiki/Espresso-operations) for further details.
Refer to the [doc](./android/espress.md) for further details.

#### 4. Action on RecyclerView list item

Expand All @@ -109,7 +109,7 @@ withRecyclerView(R.id.recycler_friends)
.click()
```

Explore the [wiki](https://github.com/open-tool/ultron/wiki/RecyclerView) to unveil Ultron's magic with RecyclerView interactions.
Explore the [doc](./android/espress.md) to unveil Ultron's magic with RecyclerView interactions.

#### 5. Espresso WebView operations

Expand All @@ -133,7 +133,7 @@ id("button1").webClick()
id("title").hasText(newTitle)
```

Refer to the [wiki](https://github.com/open-tool/ultron/wiki/WebView) for more details.
Refer to the [doc](./android/webview.md) for more details.

#### 6. UI Automator operations

Expand All @@ -151,7 +151,7 @@ _Ultron_
```kotlin
byResId(R.id.button1).click()
```
Refer to the [wiki](https://github.com/open-tool/ultron/wiki/UI-Automator-operation)
Refer to the [doc](./android/uiautomator.md)
***
### Acquiring the result of any operation as Boolean value

Expand Down
Loading

0 comments on commit e0f2a60

Please sign in to comment.