Skip to content

Commit

Permalink
Merge pull request #1 from benxu3/e2e-tests
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
benxu3 authored Sep 23, 2024
2 parents a4544f2 + 12b881d commit 5d96270
Show file tree
Hide file tree
Showing 44 changed files with 945 additions and 606 deletions.
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ eas.json
/coverage
package-lock.json
../.DS_Store
../.idea/
../.idea/
.env.local
50 changes: 50 additions & 0 deletions app/.maestro/chat/initChat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
appId: com.interpreter.app
tags:
- prod-build
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Verify that all options selected enables the continue button
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: true
- tapOn:
id: "tosContinue"

- tapOn: "Your LiveKit URL"
- inputText: ${LIVEKIT_URL.slice(0, 15)}
- inputText: ${LIVEKIT_URL.slice(15, 30)}
- inputText: ${LIVEKIT_URL.slice(30, 45)}
- inputText: ${LIVEKIT_URL.slice(45, 60)}
- inputText: ${LIVEKIT_URL.slice(60, 75)}
- inputText: ${LIVEKIT_URL.slice(75, 90)}
- inputText: ${LIVEKIT_URL.slice(90)}
- pressKey: Enter
- tapOn:
id: "loginButton"

- extendedWaitUntil:
visible:
id: "audioVisualizer"
timeout: 20000

# enter chat message
- tapOn:
point: "56%,94%"
- inputText: "What can you do?"
- pressKey: Enter

- assertVisible: "What can you do?"
7 changes: 7 additions & 0 deletions app/.maestro/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
flows:
- "tos/*"
- "login/*"
- "chat/*"
- "settings/*"
excludeTags:
- prod-build
34 changes: 34 additions & 0 deletions app/.maestro/login/openSetup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
appId: com.interpreter.app
tags:
- prod-build
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Verify that all options selected enables the continue button
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: true
- tapOn:
id: "tosContinue"

- assertVisible:
id: "loginBackground"
- tapOn:
id: "setupLink"

# link opened
- assertNotVisible:
id: "loginBackground"
34 changes: 34 additions & 0 deletions app/.maestro/login/scanQRCode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
appId: com.interpreter.app
tags:
- prod-build
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Verify that all options selected enables the continue button
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: true
- tapOn:
id: "tosContinue"

- assertVisible:
id: "loginBackground"
- tapOn:
id: "loginBackground"

# on camera
- assertNotVisible:
id: "loginBackground"
55 changes: 55 additions & 0 deletions app/.maestro/settings/toggleWearable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
appId: com.interpreter.app
tags:
- prod-build
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Verify that all options selected enables the continue button
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: true
- tapOn:
id: "tosContinue"

- tapOn: "Your LiveKit URL"
- inputText: ${LIVEKIT_URL.slice(0, 15)}
- inputText: ${LIVEKIT_URL.slice(15, 30)}
- inputText: ${LIVEKIT_URL.slice(30, 45)}
- inputText: ${LIVEKIT_URL.slice(45, 60)}
- inputText: ${LIVEKIT_URL.slice(60, 75)}
- inputText: ${LIVEKIT_URL.slice(75, 90)}
- inputText: ${LIVEKIT_URL.slice(90)}
- pressKey: Enter
- tapOn:
id: "loginButton"

- extendedWaitUntil:
visible:
id: "audioVisualizer"
timeout: 20000

- tapOn:
id: "settingsIcon"
- assertVisible: "Settings"
- tapOn:
id: "wearableToggle"
- tapOn:
id: "returnIcon"

- extendedWaitUntil:
visible:
id: "audioVisualizer"
timeout: 5000
88 changes: 88 additions & 0 deletions app/.maestro/tos/disabledFlows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
appId: com.interpreter.app
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Test all permutations of incomplete selections
# No options selected
- assertVisible:
id: "tosBackup"
- assertVisible:
id: "tosSafety"
- assertVisible:
id: "tosAgree"
- assertVisible:
id: "tosContinue"
enabled: false

# Only Backup selected
- tapOn:
id: "backupRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "backupRadio"

# Only Safety selected
- tapOn:
id: "safetyRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "safetyRadio"

# Only Agree selected
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "tosRadio"

# Backup and Safety selected
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"

# Backup and Agree selected
- tapOn:
id: "backupRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "backupRadio"
- tapOn:
id: "tosRadio"

# Safety and Agree selected
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: false
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
25 changes: 25 additions & 0 deletions app/.maestro/tos/enabledFlow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
appId: com.interpreter.app
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

# Verify that all options selected enables the continue button
- tapOn:
id: "backupRadio"
- tapOn:
id: "safetyRadio"
- tapOn:
id: "tosRadio"
- assertVisible:
id: "tosContinue"
enabled: true
- tapOn:
id: "tosContinue"
- assertVisible:
id: "loginBackground"
17 changes: 17 additions & 0 deletions app/.maestro/tos/openSafety.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appId: com.interpreter.app
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

- tapOn:
id: "tosSafetyLink"

# link opened
- assertNotVisible:
id: "tosDisclaimer"
17 changes: 17 additions & 0 deletions app/.maestro/tos/openTOS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appId: com.interpreter.app
---
- launchApp:
appId: com.interpreter.app
- openLink: ${EXPO_SERVER}

- extendedWaitUntil:
visible:
id: "tosDisclaimer"
timeout: 5000

- tapOn:
id: "tosAgree"

# link opened
- assertNotVisible:
id: "tosDisclaimer"
19 changes: 14 additions & 5 deletions app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ExpoConfig, ConfigContext } from "@expo/config"
import { config } from "dotenv"

/**
* Initialize dotenv to load environment variables
*/
config()

/**
* Use ts-node here so we can use TypeScript for our Config Plugins
Expand All @@ -8,7 +14,7 @@ require("ts-node/register")

/**
* @param config ExpoConfig coming from the static config app.json if it exists
*
*
* You can read more about Expo's Configuration Resolution Rules here:
* https://docs.expo.dev/workflow/configuration/#configuration-resolution-rules
*/
Expand All @@ -17,9 +23,12 @@ module.exports = ({ config }: ConfigContext): Partial<ExpoConfig> => {

return {
...config,
plugins: [
...existingPlugins,
require("./plugins/withSplashScreen").withSplashScreen,
],
plugins: [...existingPlugins, require("./plugins/withSplashScreen").withSplashScreen],
extra: {
...config.extra,
eas: {
projectId: process.env.EAS_PROJECT_ID || "", // Dynamically set EAS_PROJECT_ID
},
},
}
}
Loading

0 comments on commit 5d96270

Please sign in to comment.