amp*_*mpc 4 testing automated-tests google-chrome typescript testcafe
我正在使用TestCafe并尝试将Percy集成到视觉回归测试中.我已经导入了Percy SDK,但是我收到了这个错误ReferenceError: XMLHttpRequest is not defined.任何有关如何实现这一点的见解都会有所帮助.
const PercyAgent = require('@percy/agent').default;
export default class Helper {
takeSnapshot(snapshotName: any, snapshotOptions: any) {
const percyAgentClient = new PercyAgent({
clientInfo: 'awesome-percy-sdk@0.0.1',
environmentInfo: 'some helpful os or browser information for debugging',
});
percyAgentClient.snapshot(snapshotName, snapshotOptions);
}
}
Run Code Online (Sandbox Code Playgroud)
test('Regression | Login with wrong credentials | 102', async (t) => {
loginPage.login('not_existent@xpta.com', 'RandomPassword1');
await t.expect(loginPage.errorMessage.visible).ok();
await t.debug();
await t.expect(loginPage.errorMessage.innerText).eql('Invalid username or password.');
await helper.takeSnapshot('wrong credentials', {});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
296 次 |
| 最近记录: |