【问题标题】:Testcafe doesn't wait text to be renderedTestcafe doesn\'t wait text to be rendered
【发布时间】:2022-12-01 15:21:18
【问题描述】:
  + expected - actual
  
  -sign.up 
  +Sign up now

Im having this issue while asserting a text. It works if I add a wait delay before. Even though Im using visibilityCheck:true on this selector, it won't wait.

Is there something I can do to avoid manually adding waits?

test("Loads the app in english by default", async (t) => {
  await t.wait(20000);
  const signupText = await signUpPage.signupLink.with({
    visibilityCheck: true,
  })();
  await t.expect(signupText.textContent).eql("Sign up now ");
});

【问题讨论】:

    标签: internationalization e2e-testing testcafe


    【解决方案1】:

    You can use assertion timeout:

    await t.expect(Selector('h1').innerText).eql('text', 'check element text', { timeout: timeoutValue });
    

    【讨论】:

      猜你喜欢
      • 2022-08-25
      • 2022-12-16
      • 2022-12-02
      • 2022-12-02
      • 2019-03-09
      • 2022-12-01
      • 2022-12-01
      • 2022-12-27
      • 2022-12-27
      相关资源
      最近更新 更多