-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from LookUpGroup27/feature/landing-page-star-m…
…ap-P1 feat: implement landing page with logo and navigation
- Loading branch information
Showing
17 changed files
with
312 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
app/src/androidTest/java/com/github/lookupgroup27/lookup/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
app/src/androidTest/java/com/github/lookupgroup27/lookup/overview/LandingScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.github.lookupgroup27.lookup.overview | ||
|
||
import androidx.compose.ui.test.assertHasClickAction | ||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import androidx.compose.ui.test.onNodeWithContentDescription | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.onNodeWithText | ||
import androidx.compose.ui.test.performClick | ||
import androidx.test.espresso.intent.Intents | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.github.lookupgroup27.lookup.MainActivity | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class LandingScreenTest { | ||
|
||
@get:Rule val composeTestRule = createAndroidComposeRule<MainActivity>() | ||
|
||
@Before | ||
fun setUp() { | ||
// Initialize Espresso Intents to capture and validate outgoing intents | ||
Intents.init() | ||
} | ||
|
||
@After | ||
fun tearDown() { | ||
// Release Espresso Intents after tests | ||
Intents.release() | ||
} | ||
|
||
@Test | ||
fun logoAndButtonAreDisplayed() { | ||
// Verify that the Look Up logo is displayed | ||
composeTestRule.onNodeWithContentDescription("Look Up Logo").assertIsDisplayed() | ||
|
||
// Verify that the Home button is displayed and clickable | ||
composeTestRule.onNodeWithContentDescription("Home Icon").assertIsDisplayed() | ||
composeTestRule.onNodeWithContentDescription("Home Icon").assertHasClickAction() | ||
} | ||
|
||
@Test | ||
fun backgroundIsClickableAndNavigatesToMap() { | ||
// Verify that the background image is displayed and clickable | ||
composeTestRule.onNodeWithContentDescription("Background").assertIsDisplayed() | ||
composeTestRule.onNodeWithContentDescription("Background").assertHasClickAction() | ||
|
||
// Perform click action on the background image | ||
composeTestRule.onNodeWithContentDescription("Background").performClick() | ||
|
||
// Wait for the UI to settle after the click | ||
composeTestRule.waitForIdle() | ||
|
||
// Assert that the Map screen is displayed by checking for specific text or UI elements | ||
composeTestRule.onNodeWithText("This is the Map screen.").assertIsDisplayed() | ||
} | ||
|
||
@Test | ||
fun homeButtonIsClickable() { | ||
// Perform click action on the home button using its testTag | ||
composeTestRule.onNodeWithTag("Home Icon").performClick() | ||
|
||
// Wait for the UI to settle after the click | ||
composeTestRule.waitForIdle() | ||
|
||
// Assert that the Menu screen is displayed by checking for specific text | ||
composeTestRule.onNodeWithText("This is the Menu screen.").assertIsDisplayed() | ||
} | ||
|
||
@Test | ||
fun testMapViewPromptIsDisplayed() { | ||
// Assert that it is displayed | ||
composeTestRule.onNodeWithText("Click for full map view").assertIsDisplayed() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
app/src/main/java/com/github/lookupgroup27/lookup/ui/map/Map.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
package com.github.lookupgroup27.lookup.ui.map | ||
|
||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import com.github.lookupgroup27.lookup.ui.navigation.NavigationActions | ||
|
||
@Composable fun MapScreen() {} | ||
@Composable | ||
fun MapScreen(navigationActions: NavigationActions) { | ||
Text(text = "This is the Map screen.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.