import { Helper } from 'codeceptjs'; /** *Common Keyword class */ export declare class CommonKeyword extends Helper { static clickElement(locator: string, isIEClick: any, scope?: string): Promise; static clickElement(locator: string, scope?: string): Promise; static clickLabel(locator: string, isIEClick: boolean, scope?: string): Promise; static clickLabel(locator: string, scope?: string): Promise; /** * Click right on an element * * ```js * *CommonKeyword.rightClick("//input[@name='Search']","action") * ``` * * @param {String} selector located by CSS|XPath|strict locator. * @param {String} actionToPerform * */ static rightClick(selectors: string, actionToPerform: string): Promise; /** * To enter text into textfield macthed by field label * * ```js * *CommonKeyword.enterText("Name","Rhea") * ``` * * @param {String} fieldLbl of an element * @param {String} dataToFill to enter */ static enterText(fieldLbl: string, dataToFill: string): Promise; /** * To enter text into textfield based on Placeholder * * ```js * *CommonKeyword.enterTextUsingPlaceHolder("Search","John") * ``` * * @param {String} placeholder * @param {String} dataToFill to enter */ static enterTextUsingPlaceHolder(placeholder: string, dataToFill: string): Promise; /** * Performs a double-click on an element matched by link|button|label|CSS or XPath * * ```js * *CommonKeyword.doubleClick(`.btn.edit`) * ``` * * @param {String} locator matched by link|button|label|CSS or XPath * */ static doubleClick(locator: string): Promise; /** * Performs javascript click on an element matched by link|button|label|CSS or XPath * * ```js * *CommonKeyword.forceClick(`.btn.edit`) * ``` * * @param {String} locator matched by link|button|label|CSS or XPath * */ static forceClick(locator: string): Promise; /** * Perform Click Operation * * ```js * *CommonKeyword.clickWrapper(`.btn.edit`) * ``` * * @param {String} locator matched by link|button|label|CSS or XPath * */ static clickWrapper(locator: string): Promise; /** *Scroll element into viewport. * * ```js * *CommonKeyword.scrollIntoView('#submit') * * ``` * @param {String} locator located by CSS|XPath|strict locator. * @param {string} scrollOption * */ static scrollIntoView(locator: string, scrollOption?: any): Promise; /** * Moves cursor to element matched by locator * * ```js * *CommonKeyword.moveCursorTo("#input") * ``` * * @param {String} locator located by CSS|XPath|strict locator. * @param {String} offsetX (optional) number X-axis offset. * @param {String} offsetY (optional) number Y-axis offset. * */ static moveCursorTo(locator: string, offsetX?: number, offsetY?: number): Promise; /** * Presses a key on a focused element. Special keys like 'Enter', 'Control', etc will be replaced with corresponding unicode * * ```js *CommonKeyword.pressKey('Enter'); *CommonKeyword.pressKey(['Control','a']); * ``` * * @param {string | Array } key or array of keys to press. * */ static pressKey(...key: Array): Promise; /** * Element is used to switch in and out of iFrame * @param {string}locator */ static switchTo(locator?: string): Promise; /** * Perform Javascript command * * ```js *CommonKeyword.executeScript('Enter'); * ``` * * @param {string} script * @param {...any} args to be passed to function. */ static executeScript(script: string, ...args: any[]): Promise; /** * Reload the current page. * * ```js * *CommonKeyword.refreshPage() * ``` * */ static refreshPage(): Promise; /** * Scroll Page To Top. * * ```js * *await CommonKeyword.scrollPageToTop() * ``` * */ static scrollPageToTop(): Promise; /** * Scroll Page To Top. * * ```js * *await CommonKeyword.amOnPage(`www.google.com`) * ``` * * @param {any} url */ static amOnPage(url: any): Promise; /** * Scroll Page To Bottom. * * ```js * *await CommonKeyword.scrollPageToTop() * ``` * */ static scrollPageToBottom(): Promise; /** * Method is use to click on dismiss button of CNS notification */ static dismissNotification(): Promise; /** * Scroll To Specified locator * * ```js * await CommonKeyword.scrollTo(`\\div`); * * @param {string}locator */ static scrollTo(locator: string): Promise; /** * Click on element by verifying its browser * *```js * *await CommonKeyword.click() *``` * @param {String} locator located by CSS|XPath|strict locator. * */ static click(locator: string): Promise; /** * * Perform Drag Operation and verify if element is present in UI * * ```js * await CommonKeyword.dragSlider(`//span[contains(text(),'Supplier Awarded Cost')]`,10); * ``` * @param {string}elementToDrag * @param {number}offset */ static dragSlider(elementToDrag: string, offset: number): Promise; /** * Fetch Cookie from browser */ static getCookie(): Promise; /** * Get home url of the setup */ static getHomeURl(): Promise; /** * Clear Cookie from browser */ static clearCookie(): Promise; /** * This method return today's date if no paramater is passed in mm/dd/yyyy format * * ```js * await CommonKeyword.getDate(); // Returns todays date * await CommonKeyword.getDate(1); // Returns tommorows date * ``` * * @param {number}daysToAdd number of days to add to current date */ static getDate(daysToAdd?: number): Promise; /** * Performs right click on a clickable element matched by semantic locator, CSS or XPath. * * ```js * await CommonKeyword.rightClick('Click me'); * * ``` * @param { string } locator clickable element located by CSS|XPath|strict locator. */ static performRightClick(locators: string): Promise; /** * Get current URL from browser. Returns Promise current URL * ```js * await CommonKeyword.grabCurrentUrl(); */ static grabCurrentUrl(): Promise; /** *Restarts browser when endpoint is unreachable * ```js * await CommonKeyword.restartBrowser(); */ static restartBrowser(): Promise; }