| 213 | } |
| 214 | |
| 215 | async setupLocalStorage() { |
| 216 | const setting = { |
| 217 | openAiApiKey: "test-openai-key", |
| 218 | openAiBaseURL: null, |
| 219 | anthropicApiKey: "test-anthropic-key", |
| 220 | screenshotOneApiKey: "test-screenshotone-key", |
| 221 | isImageGenerationEnabled: true, |
| 222 | editorTheme: "cobalt", |
| 223 | generatedCodeConfig: this.stack, |
| 224 | codeGenerationModel: this.model, |
| 225 | isTermOfServiceAccepted: true, |
| 226 | accessCode: null, |
| 227 | }; |
| 228 | |
| 229 | await this.page.evaluate((nextSetting) => { |
| 230 | localStorage.setItem("setting", JSON.stringify(nextSetting)); |
| 231 | }, setting); |
| 232 | |
| 233 | await this.page.reload({ waitUntil: "networkidle0" }); |
| 234 | } |
| 235 | |
| 236 | async resetTestHooks() { |
| 237 | await this.page.evaluate(() => { |