首页 > 解决方案 > TestCafe 在登录过程中失去对弹出窗口的控制

问题描述

目前我正在为我的角度项目进行一些 e2e 测试。我面临的问题是 TestCafe 在单击登录按钮后无法控制新的弹出窗口。有没有办法手动控制新的弹出窗口?

import { Selector } from 'testcafe';

fixture`Getting Started`
  .page`localhost:4200`

const signInButton = Selector('#signInButton')
const userEmail = Selector('#textEmail')
const nextUserEmail = Selector('#nextEmailButton')
const userPassword = Selector('#textPassword')
const nextUserPassword = Selector('#nextPasswordButton')

test('Should login', async t => {
  await t 
    .click(signInButton)
    
  await t
    .typeText(userEmail, 'xy@mail')
    .click(nextUserEmail)

  await t
    .typetext(userPassword, 'pw')
    .click(nextUserPassword)
});

感谢您的帮助和最好的问候

标签: angulartypescriptauthenticatione2e-testingtestcafe

解决方案


推荐阅读