Skip to content

Commit cce28fc

Browse files
authored
refactor: improve local Appium release runs (#51)
1 parent 06ceb88 commit cce28fc

5 files changed

Lines changed: 25 additions & 8 deletions

File tree

appium/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Quick start:
4545
cd scripts
4646
cp .env.example .env # add the OneSignal app dedicated to Appium tests
4747
./run-local.sh --platform=ios --sdk=flutter
48+
49+
# Check out the latest SDK release points before running
50+
./run-local.sh --platform=ios --sdk=flutter --release
4851
```
4952

5053
## Test Specs

appium/scripts/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ If `--platform` or `--sdk` are not provided, the script prompts interactively.
8585
| `--skip-device` | Skip simulator/emulator launch |
8686
| `--skip-reset` | Keep existing app data between runs |
8787
| `--pods` | Use `examples/demo-pods` for Flutter, Cordova, and Capacitor |
88+
| `--release` | Check out the latest release point in each SDK repo first |
8889
| `-h, --help` | Show help |
8990

9091
### Examples
@@ -95,6 +96,12 @@ Run all tests (full build + fresh install):
9596
./run-local.sh --platform=ios --sdk=flutter
9697
```
9798

99+
Run against the latest SDK release points:
100+
101+
```bash
102+
./run-local.sh --platform=ios --sdk=flutter --release
103+
```
104+
98105
Run a single spec file:
99106

100107
```bash
@@ -133,11 +140,11 @@ Skip only the build (simulator + reset still happen):
133140
./run-all.sh # every combo, both platforms
134141
./run-all.sh --platform=ios # iOS only
135142
./run-all.sh --sdks=flutter,react-native # subset of SDKs
136-
./run-all.sh --releases # check out the latest release point per repo first
143+
./run-all.sh --release # check out the latest release point per repo first
137144
./run-all.sh --bail # stop after the first failing combo
138145
```
139146

140-
`--releases` runs `checkout-releases.sh`, which checks out the newest stable `rel/X.Y.Z` branch (or newest semver tag for expo/ios) in each SDK repo, honoring the `*_DIR` overrides from `.env`. Repos with uncommitted changes are skipped, never clobbered.
147+
`--release` is available on both `run-all.sh` and `run-local.sh`. It runs `checkout-releases.sh`, which checks out the newest stable `rel/X.Y.Z` branch (or newest semver tag for expo/ios) in each SDK repo, honoring the `*_DIR` overrides from `.env`. Repos with uncommitted changes are skipped, never clobbered.
141148

142149
> Within each combo the specs still **bail on the first failing test** locally (`mochaOpts.bail = isLocal`), so one early failure hides the specs after it.
143150

appium/scripts/run-all.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ PLATFORM_FILTER=""
2222
SDKS_FILTER=""
2323
BAIL=0
2424
PODS_REQUESTED=0
25-
RELEASES=0
25+
RELEASE=0
2626
for arg in "$@"; do
2727
case "$arg" in
2828
--skip-build|--skip-device|--skip-reset|--skip|--quiet|-q)
2929
EXTRA_ARGS+=("$arg") ;;
3030
--pods)
3131
PODS_REQUESTED=1 ;;
32-
--releases)
33-
RELEASES=1 ;;
32+
--release)
33+
RELEASE=1 ;;
3434
--spec=*)
3535
EXTRA_ARGS+=("$arg") ;;
3636
--platform=ios|--platform=android)
@@ -59,7 +59,7 @@ Options:
5959
Note: 'android' (native) skips --platform=ios and
6060
'ios' (native) skips --platform=android.
6161
--bail Stop after the first failing combo
62-
--releases Check out the latest release point in each SDK repo
62+
--release Check out the latest release point in each SDK repo
6363
first (runs checkout-releases.sh; honors *_DIR from
6464
.env). Skips repos with uncommitted changes.
6565
@@ -117,7 +117,7 @@ if (( PODS_REQUESTED )); then
117117
fi
118118
fi
119119

120-
if (( RELEASES )); then
120+
if (( RELEASE )); then
121121
echo -e "${BOLD}━━━ Checking out latest releases ━━━${NC}"
122122
if ! "$SCRIPT_DIR/checkout-releases.sh"; then
123123
error "checkout-releases.sh failed; aborting before running combos"

appium/scripts/run-local/config.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ configure_runner() {
1111
SPEC=""
1212
QUIET=false
1313
PODS_DEMO=false
14+
RELEASE=false
1415
ANDROID_CHANNEL_ID=7ec2ece9-c538-4656-9516-1316f48a005c
1516
IOS_REAL_DEVICE=false
1617
UDID="${UDID:-}"
@@ -31,6 +32,7 @@ configure_runner() {
3132
--skip-device) SKIP_DEVICE=true ;;
3233
--skip-reset) SKIP_RESET=true ;;
3334
--pods) PODS_DEMO=true ;;
35+
--release) RELEASE=true ;;
3436
--spec=*) SPEC="${arg#--spec=}" ;;
3537
--quiet|-q) QUIET=true ;;
3638
--help|-h)
@@ -62,6 +64,7 @@ Options:
6264
--skip-reset Keep existing app data
6365
--pods Use examples/demo-pods instead of examples/demo for
6466
flutter, cordova, and capacitor SDKs
67+
--release Check out the latest release point in each SDK repo first
6568
--device-real Build & run against a physical iPhone (requires --udid
6669
and XCODE_TEAM_ID). Implies --skip-device. iOS only.
6770
Supported SDKs: cordova, capacitor, react-native, expo.
@@ -116,6 +119,10 @@ USAGE
116119
esac
117120
done
118121

122+
if [[ "$RELEASE" == true ]]; then
123+
"$SCRIPT_DIR/checkout-releases.sh"
124+
fi
125+
119126
# Ensure values set via CLI flags propagate to wdio (which reads them as env).
120127
export APPIUM_PORT
121128
[[ -n "$WDA_LOCAL_PORT" ]] && export WDA_LOCAL_PORT

appium/tests/specs/12_activity.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Live Activities', () => {
4545
const button = await scrollToEl(buttonId);
4646
await button.waitForEnabled({ timeout: 15_000 });
4747
await button.click();
48-
await driver.pause(4000);
48+
await driver.pause(5000);
4949
};
5050

5151
await clickLiveActivityButton('start_live_activity_button');

0 commit comments

Comments
 (0)