UNPKG

tia

Version:

Time is All (logs driven test engine with ExtJs support)

142 lines 4.78 kB
"use strict"; // https://stackoverflow.com/questions/11000087/how-to-select-a-combobox-value-in-extjs Object.defineProperty(exports, "__esModule", { value: true }); const component_1 = require("./component"); const tia_extjs_query_1 = require("../tia-extjs-query"); const extjs_utils_1 = require("../../extjs-utils"); const compName = 'TreeView'; /** * gT.eC.treeview.a or gT.eC.treeview.actions */ class TreeViewActions extends component_1.ComponentActions { /** * Left mouse button click on the item containing the given text. * @param text - Text for the item to click. */ static async clickItem(tEQ, text, idForLog, enableLog) { // Дождаться idle? const valueStr = gT.e.utils.locKeyToStrAndEscapeSlashes(text); return gT.e.q.wrap({ tEQ, compName, idForLog, act: async () => { const item = await tia_extjs_query_1.queryAndAction({ tEQ, action: `return tiaEJActs.getTreeListItem(cmp, '${valueStr}');`, idForLog, enableLog: false, }); await item.click(); }, actionDesc: `Click Item (${text})`, enableLog, }); } /** * Right mouse button click on the item containing the given text. * @param text - Text for the item to click. */ static async rClickItem(tEQ, text, idForLog, enableLog) { // TODO: wait for idle ? const valueStr = gT.e.utils.locKeyToStrAndEscapeSlashes(text); return gT.e.q.wrap({ tEQ, compName, idForLog, act: async () => { const item = await tia_extjs_query_1.queryAndAction({ tEQ, action: `return tiaEJActs.getTreeListItem(cmp, '${valueStr}');`, idForLog, enableLog: false, }); await gT.sOrig.driver .actions({ bridge: true }) .contextClick(item) .perform(); }, actionDesc: `Right Click Item (${text})`, enableLog, }); } /** * Left mouse button double click on the item containing the given text. * @param text - Text for the item to click. */ static async doubleClickItem(tEQ, text, idForLog, enableLog) { // Дождаться idle? const valueStr = gT.e.utils.locKeyToStrAndEscapeSlashes(text); return gT.e.q.wrap({ tEQ, compName, idForLog, act: async () => { const item = await tia_extjs_query_1.queryAndAction({ tEQ, action: `return tiaEJActs.getTreeListItem(cmp, '${valueStr}');`, idForLog, enableLog: false, }); await gT.sOrig.driver .actions({ bridge: true }) .doubleClick(item) .perform(); }, actionDesc: `Double Click Item (${text})`, enableLog, }); } } TreeViewActions.compName = compName; exports.TreeViewActions = TreeViewActions; /** * gT.eC.treeview.c or gT.eC.treeview.checks */ class TreeViewChecks extends component_1.ComponentChecks { } TreeViewChecks.compName = compName; exports.TreeViewChecks = TreeViewChecks; /** * gT.eC.treeview.g or gT.eC.treeview.grabs */ class TreeViewGrabs extends component_1.ComponentGrabs { /** * Returns the tree content to the test log. */ static async content(tEQ, idForLog) { const result = await tia_extjs_query_1.queryAndAction({ tEQ, action: 'return tiaEJ.ctByObj.getTree(cmp);', idForLog, enableLog: false, }); return extjs_utils_1.getCISContent('Content', tEQ, this.compName, idForLog, result, true); } } TreeViewGrabs.compName = compName; exports.TreeViewGrabs = TreeViewGrabs; /** * gT.eC.treeview.l or gT.eC.treeview.logs */ class TreeViewLogs extends component_1.ComponentLogs { /** * Prints the tree content to the test log. */ static async content(tEQ, idForLog) { const str = await TreeViewGrabs.content(tEQ, idForLog); gIn.logger.logln(str); } } TreeViewLogs.compName = compName; exports.TreeViewLogs = TreeViewLogs; class TreeViewAPI { } TreeViewAPI.a = TreeViewActions; TreeViewAPI.actions = TreeViewActions; TreeViewAPI.c = TreeViewChecks; TreeViewAPI.checks = TreeViewChecks; TreeViewAPI.l = TreeViewLogs; TreeViewAPI.logs = TreeViewLogs; exports.TreeViewAPI = TreeViewAPI; //# sourceMappingURL=treeview.js.map