import 'codeceptjs'; /* declare const inject: any; const { I } = inject(); */ import { CommonKeyword } from "./commonKeyword"; import { TextField } from './textfield'; import { DewAutocomplete } from './dewAutocomplete'; import { Footer } from './footer'; import { TabNavigation } from './tabNavigation'; /** * Class is used to change OU details in eProc and eInvoice */ export class DewOUChange { /** * It will used to change ou details of eProc *@param {String} companyName *@param {String} businessUnit *@param {String} location */ static async changeEprocOU(companyName: string, businessUnit: string, location: string) { // await CommonKeyword.scrollIntoView(`//dew-section[@section-heading [normalize-space()='Billing Information']]`); await TabNavigation.selectDefaultHeadTab(`Billing Information`); // await CommonKeyword.clickElement(`//dew-icon[contains(@class,'icon icon-edit text-12')]`); await CommonKeyword.clickElement(`//dew-input-container[contains(@class,'dew-input-container')]//dew-icon[contains(@class,'icon icon-edit')]`); await CommonKeyword.clickElement(`//div[text()='Company']/parent::label/following-sibling::dew-autocomplete-company//dew-icon`); await CommonKeyword.clickElement(`//div[text()='Company']/parent::label/following-sibling::dew-autocomplete-company//input`); await TextField.enterTextUsingLocator(`//div[text()='Company']/parent::label/following-sibling::dew-autocomplete-company//input`, `${companyName}`); await CommonKeyword.clickElement(`//div[text()[normalize-space()='${companyName}']]`); await DewAutocomplete.selectByText(`//div//input[@name='business-unit']`, `${businessUnit}`); await DewAutocomplete.selectByText(`//div//input[@title='location-input']`, `${location}`); await Footer.clickModalFooterButton(`Done`); } /** * Will be used to change the ou details of invoice *@param {String} companyName *@param {String} businessUnit *@param {String} location */ static async changeEinvoiceOU(companyName: string, businessUnit: string, location: string) { await TabNavigation.selectDefaultHeadTab(`Billing & Cost Booking Details`); await TextField.enterTextUsingLocator(`//input[@id='companyName']`, `${companyName}`); await CommonKeyword.clickElement(`//div[text()='${companyName}']`); await DewAutocomplete.selectByText(`//input[@id='businessUnit']`, `${businessUnit}`); await DewAutocomplete.selectByText(`//input[@id='location']`, `${location}`); } }