qe-fe-automation
Version:
FE test automation framework using cypress
35 lines (33 loc) • 1.38 kB
text/typescript
const billingEntitySelectors = {
businessLegalName: '[data-testid="companyLegalName"]',
businessCountry: '[data-testid="selectCountry"]',
countryOption: '.mat-option-text',
stateOption: '.ta-select-option',
businessAddress: '[data-testid="inputAddress1"]',
businessCity: '[data-testid="inputCity"]',
businessState: '[data-testid="selectState"] > .ta-select',
businessZip: '[data-testid="inputZipcode"]',
saveButton: '[data-testid="buttonSaveCompanyAddress"] > .ta-button-v2'
};
export class BillingEntity {
static fillBillingEntityForm(): void {
cy.allure().logStep('Fill billing entity form and submit');
cy.get(billingEntitySelectors.businessLegalName).type('Test Company');
cy.clearInputAndType(billingEntitySelectors.businessCountry, 'United States').then(
() => {
cy.get(billingEntitySelectors.countryOption).first().click({ force: true });
}
);
cy.get(billingEntitySelectors.businessState)
.then((ele) => {
cy.wrap(ele).click();
})
.then(() => {
cy.get(billingEntitySelectors.stateOption).eq(4).click();
});
cy.get(billingEntitySelectors.businessAddress).type('page mill 1501');
cy.get(billingEntitySelectors.businessCity).type('Palo Alto');
cy.get(billingEntitySelectors.businessZip).type('94304');
cy.get(billingEntitySelectors.saveButton).click();
}
}