• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript testing.newE2EPage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript testing.E2EElement类代码示例发布时间:2022-05-28
下一篇:
TypeScript core.QueueApi类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap