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

✅ Re-implement the Instrumented Tests with Compose Multiplatform #674

Merged
merged 17 commits into from
May 17, 2024

Conversation

igorescodro
Copy link
Owner

@igorescodro igorescodro commented May 5, 2024

Port the Android-only UI tests to Compose Multiplatform. Some tests were removed, such as the notifications, but the existing ones can give the level of reliance I need for now.

@igorescodro igorescodro force-pushed the ui/test branch 11 times, most recently from 375c275 to c54e95e Compare May 17, 2024 03:40
@igorescodro igorescodro changed the title 🚧 Re-implement the Instrumented Tests with Compose Multiplatform ✅ Re-implement the Instrumented Tests with Compose Multiplatform May 17, 2024
This file was created a while ago because the test dependencies didn't
have it it was failing on some Android SDK versions. We don't need this
anymore because it's duplicating the embedded resource.
Since the strings are provided different on each platform, a new
provider with "expected" code was created. Since the idea is only using
for UI tests for now, it was not added to the DI graph and the context
is injected directly to the reference.
One of the most simple test were implemented to start the new era!
Adding accessibility sync options not only provides a better UX
experience for all users but also allows Maestro to get the appropriate
areas, ids and content descriptions.
Test and structure updated.
Lint fixed!
The iOS test framework is not playing well with WindowClassSize and iOS
NotificationCenter, failing the Gradle task. A new structure was created
to fake those modules with no-op implementations.
After spending hours trying to understand why the iOS tests were not
running and getting stuck, I founded out that the issue is the
`rememberRefreshKey()`. In the iOS tests, the `delay` calls are not
being respected and since we have a 1-minute delay for the Task Screen,
it is infinite looping. For now, we are simply removing it.

A new issue was opened in the Compose Multiplatform project to get a
better understanding of the behavior.
JetBrains/compose-multiplatform#4805
Cleaning the house
Changes made in the build.yml and instrumented_tests.yml to run the
instrumented tests for both iOS and Android. The build.yml was updated
to remove the unit tests from the build step, otherwise, it will try to
run the UI tests during that step. Not the perfect solution, but good
enough for now.

The Android Emulator Runner was also updated and it's running much
faster with the new recommended setup.
Removing the tests that only runs in Jetpack Compose. Next commits will
re-add them in the Compose Multiplatform way.
Instead of having two files containing UI Test-related functions, now
everything is inside AlkaaTest.kt.
Some of the functions used in the code are not properly supported in the
iOS Simulator. Some modifications and fake classes are injected to make
it possible.
Here we go! For now, the notification tests are not ported because they
are framework-dependant. But at least the other tests can give us more
confidence about the new changes.
New test added to the recently added feature to add alarms via the
bottom sheet.
Small changes in injection structure and adding more KDocs.
@igorescodro igorescodro merged commit 655608c into main May 17, 2024
6 checks passed
@igorescodro igorescodro deleted the ui/test branch May 17, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant