resolve #1 add ignore and block strategy for privacy purpose

This commit is contained in:
Yanzhen Yu
2018-12-02 23:23:21 +08:00
parent 78967192fc
commit 2c9db926c0
6 changed files with 324 additions and 2 deletions

View File

@@ -230,4 +230,21 @@ describe('record integration tests', () => {
);
assert(result.pass, result.pass ? '' : result.report());
}).timeout(10000);
it('should not record input events on ignored elements', async () => {
const page: puppeteer.Page = await this.browser.newPage();
await page.goto('about:blank');
await page.setContent(getHtml.call(this, 'ignore.html'));
await page.type('input[type="password"]', 'password');
await page.type('.rr-ignore', 'secret');
const snapshots = await page.evaluate('window.snapshots');
const result = matchSnapshot(
stringifySnapshots(snapshots),
__filename,
'ignore',
);
assert(result.pass, result.pass ? '' : result.report());
});
});