import { logger } from '../Logger/logger'; import { CommonKeyword } from './commonKeyword'; /** * Footer class */ export class Footer { /** * This function is used to click on Button which is in footer * * ```js * Footer.clickButton("Submit"); * ``` * * @param {String} btnName Button Label */ static async clickButton(btnName: string) { try { // await within(`footer`, async () => { await CommonKeyword.clickElement(`.//*[contains(@class,'footer')]//dew-btn/button[div/span[text()[normalize-space()='${btnName}']] and not(@disabled)]`); /* await DewButton.click(btnName); }); */ } catch (error) { logger.log(`Issue while performing operation in DDCC: Error while clicking on Footer Button`); throw error; } } /** * This function is used to click on Button which is in footer inside a modal popup * * ```js * Footer.clickModalFooterButton("Submit"); * ``` * * @param {String} btnName Button Label */ static async clickModalFooterButton(btnName: string) { await CommonKeyword.clickElement(`.//dew-modal-footer//dew-btn/button[div/span[text()='${btnName}']]`); } }