@ -0,0 +1,120 @@ | |||
appId: com.rn069 | |||
--- | |||
- runFlow: | |||
file: utils/set-timezone.yml | |||
env: | |||
TIMEZONE: Sweden | |||
GMT: GMT+01:00 | |||
- runFlow: utils/launch.yml | |||
# test: timezone offset with undefined | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-01-01 00:01:00' | |||
- assertVisible: 'Sat Jan 11201 AM ' | |||
- runFlow: utils/reset.yml | |||
# test: timezone offset with 0 | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: timeZoneOffsetInMinutes | |||
VALUE: 0 | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-01-01 00:01:00' | |||
- assertVisible: 'Fri Dec 311101 PM ' | |||
- runFlow: utils/reset.yml | |||
# test: timezone offset with 180 | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: timeZoneOffsetInMinutes | |||
VALUE: 180 | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-01-01 00:01:00' | |||
- assertVisible: 'Sat Jan 1201 AM ' | |||
- runFlow: utils/reset.yml | |||
# test: timezone offset with -180 | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: timeZoneOffsetInMinutes | |||
VALUE: -180 | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-01-01 00:01:00' | |||
- assertVisible: 'Fri Dec 31801 PM ' | |||
########## describe: DAYLIGHT SAVING | |||
- runFlow: | |||
file: utils/set-timezone.yml | |||
env: | |||
TIMEZONE: Sweden | |||
GMT: GMT+02:00 | |||
- runFlow: utils/launch.yml | |||
# test: timezone offset undefined | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: maximumDate | |||
VALUE: '2000-07-01T00:00:00' | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: date | |||
VALUE: '2000-06-01T00:00:00+02:00' | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-06-01 00:01:00' | |||
- assertVisible: 'Thu Jun 11201 AM ' | |||
- runFlow: utils/reset.yml | |||
# # test: timezone offset 0 | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: maximumDate | |||
VALUE: '2000-07-01T00:00:00' | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: date | |||
VALUE: '2000-06-01T00:00:00+02:00' | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: timeZoneOffsetInMinutes | |||
VALUE: 0 | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-06-01 00:01:00' | |||
- assertVisible: 'Wed May 311001 PM ' | |||
- runFlow: utils/reset.yml | |||
# test: timezone offset 180 | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: maximumDate | |||
VALUE: '2000-07-01T00:00:00' | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: date | |||
VALUE: '2000-06-01T00:00:00+02:00' | |||
- runFlow: | |||
file: utils/change-prop.yml | |||
env: | |||
PROP: timeZoneOffsetInMinutes | |||
VALUE: 180 | |||
- runFlow: utils/swipe-wheel-3.yml | |||
- assertVisible: '2000-06-01 00:01:00' | |||
- assertVisible: 'Thu Jun 1101 AM ' | |||
- runFlow: utils/reset.yml |
@ -0,0 +1,4 @@ | |||
appId: com.android.settings | |||
--- | |||
- tapOn: 'Use network-provided time zone' | |||
- tapOn: 'Time zone' |
@ -0,0 +1,7 @@ | |||
appId: com.android.settings | |||
--- | |||
- scrollUntilVisible: | |||
element: | |||
text: 'Settings' | |||
- tapOn: 'Settings' | |||
- tapOn: 'Open' |
@ -0,0 +1,4 @@ | |||
appId: com.rn069 | |||
--- | |||
- tapOn: 'Go back' | |||
- tapOn: Advanced |
@ -0,0 +1,4 @@ | |||
appId: com.android.settings | |||
--- | |||
- tapOn: Region | |||
- inputText: ${TIMEZONE} |
@ -0,0 +1,7 @@ | |||
appId: com.android.settings | |||
--- | |||
- tapOn: 'Select UTC offset' | |||
- scrollUntilVisible: | |||
element: | |||
text: ${GMT} | |||
- tapOn: ${GMT} |
@ -0,0 +1,8 @@ | |||
appId: com.android.settings | |||
--- | |||
- runFlow: | |||
file: set-timezone.yml | |||
env: | |||
TIMEZONE: 'United states' | |||
GMT: ${GMT} | |||
- tapOn: ${STATE} |
@ -0,0 +1,32 @@ | |||
appId: com.android.settings | |||
--- | |||
- launchApp | |||
- runFlow: | |||
when: | |||
visible: 'App info' | |||
file: goto-settings-from-app-info.yml | |||
- tapOn: 'Search settings' | |||
- inputText: 'Date' | |||
- tapOn: 'Date & time' | |||
- tapOn: 'Date & time' | |||
- tapOn: 'Time zone' | |||
- runFlow: | |||
when: | |||
notVisible: 'Select time zone' | |||
file: disable-network-time-zone.yml | |||
# on some devices (maestro cloud) "Select UTC offset" is displayed instead of Region | |||
- runFlow: | |||
when: | |||
visible: 'Select UTC offset' | |||
file: select-utc-offset.yml | |||
env: | |||
GMT: ${GMT} | |||
# on most(?) devices timezone is selected by picking region | |||
- runFlow: | |||
when: | |||
visible: Region | |||
file: select-region.yml | |||
env: | |||
TIMEZONE: ${TIMEZONE} |
@ -0,0 +1,5 @@ | |||
appId: com.rn069 | |||
--- | |||
- swipe: | |||
start: 63%, 40% | |||
end: 63%, 35% |
@ -0,0 +1,8 @@ | |||
appId: com.android.settings | |||
--- | |||
- runFlow: | |||
when: | |||
visible: ${TEXT} | |||
file: tap.yml | |||
env: | |||
TEXT: ${TEXT} |
@ -0,0 +1,3 @@ | |||
appId: com.android.settings | |||
--- | |||
- tapOn: ${TEXT} |
@ -1,82 +0,0 @@ | |||
const { | |||
setTimeZoneOffsetInMinutes, | |||
expectDate, | |||
scrollWheel, | |||
expectDateString, | |||
setMaximumDate, | |||
setDate, | |||
init, | |||
} = require('../utils'); | |||
const scrollMinuteWheel = () => scrollWheel(2, 1); | |||
// I haven't found a way to change the timezone on the emulator to be able to run these tests. | |||
// Until possible, run these tests locally when needed with Europe/Stockholm timezone. | |||
describe.skip('Timezone offset', () => { | |||
beforeAll(async () => { | |||
await init(); | |||
await element(by.text('Advanced')).tap(); | |||
}); | |||
it('undefined (default)', async () => { | |||
await setTimeZoneOffsetInMinutes(undefined); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-01-01 00:01:00'); | |||
await expectDateString('Sat Jan 11201 AM '); | |||
}); | |||
it('0', async () => { | |||
await setTimeZoneOffsetInMinutes(0); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-01-01 00:01:00'); | |||
await expectDateString('Fri Dec 311101 PM '); | |||
}); | |||
it('180', async () => { | |||
await setTimeZoneOffsetInMinutes(180); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-01-01 00:01:00'); | |||
await expectDateString('Sat Jan 1201 AM '); | |||
}); | |||
it('-180', async () => { | |||
await setTimeZoneOffsetInMinutes(-180); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-01-01 00:01:00'); | |||
await expectDateString('Fri Dec 31801 PM '); | |||
}); | |||
describe('daylight saving', () => { | |||
const firstOfJuly = new Date(2000, 6, 1, 0, 0); | |||
const firstOfJune = new Date(2000, 5, 1, 0, 0); | |||
beforeAll(async () => { | |||
await setMaximumDate(firstOfJuly); | |||
await setDate(firstOfJune); | |||
}); | |||
it('undefined', async () => { | |||
await setDate(firstOfJune); | |||
await setTimeZoneOffsetInMinutes(undefined); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-06-01 00:01:00'); | |||
await expectDateString('Thu Jun 11201 AM '); | |||
}); | |||
it('0', async () => { | |||
await setDate(firstOfJune); | |||
await setTimeZoneOffsetInMinutes(0); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-06-01 00:01:00'); | |||
await expectDateString('Wed May 311001 PM '); | |||
}); | |||
it('180', async () => { | |||
await setDate(firstOfJune); | |||
await setTimeZoneOffsetInMinutes(180); | |||
await scrollMinuteWheel(); | |||
await expectDate('2000-06-01 00:01:00'); | |||
await expectDateString('Thu Jun 1101 AM '); | |||
}); | |||
}); | |||
}); |
@ -1,81 +0,0 @@ | |||
const { | |||
setTimeZoneOffsetInMinutes, | |||
expectDate, | |||
scrollWheel, | |||
expectDateString, | |||
setMaximumDate, | |||
setDate, | |||
} = require('../utils') | |||
const scrollMinuteWheel = () => scrollWheel(2, 1) | |||
// I haven't found a way to change the timezone on the emulator to be able to run these tests. | |||
// Until possible, run these tests locally when needed with Europe/Stockholm timezone. | |||
describe.skip('Timezone offset', () => { | |||
before(async () => { | |||
await device.reloadReactNative() | |||
await element(by.text('Advanced')).tap() | |||
}) | |||
it('undefined (default)', async () => { | |||
await setTimeZoneOffsetInMinutes(undefined) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-01-01 00:01:00') | |||
await expectDateString('Sat Jan 11201 AM ') | |||
}) | |||
it('0', async () => { | |||
await setTimeZoneOffsetInMinutes(0) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-01-01 00:01:00') | |||
await expectDateString('Fri Dec 311101 PM ') | |||
}) | |||
it('180', async () => { | |||
await setTimeZoneOffsetInMinutes(180) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-01-01 00:01:00') | |||
await expectDateString('Sat Jan 1201 AM ') | |||
}) | |||
it('-180', async () => { | |||
await setTimeZoneOffsetInMinutes(-180) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-01-01 00:01:00') | |||
await expectDateString('Fri Dec 31801 PM ') | |||
}) | |||
describe('daylight saving', () => { | |||
const firstOfJuly = new Date(2000, 6, 1, 0, 0) | |||
const firstOfJune = new Date(2000, 5, 1, 0, 0) | |||
before(async () => { | |||
await setMaximumDate(firstOfJuly) | |||
await setDate(firstOfJune) | |||
}) | |||
it('undefined', async () => { | |||
await setDate(firstOfJune) | |||
await setTimeZoneOffsetInMinutes(undefined) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-06-01 00:01:00') | |||
await expectDateString('Thu Jun 11201 AM ') | |||
}) | |||
it('0', async () => { | |||
await setDate(firstOfJune) | |||
await setTimeZoneOffsetInMinutes(0) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-06-01 00:01:00') | |||
await expectDateString('Wed May 311001 PM ') | |||
}) | |||
it('180', async () => { | |||
await setDate(firstOfJune) | |||
await setTimeZoneOffsetInMinutes(180) | |||
await scrollMinuteWheel() | |||
await expectDate('2000-06-01 00:01:00') | |||
await expectDateString('Thu Jun 1101 AM ') | |||
}) | |||
}) | |||
}) |