import { CommonKeyword } from "../components/commonKeyword"; import { logger } from '../Logger/logger'; // import { Wait } from "./dewWait"; /** * Menu Action class */ export class MenuActions { /** * Click Menu button and perfrom action * * ```js * MenuActions.clickMenuAction("//div/icon","Export"); * ``` * @param {String} locator Located By Xpath|CSS * @param {String} action Action To Perform */ static async clickMenuAction(locator: string, action: string) { const actionLocator = `//*[text()[normalize-space()='${action}']]`; try { await CommonKeyword.clickElement(locator); await CommonKeyword.clickElement(actionLocator); } catch (error) { logger.log(`Issue while performing operation in DDCC: Error while clicking on menu action`); throw error; } } }