我想在正则表达式断言中添加一个变量“ example”。
const example = Selector('xyz');
await t.expect(getLocation()).match(/^https:\/\/int-.*.example.com\/en\/example\/-\/ ** HERE SHOULD BE INSERTED A VARIABLE, 'example' ** \/$/)
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我想检查我创建的页面上是否存在“64”。
const x = Selector('.FilterCockpit--header--count').withText('64');
Run Code Online (Sandbox Code Playgroud)
以下测试失败。
test('x', async t => {
await t
.expect((x).exists).ok()
});
Run Code Online (Sandbox Code Playgroud)
HTML 代码:
<div class="FilterCockpit--header--results">
<span class="FilterCockpit--header--count">
64
</span>
Results
</div>
Run Code Online (Sandbox Code Playgroud)
我做错了什么?预先感谢您的帮助。