MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / resetUserData

Function resetUserData

e2e/tests/utils.ts:287–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285 await expect(page.locator('#error-action-home-btn')).toBeVisible();
286 await expect(page.locator('#error-action-report')).toBeVisible();
287
288 if (hasSearch) {
289 await expect(page.locator('#error-action-search-btn')).toBeVisible();
290 } else {
291 await expect(page.locator('#error-action-search-btn')).toHaveCount(0);
292 }
293}
294
295export async function resetUserData() {
296 const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
297 const __dirname = path.dirname(__filename);
298 const projectRootDir = path.resolve(__dirname, '../..');
299
300 try {
301 const cmd = `make dev_fake_data -o build -o is_local_migration_ready LOAD_FAKE_DATA_FLAGS='-scope=user -reset'`;
302
303 console.log(`Executing command: ${cmd} in ${projectRootDir}`);
304 execSync(cmd, {cwd: projectRootDir, stdio: 'inherit'});
305
306 console.log('Reset command finished successfully.');
307 } catch (error) {
308 console.error('Error reset command (make dev_fake_data):', error);

Calls 1

Tested by

no test coverage detected