本文整理汇总了TypeScript中@angular/cdk/testing/e2e.pressKeys函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pressKeys函数的具体用法?TypeScript pressKeys怎么用?TypeScript pressKeys使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pressKeys函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should skip disabled items using arrow keys', async () => {
await pressKeys(Key.ENTER, Key.DOWN, Key.DOWN);
await expectFocusOn(page.items(3));
await pressKeys(Key.UP);
await expectFocusOn(page.items(1));
});
开发者ID:codef0rmer,项目名称:material2,代码行数:7,代码来源:menu.e2e.spec.ts
示例2: it
it('should be able to prevent closing by pressing escape', async () => {
await element(by.id('disabled')).click();
await waitForDialog();
await pressKeys(Key.ESCAPE);
await expectToExist('mat-dialog-container');
});
开发者ID:codef0rmer,项目名称:material2,代码行数:7,代码来源:dialog.e2e.spec.ts
示例3: async
async () => {
await element(by.id('default')).click();
await waitForDialog();
await clickElementAtPoint('mat-dialog-container', { x: 0, y: 0 });
await pressKeys(Key.ESCAPE);
await expectToExist('mat-dialog-container', false);
});
开发者ID:codef0rmer,项目名称:material2,代码行数:8,代码来源:dialog.e2e.spec.ts
示例4: it
it('should change focus with keyboard interaction', async () => {
const right = Key.RIGHT;
const left = Key.LEFT;
await tabLabels.get(0).click();
expect(await getFocusStates(tabLabels)).toEqual([true, false, false]);
await pressKeys(right);
expect(await getFocusStates(tabLabels)).toEqual([false, true, false]);
await pressKeys(right);
expect(await getFocusStates(tabLabels)).toEqual([false, false, true]);
await pressKeys(left);
expect(await getFocusStates(tabLabels)).toEqual([false, true, false]);
await pressKeys(left);
expect(await getFocusStates(tabLabels)).toEqual([true, false, false]);
});
开发者ID:codef0rmer,项目名称:material2,代码行数:19,代码来源:tabs.e2e.spec.ts
示例5: it
it('should change focus with keyboard interaction', async () => {
const stepHeaders = element.all(by.css('mat-step-header'));
await stepHeaders.get(0).click();
await expectFocusOn(stepHeaders.get(0));
await pressKeys(Key.RIGHT);
await expectFocusOn(stepHeaders.get(1));
await pressKeys(Key.RIGHT);
await expectFocusOn(stepHeaders.get(2));
await pressKeys(Key.RIGHT);
await expectFocusOn(stepHeaders.get(0));
await pressKeys(Key.LEFT);
await expectFocusOn(stepHeaders.get(2));
await pressKeys(Key.SPACE, Key.ENTER);
await expectFocusOn(stepHeaders.get(2));
});
开发者ID:codef0rmer,项目名称:material2,代码行数:21,代码来源:stepper.e2e.spec.ts
注:本文中的@angular/cdk/testing/e2e.pressKeys函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论