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


TypeScript testing.newE2EPage函數代碼示例

本文整理匯總了TypeScript中@stencil/core/testing.newE2EPage函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript newE2EPage函數的具體用法?TypeScript newE2EPage怎麽用?TypeScript newE2EPage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了newE2EPage函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test

test('action-sheet: noBackdropDismiss', async () => {
  const page = await newE2EPage({
    url: `/src/components/action-sheet/test/no-backdrop-dismiss?ionic:_testing=true`
  });

  const presentBtn = await page.find('#noBackdropDismiss');
  await presentBtn.click();

  let actionSheet = await page.find('ion-action-sheet');
  await actionSheet.waitForVisible();

  let compare = await page.compareScreenshot();
  expect(compare).toMatchScreenshot();

  const backdrop = await page.find('ion-backdrop');
  await backdrop.click();

  compare = await page.compareScreenshot(`dismissed`);
  expect(compare).toMatchScreenshot();

  const isVisible = await actionSheet.isVisible();
  expect(isVisible).toBe(true);

  const cancel = await page.find('.action-sheet-cancel');
  await cancel.click();

  await actionSheet.waitForNotVisible();

  actionSheet = await page.find('ion-action-sheet');
  expect(actionSheet).toBe(null);
});
開發者ID:danieka,項目名稱:ionic,代碼行數:31,代碼來源:e2e.ts

示例2: it

  it('renders', async () => {
    const page = await newE2EPage();
    await page.setContent('<app-home></app-home>');

    const element = await page.find('app-home');
    expect(element).toHaveClass('hydrated');
  });
開發者ID:dturing,項目名稱:wdt,代碼行數:7,代碼來源:app-home.e2e.ts

示例3: test

test('input: basic', async () => {
  const page = await newE2EPage({
    url: '/src/components/input/test/basic?ionic:_testing=true'
  });

  let compare = await page.compareScreenshot();
  expect(compare).toMatchScreenshot();

  const fullInput = await page.find('#fullInput');
  await fullInput.click();

  const fullItem = await page.find('#fullItem');
  expect(fullItem).toHaveClass('item-has-focus');

  compare = await page.compareScreenshot('full input focused');
  expect(compare).toMatchScreenshot();

  const insetInput = await page.find('#insetInput');
  await insetInput.click();

  const insetItem = await page.find('#insetItem');
  expect(insetItem).toHaveClass('item-has-focus');

  compare = await page.compareScreenshot('inset input focused');
  expect(compare).toMatchScreenshot();

  const noneInput = await page.find('#noneInput');
  await noneInput.click();

  const noneItem = await page.find('#noneItem');
  expect(noneItem).toHaveClass('item-has-focus');

  compare = await page.compareScreenshot('no lines input focused');
  expect(compare).toMatchScreenshot();
});
開發者ID:danieka,項目名稱:ionic,代碼行數:35,代碼來源:e2e.ts

示例4: test

test('alert: basic', async () => {
  const page = await newE2EPage({
    url: '/src/components/alert/test/basic?ionic:_testing=true'
  });

  const alerts = [
    ['#basic'],
    ['#longMessage', 'long message'],
    ['#multipleButtons', 'multiple buttons'],
    ['#noMessage', 'no message'],
    ['#confirm', 'confirm'],
    ['#prompt', 'prompt'],
    ['#radio', 'radio'],
    ['#checkbox', 'checkbox']
  ];

  for (const [buttonSelector, message] of alerts) {
    await page.click(buttonSelector);

    const alert = await page.find('ion-alert');
    expect(alert).not.toBe(null);
    await alert.waitForVisible();
    await page.waitFor(250);

    const compare = await page.compareScreenshot(message);
    expect(compare).toMatchScreenshot();
    await alert.callMethod('dismiss');
  }

});
開發者ID:danieka,項目名稱:ionic,代碼行數:30,代碼來源:e2e.ts

示例5: test

test('item-sliding: interactive', async () => {
  const page = await newE2EPage({
    url: '/src/components/item-sliding/test/interactive?ionic:_testing=true'
  });

  const compares = [];
  compares.push(await page.compareScreenshot());

  const items = await page.$$('ion-item-sliding');
  expect(items.length).toEqual(3);

  await slideAndDelete(items[0], page);

  const itemsAfterFirstSlide = await page.$$('ion-item-sliding');
  expect(itemsAfterFirstSlide.length).toEqual(2);

  await slideAndDelete(items[1], page);

  const itemsAfterSecondSlide = await page.$$('ion-item-sliding');
  expect(itemsAfterSecondSlide.length).toEqual(1);

  for (const compare of compares) {
    expect(compare).toMatchScreenshot();
  }
});
開發者ID:btsiders,項目名稱:ionic,代碼行數:25,代碼來源:e2e.ts

示例6: test

test('select: basic', async () => {
  const page = await newE2EPage({
    url: '/src/components/select/test/basic?ionic:_testing=true'
  });

  let compare = await page.compareScreenshot();
  expect(compare).toMatchScreenshot();

  let select = await page.find('#gender');
  await select.click();

  const alert = await page.find('ion-alert');
  await alert.waitForVisible();
  await page.waitFor(250);

  compare = await page.compareScreenshot('should open gender single select');
  expect(compare).toMatchScreenshot();

  await alert.callMethod('dismiss');

  select = await page.find('#customSelect');
  await select.click();

  const actionSheet = await page.find('ion-action-sheet');
  await actionSheet.waitForVisible();
  await page.waitFor(250);

  compare = await page.compareScreenshot('should open custom action sheet select');
  expect(compare).toMatchScreenshot();
});
開發者ID:SnaiCrys,項目名稱:ionic,代碼行數:30,代碼來源:e2e.ts

示例7: test

test('menu: standalone', async () => {

  const page = await newE2EPage({
    url: '/src/components/menu/test/standalone?ionic:_testing=true'
  });

  const start = await page.find('ion-menu[side="start"]');
  expect(start).toHaveClasses([
    'menu-type-overlay',
    'menu-enabled',
    'menu-side-start'
  ]);

  await start.callMethod('open');
  await start.waitForVisible();
  await page.waitFor(250);
  expect(await page.compareScreenshot('start menu')).toMatchScreenshot();

  await start.callMethod('close');
  await page.waitFor(250);

  const end = await page.find('ion-menu[side="end"]');
  expect(end).toHaveClasses([
    'menu-type-push',
    'menu-enabled',
    'menu-side-end'
  ]);

  await end.callMethod('open');
  await end.waitForVisible();
  await page.waitFor(250);
  expect(await page.compareScreenshot('end menu')).toMatchScreenshot();
});
開發者ID:Assperia,項目名稱:ionic,代碼行數:33,代碼來源:e2e.ts


注:本文中的@stencil/core/testing.newE2EPage函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。