11import { expect } from '@wdio/globals' ;
22import { describe , it } from 'mocha' ;
33import { byResourceId , byText , byTextMatches } from '../../utils/selectors' ;
4- import { getTodayFormattedDate } from '../../utils/date' ;
4+ import { getDeviceTimezone , getFormattedDate } from '../../utils/date' ;
55import { output } from '../../utils/naming' ;
66
77let archiveAdded = false ;
88let cleanupNeeded = false ;
9+ let deviceTimezone : string ;
910
1011describe ( 'Remote Archive - Add Success Flow' , ( ) => {
12+ before ( async ( ) => {
13+ deviceTimezone = await getDeviceTimezone ( ) ;
14+ } ) ;
1115 it ( 'navigates to Remote Archive screen' , async ( ) => {
1216 await expect ( $ ( byTextMatches ( 'Remote Archive \\| OFF' ) ) ) . toBeDisplayed ( ) ;
1317 await $ ( byText ( 'View Details' ) ) . click ( ) ;
@@ -51,6 +55,7 @@ describe('Remote Archive - Add Success Flow', () => {
5155 console . warn ( '🛑 Remote Archive addition failed — restarting app' ) ;
5256 await driver . terminateApp ( 'com.comapeo.rc' ) ;
5357 await driver . activateApp ( 'com.comapeo.rc' ) ;
58+ await driver . pause ( 15000 ) ;
5459 return ;
5560 }
5661 await expect ( $ ( byText ( 'Remote Archive Added' ) ) ) . toBeDisplayed ( ) ;
@@ -61,7 +66,7 @@ describe('Remote Archive - Add Success Flow', () => {
6166 await expect ( $ ( byResourceId ( 'RA.archive-name' ) ) ) . toHaveText (
6267 output . remoteServer ,
6368 ) ;
64- const today = getTodayFormattedDate ( ) ;
69+ const today = getFormattedDate ( deviceTimezone ) ;
6570 await expect ( $ ( byText ( today ) ) ) . toBeDisplayed ( ) ;
6671 await expect ( $ ( byTextMatches ( 'Remove Server' ) ) ) . toBeDisplayed ( ) ;
6772 } ) ;
@@ -104,7 +109,7 @@ describe('Remote Archive - Add Success Flow', () => {
104109 console . warn ( '🛑 Remote Archive removal failed — restarting app' ) ;
105110 await driver . terminateApp ( 'com.comapeo.rc' ) ;
106111 await driver . activateApp ( 'com.comapeo.rc' ) ;
107- await driver . pause ( 1000 ) ;
112+ await driver . pause ( 15000 ) ;
108113 return ;
109114 }
110115
0 commit comments