Skip to content

Commit

Permalink
chore: convert tests from detox to maestro (maximumDate) (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
henninghall authored Dec 18, 2023
1 parent af3af9d commit 708a61e
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 118 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Test Android e2e
on:
workflow_call:
workflow_dispatch:
inputs:
test-tags:
description: 'Maestro tags to run (comma separated)'
required: false
default: 'android'

env:
APP_PATH: examples/Rn071/android/app/build/outputs/apk/release/app-release.apk
Expand All @@ -28,7 +33,7 @@ jobs:
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: ${{ env.APP_PATH }}
include-tags: android
include-tags: ${{ inputs.test-tags }}

# Step can be removed when this is fixed:
# https://github.com/mobile-dev-inc/action-maestro-cloud/issues/28
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ios-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E tests (ios)
name: Test iOS e2e

on:
workflow_call:
Expand Down
112 changes: 112 additions & 0 deletions .maestro/maximum-date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
appId: com.rn071
tags:
- android
- maximumDate
---
- runFlow: utils/launch.yml

########## describe: cannot pass max date

- runFlow:
file: utils/change-maximum-date.yml
env:
VALUE: '2000-01-01T00:00:00'

### test: datetime mode

- runFlow:
file: utils/change-mode.yml
env:
VALUE: datetime

- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-2.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-3.yml
- assertVisible: '2000-01-01 00:00:00'

### test: date mode

- runFlow:
file: utils/change-mode.yml
env:
VALUE: date

- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-2.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-3.yml
- assertVisible: '2000-01-01 00:00:00'

### test: time mode

- runFlow:
file: utils/change-mode.yml
env:
VALUE: time

- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-2.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-3.yml
- assertVisible: '2000-01-01 00:00:00'

########## describe: overshooting max date

### test: overshooting day wheel should reset to maximum date
- runFlow:
file: utils/change-maximum-date.yml
env:
VALUE: '2000-01-02 00:00:00'
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-02 00:00:00'

### test: overshooting month wheel should set other wheels to max date
- runFlow:
file: utils/change-mode.yml
env:
VALUE: date
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-02 00:00:00'

- runFlow: utils/swipe-wheel-2.yml
- assertVisible: '2000-01-02 00:00:00'

### test: overshooting year wheel should set other wheels to max date
- runFlow:
file: utils/change-maximum-date.yml
env:
VALUE: '2001-01-02 00:00:00'
- runFlow: utils/swipe-wheel-1.yml
- runFlow: utils/swipe-wheel-3.yml
- assertVisible: '2001-01-02 00:00:00'

### test: overshooting in time mode should set other wheels to max date
- runFlow: utils/reset.yml

- runFlow:
file: utils/change-maximum-date.yml
env:
VALUE: '2000-01-01 00:00:00'
- runFlow:
file: utils/change-mode.yml
env:
VALUE: time

- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-2.yml
- assertVisible: '2000-01-01 00:00:00'

- runFlow: utils/swipe-wheel-3.yml
- assertVisible: '2000-01-01 00:00:00'
7 changes: 7 additions & 0 deletions .maestro/utils/change-maximum-date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appId: com.rn071
---
- runFlow:
file: change-prop.yml
env:
PROP: maximumDate
VALUE: ${VALUE}
7 changes: 7 additions & 0 deletions .maestro/utils/change-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appId: com.rn071
---
- runFlow:
file: change-prop.yml
env:
PROP: mode
VALUE: ${VALUE}
116 changes: 0 additions & 116 deletions examples/detox/e2e/tests/maximumDate.spec.js

This file was deleted.

0 comments on commit 708a61e

Please sign in to comment.