是否可以使用 Testcafe 检查 E2E 测试中的预期颜色代码?
Is it possible to check the expected colorcode in E2E testing using Testcafe?
Is it possible to check the expected colorcode in E2E testing using Testcafe?
Am using Testcafe tool for E2E testing, I wanna check the color is green for the text, How can I check it.. Is it possible to do these type of UI test in E2E test??
是的,您可以使用 TestCafe 来测试您的颜色代码。例如,如果您的颜色是使用 CSS 样式 属性 定义的,您可以按如下方式检查它:
test('check the green color', async t => {
const elementStyle = await Selector('#targetElement').style;
await t.expect(elementStyle.color)
.eql("rgb(0, 128, 0)", "the color must be green!");
});
另请参阅:DOM Node State
Is it possible to check the expected colorcode in E2E testing using Testcafe? Am using Testcafe tool for E2E testing, I wanna check the color is green for the text, How can I check it.. Is it possible to do these type of UI test in E2E test??
是的,您可以使用 TestCafe 来测试您的颜色代码。例如,如果您的颜色是使用 CSS 样式 属性 定义的,您可以按如下方式检查它:
test('check the green color', async t => {
const elementStyle = await Selector('#targetElement').style;
await t.expect(elementStyle.color)
.eql("rgb(0, 128, 0)", "the color must be green!");
});
另请参阅:DOM Node State