angular - 使用TestCafe登录后如何捕获角度页面?
问题描述
我可以使用 TestCafe 代码登录应用程序。但是登录后,它会重定向到 Angular 应用程序,我正在尝试捕获该页面中的元素。但每次我收到以下错误。ClientFunction 执行被页面卸载中断。如果您从 ClientFunction 代码触发页面导航,则可能会出现此问题。
我试过 waitforAngular(); 到目前为止仍然没有运气。单击下一个按钮后,找不到选择器失败
import Page from './basic-page-model';
import { waitForAngular } from 'testcafe-angular-selectors';
// import { LoginPage } from './LoginPage';
const page = new Page();
fixture `My first fixture`
.page `https://test.ci.ai.dynamics.com`
.beforeEach(async t => {
await t
.typeText(page.nameInput, 'xxxxxx')
.click(page.nextButton)
});
test('My first test', async t => {
await waitForAngular();
await t
const header = await Selector('.d365shell-c-brand-title');
let headerText = await header.innerText;
await t
.expect(headerText).eql('Dynamics 365');
});
解决方案
如果没有详细的研究,很难确定问题的原因。请使用此表单和 TestCafe 团队的测试帐户在 TestCafe 存储库中创建单独的错误报告。这将帮助我们更快地找到解决方案。如果您无法在公共站点上共享凭据,请将您的报告发送至 support@devexpress.com。
推荐阅读
- python - 查看 string.maketrans 的输出
- azure-data-factory - 对查找活动中的项目进行排序
- eclipse - 如何获取 Eclipse 无头构建的工具 ID
- python - 为什么 numpy 超越数对大于 2^64-1 的整数参数给出“无属性”错误?
- python-3.x - 转向卷积层的零填充输入问题
- c++11 - 何时使用完美转发,何时明确?
- android - Android App Project 停止编译,grade.build 出错
- angularjs - 使用angularjs提供日期时获取一个月的所有日期
- android - Google Maps API 安装警告
- typescript - 如何迭代泛型类型的属性?