有没有一种方法可以在Testcafe中断言页面的方向?(例如断言RTL为真)



我即将为一个具有通过<dir=";自动>。在testcafe中,有没有一种方法可以指定或断言方向是RTL,或者我必须在页面源中输出一些东西才能断言?

这方面的任何帮助都将是伟大的,谢谢!

断言它的唯一方法是使用evalClientFunction。例如:

import { ClientFunction } from 'testcafe';
const getDocumentDirection = ClientFunction(() => {
return getComputedStyle(document.documentElement).direction;
})
fixture('Getting Started')
.page('https://devexpress.github.io/testcafe/example');
test('My first test', async t => {
await t
.expect(getDocumentDirection()).eql('ltr');
});

最新更新