From 002f8bde8db8408d1cec9be2d22fecf8d1d0f445 Mon Sep 17 00:00:00 2001 From: EthanShoeDev <13422990+EthanShoeDev@users.noreply.github.com> Date: Wed, 10 Sep 2025 00:18:06 -0400 Subject: [PATCH] Add e2e test --- apps/mobile/package.json | 7 ++-- apps/mobile/src/app/index.tsx | 12 +++++- apps/mobile/src/app/shell.tsx | 7 +++- .../mobile/src/components/form-components.tsx | 15 +++++--- apps/mobile/test/e2e/ConnectToDemoServer.yml | 38 +++++++++++++++++++ 5 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 apps/mobile/test/e2e/ConnectToDemoServer.yml diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 91f0e9e..a5017f4 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -7,6 +7,7 @@ "scripts": { "start": "expo start", "android": "expo run:android", + "android:release": "expo run:android --variant release", "ios": "expo run:ios", "web": "expo start --web", "prebuild": "expo prebuild", @@ -16,9 +17,9 @@ "fmt": "cross-env SORT_IMPORTS=true prettier --write .", "fmt:check": "cross-env SORT_IMPORTS=true prettier --check .", "typecheck": "tsc", - "eslint:check": "expo lint --max-warnings 0 .", - "lint:fix": "expo lint --fix --max-warnings 0 .", - "lint": "expo lint" + "lint:fix": "eslint --fix --max-warnings 0 --report-unused-disable-directives .", + "eslint:check": "eslint --max-warnings 0 --report-unused-disable-directives .", + "test:e2e": "maestro test test/e2e/" }, "dependencies": { "@dylankenneally/react-native-ssh-sftp": "^1.5.20", diff --git a/apps/mobile/src/app/index.tsx b/apps/mobile/src/app/index.tsx index 52554b4..d188831 100644 --- a/apps/mobile/src/app/index.tsx +++ b/apps/mobile/src/app/index.tsx @@ -113,6 +113,7 @@ export default function Index() { {(field) => ( - {(field) => } + {(field) => ( + + )} {(field) => ( ( @@ -163,6 +172,7 @@ export default function Index() { { if (isSubmitting) return; void connectionForm.handleSubmit(); diff --git a/apps/mobile/src/app/shell.tsx b/apps/mobile/src/app/shell.tsx index 084de98..392fee5 100644 --- a/apps/mobile/src/app/shell.tsx +++ b/apps/mobile/src/app/shell.tsx @@ -89,6 +89,7 @@ function CommandInput(props: { return ( - + Execute diff --git a/apps/mobile/src/components/form-components.tsx b/apps/mobile/src/components/form-components.tsx index c1cee00..ab66c32 100644 --- a/apps/mobile/src/components/form-components.tsx +++ b/apps/mobile/src/components/form-components.tsx @@ -120,12 +120,14 @@ export function PickerField( ); } -export function SubmitButton(props: { - onPress?: () => void; - title?: string; - disabled?: boolean; -}) { - const { onPress, title = 'Connect', disabled } = props; +export function SubmitButton( + props: { + onPress?: () => void; + title?: string; + disabled?: boolean; + } & React.ComponentProps, +) { + const { onPress, title = 'Connect', disabled, ...rest } = props; const formContext = useFormContext(); const isSubmitting = useStore( formContext.store, @@ -133,6 +135,7 @@ export function SubmitButton(props: { ); return (