Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable maestro tests for iOS #15

Merged
merged 2 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/lightsaber-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,9 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-lightsaber-ci


# TODO Run e2e tests when Compose Multiplatform supports either Compose test tags or
# accessibility labels
- name: Check for app file
run: test -e ./iosApp/build/ios/Release-iphonesimulator/Lightsaber.app
# - uses: mobile-dev-inc/[email protected]
# with:
# api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
# app-file: ./iosApp/build/ios/Release-iphonesimulator/Lightsaber.app
- uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: ./iosApp/build/ios/Release-iphonesimulator/Lightsaber.app
19 changes: 17 additions & 2 deletions shared/src/iosMain/kotlin/xyz/alaniz/aaron/lightsaber/main.ios.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package xyz.alaniz.aaron.lightsaber

import androidx.compose.runtime.ExperimentalComposeApi
import androidx.compose.ui.platform.AccessibilitySyncOptions
import androidx.compose.ui.window.ComposeUIViewController
import kotlinx.cinterop.ExperimentalForeignApi
import platform.Foundation.NSDocumentDirectory
Expand All @@ -11,8 +13,21 @@ import xyz.alaniz.aaron.lightsaber.di.create
import xyz.alaniz.aaron.lightsaber.di.dataStoreFileName
import xyz.alaniz.aaron.lightsaber.ui.lightsaber.IosLightsaberScreen

@OptIn(ExperimentalForeignApi::class)
fun MainViewController() = ComposeUIViewController {
@OptIn(ExperimentalForeignApi::class, ExperimentalComposeApi::class)
fun MainViewController() = ComposeUIViewController(configure = {
/**
* TODO Update this to only sync the accessibility tree for debug builds
*/
accessibilitySyncOptions = AccessibilitySyncOptions.Always(debugLogger = null)

/**
* TODO Understand why this needs to be false for Maestro tests to pass
*
* The default value for this is true, but then the accessibility tree mappings include an
* offset for the status bar
*/
platformLayers = false
}) {
val documentDirectory: NSURL? = NSFileManager.defaultManager.URLForDirectory(
directory = NSDocumentDirectory,
inDomain = NSUserDomainMask,
Expand Down
Loading