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

✅ Add End-To-End tests #180

Merged
merged 24 commits into from
Jun 16, 2022
Merged

✅ Add End-To-End tests #180

merged 24 commits into from
Jun 16, 2022

Conversation

igorescodro
Copy link
Owner

Add more UI Android Tests in order to have a better coverage and confidence in future changes and refactors.

New tests to validate the search feature.
Now that we have Unified Test Platform, it is easier to run Instrumented
Tests directly in Gradle instead of relying in a separate service in
Continuous Integration. New devices were setup in ready to go!
Gradle Manages Devices updated on Build Gradle due to recent updates to
KTS and the command was also updated in the CI due to update in Android
Studio Chipmunk.
At the moment, the UTP is not playing well with GitHub Actions, so the
Android Emulator by ReactiveCircus is enabled again in order to develop
more end-to-end tests. In the future, I will revaluate the UTP support
in Alkaa.
Encapsulation reverted to be used in E2E tests.
Android.R imported added in the Android Tests to match the correct
string
New tests to validate the category feature.
New tests to validate the preference feature.
In the `@Before` of the tests, all the tasks and categories are removed
in order to add new ones every time. This way we avoid "dirty" or
"clean" databases in between tests.
New tests to validate the alarm feature in the TaskFlowTest
New tests to validate the notification feature in the application
Add "DisableAnimationRule" for all tests in order to reduce the
flakiness caused by animation delays. Also some tests were forced
multiple times to detect flakiness and update each specific one.
More comments added in order to be clearer what each test is trying to
achieve
Emulator script updated to make the tests less flaky
Re-enable the Unified Test platform in Alkaa.
Build Gradle version updated to latest version matching Android Studio
Canary and the Gradle command based on the Issue Tracker reply
Update the syntax to the latest one since the previous was deprecated.
Also, removed the emulator not working properly by now.
One more test added to check the notification action opening the task
detail
Some tests are failing because Compose and Activity lifecycles are not
playing well with Compose Tests.
The error shown is:
    "No compose views found in the app. Is your Activity resumed?"

The solution found at IssueTracker was to add a waitUntil before
starting the actual test.
See https://issuetracker.google.com/issues/201900572
After the merge, the AGP version was downgraded, now it's back to normal
@igorescodro
Copy link
Owner Author

That's an internal api. The correct form would be to use the NamedDomain* functions, i.e.:

import com.android.build.api.dsl.ManagedVirtualDevice

// ....
        create<ManagedVirtualDevice>("pixel4api31") {
          device = "Pixel 4"
          apiLevel = 30
          systemImageSource = "aosp-atd"
        }

Thanks a lot for the comment. I'll update it and try again.
Any luck on your side with flaky tests? One specific test fails some times on GitHub Actions, but never on local machine.
I opened this Issue Tracker with this issue.

Based on @PaulWoitaschek comment, update to the correct API
Apparently the 7.3 is the correct version of Android Gradle Plugin to
use with Gradle Managed Virtual Devices. Even though it compiles with
7.2 stable.
That's not a thing I would like to do, but I'm stuck with this issues
for months. A Issue Tracker was opened for support, but in the meantime
I will have this test annotated as Flaky and trying it 5 times before
actually failing the tests.
Let's see if now I'm able to finally merge this change.
@igorescodro igorescodro merged commit e3ff773 into main Jun 16, 2022
@igorescodro igorescodro deleted the add/tests branch June 16, 2022 12:43
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.

2 participants