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

Test/e2e/alert #357

Merged
merged 19 commits into from
Dec 20, 2024
Merged

Test/e2e/alert #357

merged 19 commits into from
Dec 20, 2024

Conversation

agonzalez-r
Copy link
Member

@agonzalez-r agonzalez-r commented Dec 20, 2024

Alert E2E

Description

This PR introduces an end-to-end test for the flow of creating an alert and editing it and deleting it.

Changes

  • Added the end-to-end test
  • Changed test tags in AlertLists.kt, because using the alert.id in the test tag was not possible from the end to end.

Files

Added

  • app/src/androidTest/java/com/android/periodpals/endtoend/EndToEndAlert.kt

Modified

  • AlertLists.kt
  • AlertListsScreenTest

Removed

None.

Dependencies Added

None.

agonzalez-r and others added 12 commits December 16, 2024 11:25
- Changed the contentDescription of Product and urgency.
- Used index to sign each MyAlertItem and PalsAlertItem.
- Use while and sleep to wait for screens to be loaded.
- Use randomNumber to prevent parallel testing failures.
- Removed unnecessary set up of alert VM.
- Added checks after edit and delete.
…test/e2e/alert

# Conflicts:
#	app/src/main/java/com/android/periodpals/ui/alert/AlertLists.kt
…test/e2e/alert

# Conflicts:
#	app/src/main/java/com/android/periodpals/ui/alert/AlertLists.kt
@agonzalez-r agonzalez-r self-assigned this Dec 20, 2024
…test/e2e/alert

# Conflicts:
#	app/src/androidTest/java/com/android/periodpals/endtoend/EndToEndM1.kt
…test/e2e/alert

# Conflicts:
#	app/src/main/java/com/android/periodpals/ui/alert/AlertLists.kt
#	app/src/test/java/com/android/periodpals/ui/alert/AlertListsScreenTest.kt
@agonzalez-r agonzalez-r marked this pull request as ready for review December 20, 2024 06:04
@charliemangano charliemangano linked an issue Dec 20, 2024 that may be closed by this pull request
5 tasks
Copy link
Contributor

@charliemangano charliemangano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation of the end-to-end tests! You found a way to make the test tags work, good job!

@@ -292,9 +293,10 @@ fun AlertListsScreen(
if (myAlertsList.isEmpty()) {
item { NoAlertDialog(context.getString(R.string.alert_lists_no_my_alerts_dialog)) }
} else {
items(myAlertsList) { alert ->
itemsIndexed(myAlertsList) { index, alert ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix!

@@ -352,6 +356,7 @@ fun AlertListsScreen(
* profile picture, time, location, product type, urgency, and an edit button.
*
* @param alert The alert to be displayed.
* @param indexTestTag The index of the alert in the list.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice reflex

@agonzalez-r agonzalez-r requested review from coaguila and removed request for francelu December 20, 2024 06:57
Copy link
Contributor

@coaguila coaguila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Great end to end test for Alerts!

Important (which includes)

Code Quality

LGTM

Functionality

LGTM

Testing

Very cohesive tests should correctly reflect users' flow.

@agonzalez-r agonzalez-r merged commit f2ebde6 into main Dec 20, 2024
3 checks passed
@agonzalez-r agonzalez-r deleted the test/e2e/alert branch December 20, 2024 07:06
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.

E2E for alert
4 participants