本文整理汇总了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));
});
示例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');
});
示例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);
});
示例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]);
});
示例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));
});