// What about this as a compromise? function test() { page.loadAndWaitForSignInUi() .then(page.setViewportSize.bind(page, 1300, 500); .then(page.patchStreamScribe.bind(page)) .then(page.login.bind(page, account.creds)); }