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


TypeScript Mouse.cClickOn方法代码示例

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


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

示例1:

const cSubmitDialog = () => Chain.control(
  NamedChain.asChain([
    NamedChain.writeValue('body', Body.body()),
    NamedChain.read('body', Mouse.cClickOn('.tox-button:contains("Save")')),
    NamedChain.outputInput
  ]),
  Guard.addLogging('Submit dialog')
);
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:Helpers.ts

示例2: TinyApis

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

    const rootDoc = Element.fromDom(document);

    const sOpenContextMenu = (target) => {
      return Chain.asStep(editor, [
        tinyUi.cTriggerContextMenu('trigger image context menu', target, '.tox-silver-sink [role="menuitem"]'),
        // Not sure why this is needed, but without the browser deselects the contextmenu target
        Chain.wait(0)
      ]);
    };

    const sWaitForAndSubmitDialog = Chain.asStep(editor, [
      tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'),
      Mouse.cClickOn('.tox-button:contains("Save")')
    ]);

    Pipeline.async({}, [
      tinyApis.sFocus,
      Log.stepsAsStep('TBA', 'Opening context menus on a selected figure', [
        tinyApis.sSetRawContent('<figure class="image" contenteditable="false"><img src="image.png"><figcaption contenteditable="true">Caption</figcaption></figure><p>Second paragraph</p>'),
        tinyApis.sSetSelection([], 0, [], 1),
        sOpenContextMenu('figure.image'),
        Keyboard.sKeydown(rootDoc, Keys.enter(), {}),
        sWaitForAndSubmitDialog,
        tinyApis.sAssertSelection([], 0, [], 1)
      ]),
      Log.stepsAsStep('TBA', 'Opening context menus on an unselected figure', [
        tinyApis.sSetRawContent('<figure class="image" contenteditable="false"><img src="image.png"><figcaption contenteditable="true">Caption</figcaption></figure><p>Second paragraph</p>'),
        tinyApis.sSetSelection([1, 0], 1, [1, 0], 1),
        sOpenContextMenu('figure.image'),
        Keyboard.sKeydown(rootDoc, Keys.enter(), {}),
        sWaitForAndSubmitDialog,
        tinyApis.sAssertSelection([], 0, [], 1)
      ]),
      Log.stepsAsStep('TBA', 'Opening context menus on a selected image', [
        tinyApis.sSetRawContent('<p><img src="image.png" /></p><p>Second paragraph</p>'),
        tinyApis.sSetSelection([0], 0, [0], 1),
        sOpenContextMenu('img'),
        Keyboard.sKeydown(rootDoc, Keys.enter(), {}),
        sWaitForAndSubmitDialog,
        tinyApis.sAssertSelection([0], 0, [0], 1)
      ]),
      Log.stepsAsStep('TBA', 'Opening context menus on an unselected image', [
        tinyApis.sSetRawContent('<p><img src="image.png" /></p><p>Second paragraph</p>'),
        tinyApis.sSetSelection([1, 0], 1, [1, 0], 1),
        sOpenContextMenu('img'),
        Keyboard.sKeydown(rootDoc, Keys.enter(), {}),
        sWaitForAndSubmitDialog,
        tinyApis.sAssertSelection([0], 0, [0], 1)
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:55,代码来源:ContextMenuTest.ts

示例3: function

const assertStructureInDialog = function (errString, objStruc, waitOn, clickOn) {
    return Logger.t('Assert structure in dialog', Chain.asStep(TinyDom.fromDom(document.body), [
      UiFinder.cWaitFor('Could not find notification', waitOn),
      Mouse.cClickOn(clickOn),
      Chain.control(
        Chain.op((panel) => {
          Assertions.assertPresence(errString, objStruc, panel);
        }),
        Guard.tryUntil('Keep waiting', 100, 4000)
      )
    ]));
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:PluginAssert.ts

示例4: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'Charmap: Open dialog, click on the All tab and click on Quotation Mark and then assert Quotation Mark is inserted', [
        tinyApis.sFocus,
        tinyUi.sClickOnToolbar('click charmap', 'button[aria-label="Special character"]'),
        Chain.asStep({}, [
          Chain.fromParent(
            tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
            [
              Mouse.cClickOn('.tox-dialog__body-nav-item:contains(All)'),
              Mouse.cClickOn('.tox-collection .tox-collection__item-icon:contains(")') // Could not get span[data-glyph="\"""] or similar to work...
            ]
          )
        ]),
        tinyApis.sAssertContent('<p>"</p>')
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:21,代码来源:InsertQuotationMarkTest.ts

示例5: TestExtras


//.........这里部分代码省略.........

  }), '_'),

  Pipeline.async({ }, [
    Step.sync(() => {
      windowManager.open({
        title: 'Custom Dialog',
        body: {
          type: 'tabpanel',
          tabs: [
            {
              title: 'Basic',
              items: [
                {
                  name: 'basic1',
                  type: 'input'
                }
              ]
            },
            {
              title: 'Advanced',
              items: [
                {
                  name: 'advanced1',
                  type: 'textarea'
                }
              ]
            }
          ]
        },
        buttons: [
          {
            type: 'custom',
            name: 'gotoBasic',
            text: '-> Basic',
            disabled: false
          },
          {
            type: 'custom',
            name: 'gotoAdvanced',
            text: '-> Advanced',
            disabled: false
          },
          {
            type: 'cancel',
            text: 'Cancel'
          },
          {
            type: 'submit',
            text: 'Save'
          }
        ],
        initialData: {
          basic1: 'First tab value',
          advanced1: 'Textarea value'
        },
        onAction: (api, a) => {
          const target = a.name === 'gotoBasic' ? 'Basic' : 'Advanced';
          api.showTab(target);
        },
        onSubmit: () => {

        }
      }, {}, () => {});
    }),

    Chain.asStep({ }, [
      NamedChain.asChain([
        NamedChain.writeValue('page', Body.body()),
        NamedChain.direct('page', UiFinder.cFindIn('[role="dialog"]'), 'dialog'),
        NamedChain.direct('dialog', UiFinder.cFindIn('[role="tab"]:contains("Basic")'), 'basicTab'),
        NamedChain.direct('dialog', UiFinder.cFindIn('[role="tab"]:contains("Advanced")'), 'advancedTab'),
        NamedChain.direct('dialog', UiFinder.cFindIn('[role="tabpanel"]'), 'tabview'),
        NamedChain.direct('dialog', Mouse.cClickOn('button:contains("-> Basic")'), '_'),
        NamedChain.direct('tabview', cAssertFormContents('Clicking Basic button', (s, str, arr) => {
          return s.element('input', {
            value: str.is('First tab value')
          });
        }), '_'),

        NamedChain.direct('dialog', Mouse.cClickOn('button:contains("-> Advanced")'), '_'),
        NamedChain.direct('tabview', cAssertFormContents('Clicking Advanced button (not tab)', (s, str, arr) => {
          return s.element('textarea', {
            value: str.is('Textarea value')
          });
        }), '_'),

        NamedChain.direct('dialog', Mouse.cClickOn('button:contains("-> Basic")'), '_'),
        NamedChain.direct('tabview', cAssertFormContents('Clicking Basic button again (not tab)', (s, str, arr) => {
          return s.element('input', {
            value: str.is('First tab value')
          });
        }), '_'),
      ])
    ])
  ], () => {
    helpers.destroy();
    success();
  }, failure);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:101,代码来源:TabbedDialogTest.ts


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