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


TypeScript Assertions.sAssertPresence方法代码示例

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


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

示例1:

 ].concat(assertions.choice.map((c) => [
     Assertions.sAssertPresence(
       `${c} should NOT be present before clicking`,
       {
         [c]: 0
       },
       Element.fromDom(editor.getBody())
     ),
     Mouse.sClickOn(Body.body(), `.tox-collection__item .tox-collection__item-label:contains(${c})`),
     Assertions.sAssertPresence(
       `${c} should be present`,
       {
         [c]: 1
       },
       Element.fromDom(editor.getBody())
     )
   ]).getOr([ ])), onSuccess, onFailure);
开发者ID:tinymce,项目名称:tinymce,代码行数:17,代码来源:ImportCssPluginTest.ts

示例2: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyUi = TinyUi(editor);
    const doc = TinyDom.fromDom(document);
    const body = Element.fromDom(editor.getBody());

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Removing a link with a collapsed selection', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud">tiny</a></p>'),
        tinyApis.sSetSelection([0, 0, 0], 2, [0, 0, 0], 2),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ]),
      Log.stepsAsStep('TBA', 'Removing a link with some text selected', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud">tiny</a></p>'),
        tinyApis.sSetSelection([0, 0, 0], 0, [0, 0, 0], 2),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ]),
      Log.stepsAsStep('TBA', 'Removing a link from an image', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud"><img src="http://moxiecode.cachefly.net/tinymce/v9/images/logo.png" /></a></p>'),
        tinyApis.sSetSelection([0, 0], 0, [0, 0], 1),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:36,代码来源:RemoveLinkTest.ts

示例3: TinyUi

    TinyLoader.setup((editor, onSuccess, onFailure) => {
      const doc = Element.fromDom(document);

      const tinyUi = TinyUi(editor);

      const sOpenStyleMenu = GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('Clicking on the styleselect dropdown', 'button')
      ]);

      const navigationSteps = MenuNavigationTestUtils.generateNavigation(doc, assertions.navigation);

      Pipeline.async({}, Arr.flatten([
        [
          Assertions.sAssertPresence(
            `${assertions.choice.presence} should NOT be present`,
            {
              [assertions.choice.presence]: 0
            },
            Element.fromDom(editor.getBody())
          )
        ],
        [ sOpenStyleMenu ],
        navigationSteps,
        Arr.map(assertions.choice.keysBeforeExecute, (k) => Keyboard.sKeydown(doc, k, { })),
        [ Keyboard.sKeydown(doc, Keys.enter(), { }) ],
        [
          Assertions.sAssertPresence(
            `${assertions.choice.presence} should now be present`,
            {
              [assertions.choice.presence]: 1
            },
            Element.fromDom(editor.getBody())
          )
        ]
      ]), onSuccess, onFailure);
    }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:36,代码来源:ImportCssGroupsPluginTest.ts

示例4: function

 const sAssertPresense = function (selector) {
   return Assertions.sAssertPresence('Detect presense of the element', selector, TinyDom.fromDom(editor.getBody()));
 };
开发者ID:abstask,项目名称:tinymce,代码行数:3,代码来源:ImageFigureLinkTest.ts

示例5: function

 const sAssertPresence = function (selector) {
   return Waiter.sTryUntil('Assert element is present',
     Assertions.sAssertPresence('Detect presence of the element', selector, TinyDom.fromDom(editor.getBody())),
     100, 1000
   );
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:6,代码来源:ImageFigureLinkTest.ts


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