Browse Source

chore: move tests to maestro (minimumDate) (#742)

master
Henning Hall 1 year ago
committed by GitHub
parent
commit
1ab9152263
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 130 additions and 146 deletions
  1. +6
    -20
      .maestro/maximum-date.yml
  2. +78
    -0
      .maestro/minimum-date.yml
  3. +6
    -0
      .maestro/utils/change-mode-date.yml
  4. +6
    -0
      .maestro/utils/change-mode-datetime.yml
  5. +6
    -0
      .maestro/utils/change-mode-time.yml
  6. +5
    -0
      .maestro/utils/swipe-wheel-1-down.yml
  7. +5
    -0
      .maestro/utils/swipe-wheel-1-up.yml
  8. +8
    -3
      .maestro/utils/swipe-wheel-1.yml
  9. +5
    -0
      .maestro/utils/swipe-wheel-2-up.yml
  10. +5
    -0
      .maestro/utils/swipe-wheel-3-up.yml
  11. +0
    -123
      examples/detox/e2e/tests/minimumDate.spec.js

+ 6
- 20
.maestro/maximum-date.yml View File

@ -14,10 +14,7 @@ tags:
### test: datetime mode
- runFlow:
file: utils/change-mode.yml
env:
VALUE: datetime
- runFlow: utils/change-mode-datetime.yml
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'
@ -30,10 +27,7 @@ tags:
### test: date mode
- runFlow:
file: utils/change-mode.yml
env:
VALUE: date
- runFlow: utils/change-mode-date.yml
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'
@ -46,10 +40,7 @@ tags:
### test: time mode
- runFlow:
file: utils/change-mode.yml
env:
VALUE: time
- runFlow: utils/change-mode-time.yml
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'
@ -72,10 +63,7 @@ tags:
- 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/change-mode-date.yml
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-02 00:00:00'
@ -98,10 +86,8 @@ tags:
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/change-mode-time.yml
- runFlow: utils/swipe-wheel-1.yml
- assertVisible: '2000-01-01 00:00:00'

+ 78
- 0
.maestro/minimum-date.yml View File

@ -0,0 +1,78 @@
appId: com.rn071
tags:
- android
- minimumDate
---
- runFlow: utils/launch.yml
########## describe: cannot pass min date
- runFlow:
file: utils/change-minimum-date.yml
env:
VALUE: '2000-01-01 23:59:00'
- runFlow:
file: utils/change-prop.yml
env:
PROP: date
VALUE: '2000-01-01 23:59:00'
# ### test: datetime mode
- runFlow: utils/swipe-wheel-1-up.yml
- assertVisible: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-2-up.yml
- assertVisible: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-3-up.yml
- assertVisible: '2000-01-01 23:59:00'
### test: date mode
- runFlow: utils/change-mode-date.yml
- runFlow:
file: utils/change-prop.yml
env:
PROP: date
VALUE: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-1-up.yml
- assertVisible: '2000-01-06 00:00:00'
- runFlow:
file: utils/change-prop.yml
env:
PROP: date
VALUE: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-2-up.yml
- assertVisible: '2000-01-06 00:00:00'
- runFlow:
file: utils/change-prop.yml
env:
PROP: date
VALUE: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-3-up.yml
- assertVisible: '2000-01-01 23:59:00'
########## describe: overshooting min date
- runFlow: utils/reset.yml
- runFlow: utils/change-mode-time.yml
- runFlow:
file: utils/change-minimum-date.yml
env:
VALUE: '2000-01-01 23:59:00'
### test: overshooting in time mode should set other wheels to max date
- runFlow: utils/swipe-wheel-1-up.yml
- assertVisible: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-2-up.yml
- assertVisible: '2000-01-01 23:59:00'
- runFlow: utils/swipe-wheel-3-up.yml
- assertVisible: '2000-01-01 23:59:00'

+ 6
- 0
.maestro/utils/change-mode-date.yml View File

@ -0,0 +1,6 @@
appId: com.rn071
---
- runFlow:
file: change-mode.yml
env:
VALUE: date

+ 6
- 0
.maestro/utils/change-mode-datetime.yml View File

@ -0,0 +1,6 @@
appId: com.rn071
---
- runFlow:
file: change-mode.yml
env:
VALUE: datetime

+ 6
- 0
.maestro/utils/change-mode-time.yml View File

@ -0,0 +1,6 @@
appId: com.rn071
---
- runFlow:
file: change-mode.yml
env:
VALUE: time

+ 5
- 0
.maestro/utils/swipe-wheel-1-down.yml View File

@ -0,0 +1,5 @@
appId: com.rn071
---
- swipe:
start: 25%, 40%
end: 25%, 35%

+ 5
- 0
.maestro/utils/swipe-wheel-1-up.yml View File

@ -0,0 +1,5 @@
appId: com.rn071
---
- swipe:
start: 38%, 30%
end: 38%, 35%

+ 8
- 3
.maestro/utils/swipe-wheel-1.yml View File

@ -1,5 +1,10 @@
appId: com.rn071
---
- swipe:
start: 25%, 40%
end: 25%, 35%
- runFlow:
when:
true: ${DIRECTION == 'UP'}
file: swipe-wheel-1-up.yml
- runFlow:
when:
true: ${DIRECTION != 'UP'}
file: swipe-wheel-1-down.yml

+ 5
- 0
.maestro/utils/swipe-wheel-2-up.yml View File

@ -0,0 +1,5 @@
appId: com.rn071
---
- swipe:
start: 50%, 30%
end: 50%, 35%

+ 5
- 0
.maestro/utils/swipe-wheel-3-up.yml View File

@ -0,0 +1,5 @@
appId: com.rn071
---
- swipe:
start: 65%, 30%
end: 65%, 35%

+ 0
- 123
examples/detox/e2e/tests/minimumDate.spec.js View File

@ -1,123 +0,0 @@
const {
setDate,
scrollWheel,
expectDate,
setMinimumDate,
setMode,
} = require('../utils')
const oneMinuteBeforeJanuary2 = new Date(2000, 0, 1, 23, 59, 0)
describe('Minimum date', () => {
before(async () => {
await device.reloadReactNative()
await element(by.text('Advanced')).tap()
})
beforeEach(async () => {
await setDate(oneMinuteBeforeJanuary2.toISOString())
})
describe('cannot pass min date - mode: ', () => {
describe('datetime', () => {
before(async () => {
await setMode('datetime')
await setMinimumDate(oneMinuteBeforeJanuary2)
})
it('day wheel', async () => {
await scrollWheel(0, -2)
await expectDate('2000-01-01 23:59:00')
})
it('hour wheel', async () => {
await scrollWheel(1, -1)
await expectDate('2000-01-01 23:59:00')
})
it('minute wheel', async () => {
await scrollWheel(2, -1)
await expectDate('2000-01-01 23:59:00')
})
})
describe('date', () => {
before(async () => {
await setMode('date')
await setMinimumDate(oneMinuteBeforeJanuary2)
})
it('month wheel', async () => {
await scrollWheel(0, -1)
await expectDate('2000-01-06 00:00:00')
})
it('date wheel', async () => {
await scrollWheel(1, -1)
await expectDate('2000-01-06 00:00:00')
})
it('year wheel', async () => {
await scrollWheel(2, -1)
await expectDate('2000-01-01 23:59:00')
})
})
})
describe('overshooting min date - mode:', () => {
before(async () => {
await setMinimumDate(oneMinuteBeforeJanuary2)
})
describe('datetime', () => {
before(async () => {
await setMode('datetime')
})
it('day wheel should not be possible to overshoot since it is not wrapping (no invalid dates exists)', async () => {
await scrollWheel(0, -1)
await expectDate('2000-01-01 23:59:00')
await scrollWheel(0, -1)
await expectDate('2000-01-01 23:59:00')
})
})
describe('date', () => {
before(async () => {
await setMode('date')
})
it('overshooting month wheel should set all other wheels to maximum possible date', async () => {
await scrollWheel(0, -1)
await expectDate('2000-01-06 00:00:00')
})
it('overshooting date wheel should reverse to maximum possible date', async () => {
await scrollWheel(1, -5)
await expectDate('2000-01-06 00:00:00')
})
})
describe('time mode', () => {
before(async () => {
await setMode('time')
await setMinimumDate(oneMinuteBeforeJanuary2)
})
it('overshooting hour wheel should reverse to minimum possible time', async () => {
await scrollWheel(0, -5)
await expectDate('2000-01-01 23:59:00')
})
it('overshooting minute wheel should reverse to minimum possible time', async () => {
await scrollWheel(1, -5)
await expectDate('2000-01-01 23:59:00')
})
it('overshooting am/pm wheel should reverse to minimum possible time', async () => {
await scrollWheel(2, -1)
await expectDate('2000-01-01 23:59:00')
})
})
})
})

Loading…
Cancel
Save