Skip to content

Instantly share code, notes, and snippets.

@ajaysuwalka
Last active September 7, 2018 10:46
Show Gist options
  • Save ajaysuwalka/412dd7f7f41ba867cef6bc8a0b74cf67 to your computer and use it in GitHub Desktop.
Save ajaysuwalka/412dd7f7f41ba867cef6bc8a0b74cf67 to your computer and use it in GitHub Desktop.
reusable-specs-steps
// Everything in helper
// Case IDs are exact ones as they are in testrail
// Disadvantages-
// StepId, Step/Verification language might not match in rare case
it('User is able to add new attribute of type TEXT - [15884549]', async () => {
stepLogger.caseId = 15884549;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.text;
await AttributesPageHelper.addAttribute(name, type, stepLogger);
});
it('User is able to add new attribute of type CHECKBOX - [15884481]', async () => {
stepLogger.caseId = 15884481;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.checkBox;
await AttributesPageHelper.addAttribute(name, type, stepLogger);
});
it('User is able to add new attribute of type TEXTAREA - [15884546]', async () => {
stepLogger.caseId = 15884546;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.textArea;
await AttributesPageHelper.addAttribute(name, type, stepLogger);
});
static async addAttribute(name: string, type: string, stepLogger: StepLogger) {
stepLogger.stepId(1);
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.stepId(2);
await AttributesPageHelper.clickOnAddNewButton(stepLogger);
stepLogger.stepId(3);
await AttributesPageHelper.clickOnAddNewTabOnAttributePopupTabs(stepLogger);
await AttributesPageHelper.verifyAddNewLinkTab(stepLogger);
stepLogger.stepId(4);
await AttributesPageHelper.fillNewAttributeForm(name, type, stepLogger);
await AttributesPageHelper.clickOnSaveButton(stepLogger);
await CommonHelper.searchInGrid(name, stepLogger);
await AttributesPageHelper.verifyAttributeNameAndTypeInList(stepLogger, name, type);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment