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

TypeScript agar.Waiter类代码示例

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

本文整理汇总了TypeScript中@ephox/agar.Waiter的典型用法代码示例。如果您正苦于以下问题:TypeScript Waiter类的具体用法?TypeScript Waiter怎么用?TypeScript Waiter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Waiter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

 const sTestPlaceholder = function (ui, editor, apis, url, expected, struct) {
   return GeneralSteps.sequence([
     Utils.sOpenDialog(ui),
     Utils.sSetFormItemNoEvent(ui, url),
     ui.sClickOnUi('click checkbox', 'div.mce-primary > button'),
     Utils.sAssertEditorContent(apis, editor, expected),
     Waiter.sTryUntil('Wait for structure check',
       apis.sAssertContentStructure(struct),
       100, 3000),
     apis.sSetContent('')
   ]);
 };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:12,代码来源:PlaceholderTest.ts


示例2: function

 const sTestPlaceholder = function (ui, editor, apis, url, expected, struct) {
   return Logger.t(`Test placeholder ${expected}`, GeneralSteps.sequence([
     Utils.sOpenDialog(ui),
     Utils.sSetFormItemNoEvent(ui, url),
     ui.sClickOnUi('click checkbox', Utils.selectors.saveButton),
     Utils.sAssertEditorContent(apis, editor, expected),
     Waiter.sTryUntil('Wait for structure check',
       apis.sAssertContentStructure(struct),
       100, 3000),
     apis.sSetContent('')
   ]));
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:PlaceholderTest.ts


示例3: function

 const sParseStyles = function (editor) {
   return GeneralSteps.sequence([
     Step.sync(function () {
       editor.setContent('<html><head><style>p {text-align:right}</style></head><body dir="rtl"><p>Test</p></body></html>');
     }),
     Waiter.sTryUntil(
       'Expected styles where not added',
       Step.sync(function () {
         Assertions.assertEq('Styles added to iframe document', 'right', editor.dom.getStyle(editor.getBody().firstChild, 'text-align', true));
       }
     ), 10, 3000)
   ]);
 };
开发者ID:abstask,项目名称:tinymce,代码行数:13,代码来源:FullPagePluginTest.ts


示例4: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);

    Pipeline.async({}, Arr.flatten([
      [
        Logger.t('Fullscreen toggle scroll state', GeneralSteps.sequence([
          tinyApis.sExecCommand('mceFullScreen'),
          sAssertScroll(editor, true),
          tinyApis.sExecCommand('mceFullScreen'),
          sAssertScroll(editor, false)
        ])),
        Logger.t('Editor size increase based on content size', GeneralSteps.sequence([
          tinyApis.sSetContent('<div style="height: 5000px;">a</div>'),
          Waiter.sTryUntil('wait for editor height', sAssertEditorHeightAbove(editor, 5000), 10, 3000)
        ])),
        Logger.t('Editor size decrease based on content size', GeneralSteps.sequence([
          tinyApis.sSetContent('<div style="height: 1000px;">a</div>'),
          Waiter.sTryUntil('wait for editor height', sAssertEditorHeightBelow(editor, 2000), 10, 3000)
        ]))
      ],

      // These tests doesn't work on phantom since measuring things seems broken there
      navigator.userAgent.indexOf('PhantomJS') === -1 ? [
        Logger.t('Editor size decrease content to 1000 based and restrict by max height', GeneralSteps.sequence([
          tinyApis.sSetSetting('autoresize_max_height', 200),
          tinyApis.sSetContent('<div style="height: 1000px;">a</div>'),
          Waiter.sTryUntil('wait for editor height', sAssertEditorHeightBelow(editor, 500), 10, 3000),
          tinyApis.sSetSetting('autoresize_max_height', 0)
        ])),
        Logger.t('Editor size decrease content to 10 and set min height to 500', GeneralSteps.sequence([
          tinyApis.sSetSetting('autoresize_min_height', 500),
          tinyApis.sSetContent('<div style="height: 10px;">a</div>'),
          Waiter.sTryUntil('wait for editor height', sAssertEditorHeightAbove(editor, 300), 10, 3000),
          tinyApis.sSetSetting('autoresize_min_height', 0)
        ]))
      ] : []
    ]), onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:38,代码来源:AutoresizePluginTest.ts


示例5:

 const sAssertColour = (label: string, expected: string, labelText: string) =>
   Logger.t(
     label,
     Waiter.sTryUntil(
       'Waiting until hex updates the other fields',
       Chain.asStep(component.element(), [
         UiFinder.cFindIn(`label:contains("${labelText}") + input`),
         UiControls.cGetValue,
         Assertions.cAssertEq('Checking value in input', expected)
       ]),
       100,
       1000
     )
   );
开发者ID:tinymce,项目名称:tinymce,代码行数:14,代码来源:ColorPickerTest.ts


示例6: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const api = TinyApis(editor);
    const ui = TinyUi(editor);

    // Cut doesn't seem to work in webdriver mode on ie, firefox is producing moveto not supported, edge fails if it's not observed
    Pipeline.async({}, (platform.browser.isIE() || platform.browser.isFirefox() || platform.browser.isEdge()) ? [] : [
      api.sSetContent('<p>abc</p>'),
      api.sSetSelection([0, 0], 1, [0, 0], 2),
      ui.sClickOnMenu('Click Edit menu', 'button:contains("Edit")'),
      ui.sWaitForUi('Wait for dropdown', '.mce-floatpanel[role="application"]'),
      RealMouse.sClickOn('.mce-i-cut'),
      Waiter.sTryUntil('Cut is async now, so need to wait for content', api.sAssertContent('<p>ac</p>'), 100, 1000)
    ], onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:14,代码来源:CutTest.ts


示例7: TinyUi

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const ui = TinyUi(editor);

    Pipeline.async({}, [
      Utils.sOpenDialog(ui),
      ui.sClickOnUi('Click on close button', 'button:contains("Ok")'),
      Waiter.sTryUntil(
        'Wait for dialog to close',
        UiFinder.sNotExists(TinyDom.fromDom(document.body), 'div[aria-label="Insert/edit media"][role="dialog"]'),
        50, 5000
      )

    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:14,代码来源:DimensionsControlTest.ts


示例8: function

 const sParseStyles = function (editor) {
   return Logger.t('Parse styles', GeneralSteps.sequence([
     Step.sync(function () {
       editor.setContent('<html><head><style>p {text-transform: uppercase}</style></head><body dir="rtl"><p>Test</p></body></html>');
     }),
     Waiter.sTryUntil(
       'Expected styles were added',
       Step.sync(function () {
         Assertions.assertEq('Styles added to iframe document', 'uppercase', editor.dom.getStyle(editor.getBody().firstChild, 'text-transform', true));
         Assertions.assertEq('Styles not added to actual element', '', editor.dom.getStyle(editor.getBody().firstChild, 'text-transform', false));
       }
     ), 10, 3000)
   ]));
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:14,代码来源:FullPagePluginTest.ts


示例9: function

 const sClickFocusedButton = function (selector) {
   return GeneralSteps.sequence([
     Waiter.sTryUntil(
       'Focus was not moved to the expected element',
       FocusTools.sIsOnSelector('Is not on the right element', TinyDom.fromDom(document), selector),
       10,
       1000
     ),
     Chain.asStep(TinyDom.fromDom(document), [
       FocusTools.cGetFocused,
       Mouse.cTrueClick
     ])
   ]);
 };
开发者ID:abstask,项目名称:tinymce,代码行数:14,代码来源:ThemeTest.ts



注:本文中的@ephox/agar.Waiter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript Assertions.assertHtml函数代码示例发布时间:2022-05-28
下一篇:
TypeScript agar.UnitTest类代码示例发布时间: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