import { deleteAllCookies } from './browser' ; export async function renewSession ( ) { await expireSession ( ) ; const documentElement = await $ ( 'html' ) ; await documentElement . click ( ) ; expect ( await findSessionCookie ( ) ) . toBeDefined ( ) ; } export async function expireSession ( ) { await deleteAllCookies ( ) ; expect ( await findSessionCookie ( ) ) . not . toBeDefined ( ) ; await browser . pause ( 1100 ) ; } async function findSessionCookie ( ) { const cookies = ( await browser . getCookies ( ) ) || [ ] ; return cookies . find ( ( cookie ) => cookie . name === '_dd_s' ) ; }