本文整理汇总了TypeScript中@ephox/agar.FocusTools.sIsOnSelector方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FocusTools.sIsOnSelector方法的具体用法?TypeScript FocusTools.sIsOnSelector怎么用?TypeScript FocusTools.sIsOnSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.FocusTools
的用法示例。
在下文中一共展示了FocusTools.sIsOnSelector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: sInitialState
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const doc = Element.fromDom(document);
Pipeline.async({},
Log.steps('TBA', 'FullPage: Test initial data, set new input values, open dialog, verify that the dialog data matches the input values', [
sInitialState(editor),
sCheckInputValue('Title', selectors.titleInput, 'Fullpage Dialog Test Title'),
sCheckInputValue('Keywords', selectors.keywordsInput, ''),
sCheckInputValue('Description', selectors.descriptionInput, ''),
sCheckInputValue('Robots', selectors.robotsInput, ''),
sCheckInputValue('Author', selectors.authorInput, ''),
sCheckInputValue('Encoding', selectors.encodingInput, 'ISO-8859-1'),
FocusTools.sTryOnSelector(
'Focus should start on first input',
doc,
selectors.titleInput
),
FocusTools.sSetActiveValue(doc, 'the nu title'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sSetActiveValue(doc, 'the nu keywords'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sSetActiveValue(doc, 'the nu description'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sSetActiveValue(doc, 'the nu robots'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sSetActiveValue(doc, 'the nu author'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sSetActiveValue(doc, 'the nu encoding'),
FocusTools.sIsOnSelector('last', doc, selectors.encodingInput),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sIsOnSelector('The cancel button should be focused', doc, 'button:contains("Cancel")'),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sIsOnSelector('The save button should be focused', doc, 'button:contains("Save")'),
Keyboard.sKeydown(doc, Keys.enter(), { }),
UiFinder.sNotExists(Body.body(), 'div.tox-dialog'),
sOpenDialog(editor),
sCheckInputValue('Title', selectors.titleInput, 'the nu title'),
sCheckInputValue('Keywords', selectors.keywordsInput, 'the nu keywords'),
sCheckInputValue('Description', selectors.descriptionInput, 'the nu description'),
sCheckInputValue('Robots', selectors.robotsInput, 'the nu robots'),
sCheckInputValue('Author', selectors.authorInput, 'the nu author'),
sCheckInputValue('Encoding', selectors.encodingInput, 'the nu encoding'),
]), onSuccess, onFailure);
}, {
示例2: 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
])
]);
};