我们正在使用 TestCafe 构建一系列测试。我们如何测试传单控件中的点或路径是否正确呈现?更具体地说,我们正在尝试测试 map 中圆形标记的经纬度数据。但是,我们在 testcafe 脚本范围内没有任何可用的传单 map /标记对象。
引用文献:
最佳答案
我在入门演示页面 https://leafletjs.com/examples/quick-start/ 上为传单控件中的路径元素创建了一个简单的断言示例。
import { Selector } from 'testcafe';
fixture `fixture`
.page `https://leafletjs.com/examples/quick-start/`;
test('test', async t => {
await t
.switchToIframe('iframe')
.expect(Selector('path').withAttribute('stroke', 'red').getAttribute('d')).eql('M141.20355555554852,171.94704600190744a42,42 0 1,0 84,0 a42,42 0 1,0 -84,0 ');
});
请向我们提供您的测试页面示例,以便我们能够为您提供更适合您的场景的内容。
关于leaflet - 如何使用 testcafe 测试基于传单的 map ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56432686/