// cypress was failing when trying to find cypress-promise import cyPromise from '../../node_modules/cypress-promise/index' import { inputID, inputPreFilledID } from './staticTestValues' interface LoadedPageProps { $input: HTMLInputElement $inputPreFilled: HTMLInputElement document: Document window: Window } export type LoadedPage = Promise export const loadTestPage = (htmlFilePath = './cypress/test-file.html'): LoadedPage => { return cyPromise(cy.visit(htmlFilePath)).then((contentWindow: Window) => { const { document } = contentWindow const $input = document.getElementById(inputID) const $inputPreFilled = document.getElementById(inputPreFilledID) return { $input, $inputPreFilled, document, window: contentWindow } }) }