小编Rob*_*b C的帖子

无法通过 npm 链接运行本地版本的 testcafe

每当我尝试运行本地安装的 testcafe 版本时,我都会收到错误Cannot find module '../testcafe/lib/cli'. 我采取的步骤:

  1. git clone <testcafe>,然后 cd 到 testcafe
  2. npm install
  3. npm link
  4. cd 到我的自动化测试所在的仓库
  5. npm link testcafe
  6. testcafe <browser>

结果是

internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/Users/rcooper/testcafe/lib/cli'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Run Code Online (Sandbox Code Playgroud)

我还需要做些什么来运行这个库的本地版本吗?

testing automation automated-tests e2e-testing testcafe

3
推荐指数
1
解决办法
136
查看次数

TestCafe .click不会在iFrame中触发onClick事件

我正在尝试使付款系统自动化,其中“用PayPal付款”按钮位于iFrame中。我已经搜索了TestCafe的支持页面,但似乎无法解决问题。

TestCafe认为它已经单击了按钮,因此在下一步(输入电子邮件地址)时失败。

我正在使用什么:

const payPalFrame = Selector('#paypal-button iframe');
const payPalButton = Selector('[name="paypal"]')

async payWithPaypal () {
    await t
        .switchToIframe(payPalFrame)
        .click(payPalButton)
        .switchToMainWindow();
}
Run Code Online (Sandbox Code Playgroud)

我试图编写一个ClientFunction,但是对JS / Node来说还是比较新的东西,什么也没用。

iframe automated-tests clicking e2e-testing testcafe

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