當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript e2e.pressKeys函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。