当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript agar.Waiter类代码示例

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