Skip to content

Instantly share code, notes, and snippets.

@ajaysuwalka
Last active September 7, 2018 10:46
Show Gist options
  • Save ajaysuwalka/c868460014227ef40a51d60bfd76f336 to your computer and use it in GitHub Desktop.
Save ajaysuwalka/c868460014227ef40a51d60bfd76f336 to your computer and use it in GitHub Desktop.
repeated-specs-steps
// Everything in spec
// Case IDs are exact ones as they are in testrail
it('User is able to add new attribute - [15877509]', async () => {
stepLogger.caseId = 15884546;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.checkBox;
stepLogger.stepId(1);
stepLogger.step('Click on Attributes tab');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.verification('Navigate to attribute');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.stepId(2);
stepLogger.step('Click on add new button');
await AttributesPageHelper.clickOnAddNewButton(stepLogger);
stepLogger.verification('Verify the button is clicked');
await AttributesPageHelper.verifyClickOnAddNewButton(stepLogger);
stepLogger.stepId(3);
stepLogger.step('Click on Add new tab on attributes popup');
await AttributesPageHelper.clickOnAddNewTabOnAttributePopupTabs(stepLogger);
stepLogger.verification('Veerify Click on Add new tab on attributes popup');
await AttributesPageHelper.verifyClickOnAddNewTab(stepLogger);
stepLogger.stepId(4);
stepLogger.step('Fill new attribute form and save');
await AttributesPageHelper.fillNewAttributeForm(name, type, stepLogger);
stepLogger.verification('verify that the new attribute is created');
await AttributesPageHelper.verifyAttributeNameAndTypeInList(stepLogger, name, type);
});
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;
stepLogger.stepId(1);
stepLogger.step('Click on Attributes tab');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.verification('Navigate to attribute');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.stepId(2);
stepLogger.step('Click on add new button');
await AttributesPageHelper.clickOnAddNewButton(stepLogger);
stepLogger.verification('Verify the button is clicked');
await AttributesPageHelper.verifyClickOnAddNewButton(stepLogger);
stepLogger.stepId(3);
stepLogger.step('Click on Add new tab on attributes popup');
await AttributesPageHelper.clickOnAddNewTabOnAttributePopupTabs(stepLogger);
stepLogger.verification('Veerify Click on Add new tab on attributes popup');
await AttributesPageHelper.verifyClickOnAddNewTab(stepLogger);
stepLogger.stepId(4);
stepLogger.step('Fill new attribute form and save');
await AttributesPageHelper.fillNewAttributeForm(name, type, stepLogger);
stepLogger.verification('verify that the new attribute is created');
await AttributesPageHelper.verifyAttributeNameAndTypeInList(stepLogger, name, type);
});
it('User is able to add new attribute of type TEXT - [15884549]', async () => {
stepLogger.caseId = 15884546;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.text;
stepLogger.stepId(1);
stepLogger.step('Click on Attributes tab');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.verification('Navigate to attribute');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.stepId(2);
stepLogger.step('Click on add new button');
await AttributesPageHelper.clickOnAddNewButton(stepLogger);
stepLogger.verification('Verify the button is clicked');
await AttributesPageHelper.verifyClickOnAddNewButton(stepLogger);
stepLogger.stepId(3);
stepLogger.step('Click on Add new tab on attributes popup');
await AttributesPageHelper.clickOnAddNewTabOnAttributePopupTabs(stepLogger);
stepLogger.verification('Veerify Click on Add new tab on attributes popup');
await AttributesPageHelper.verifyClickOnAddNewTab(stepLogger);
stepLogger.stepId(4);
stepLogger.step('Fill new attribute form and save');
await AttributesPageHelper.fillNewAttributeForm(name, type, stepLogger);
stepLogger.verification('verify that the new attribute is created');
await AttributesPageHelper.verifyAttributeNameAndTypeInList(stepLogger, name, type);
});
it('User is able to add new attribute of type Checkbox - [15884481]', async () => {
stepLogger.caseId = 15884546;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.checkBox;
stepLogger.stepId(1);
stepLogger.step('Click on Attributes tab');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.verification('Navigate to attribute');
await EmailMarketingHelper.navigateToAttributesAndVerify(stepLogger);
stepLogger.stepId(2);
stepLogger.step('Click on add new button');
await AttributesPageHelper.clickOnAddNewButton(stepLogger);
stepLogger.verification('Verify the button is clicked');
await AttributesPageHelper.verifyClickOnAddNewButton(stepLogger);
stepLogger.stepId(3);
stepLogger.step('Click on Add new tab on attributes popup');
await AttributesPageHelper.clickOnAddNewTabOnAttributePopupTabs(stepLogger);
stepLogger.verification('Veerify Click on Add new tab on attributes popup');
await AttributesPageHelper.verifyClickOnAddNewTab(stepLogger);
stepLogger.stepId(4);
stepLogger.step('Fill new attribute form and save');
await AttributesPageHelper.fillNewAttributeForm(name, type, stepLogger);
stepLogger.verification('verify that the new attribute is created');
await AttributesPageHelper.verifyAttributeNameAndTypeInList(stepLogger, name, type);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment