小编Jn *_*eer的帖子

TestCafe - 浏览器在测试之间总是以干净的状态启动。如何覆盖它以便浏览器记住缓存、用户设置和存储

测试之间的浏览器始终以干净的状态打开。登录在我的应用程序中被记住,因为身份验证仍然存在,但由于浏览器始终以干净的状态打开,我必须在所有夹具的 Before 挂钩中执行登录。有什么方法可以打开浏览器以便记住用户设置、缓存、本地和会话存储吗?

browser automated-tests web-testing e2e-testing testcafe

4
推荐指数
1
解决办法
1935
查看次数

Test Cafe - Getting error on clicking link which is invisible using Client Function

I have to click on a button that is invisible in Html. I tried using Client Function but I am getting an error for the element

import { Selector,ClientFunction } from 'testcafe';
fixture('Clicking Invisible link').page('http://example.com');

test('Click on invisible link', async t => {
  const viewProgram = Selector('tbody [viewBox]').nth(0);
  const clickViewProgram = ClientFunction(() => viewProgram().click());
  await clickViewProgram(); 
});
Run Code Online (Sandbox Code Playgroud)

The Error that I am getting is :

An error occurred in ClientFunction code: ReferenceError: viewProgram is not defined

Please help me …

javascript testing automated-tests e2e-testing testcafe

2
推荐指数
1
解决办法
155
查看次数