Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- by_tag.spec.js
- var pageObject = require('./../../../../../../services/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var dashboardPage = pageObject.getDashboardPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var collectionsPage = pageObject.getCollectionsPage();
- var addProductPage = pageObject.getAddProductPage();
- var productListPage = pageObject.getProductListPage();
- var signInData = require('./../../../../../../data/admin/sign_in/index');
- var collectionData = require('./../../../../../../data/admin/collection/index');
- var productData = require('./../../../../../../data/admin/product/index');
- var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
- describe('Add Collection - Auto Adding - By Tag', function () {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var firstCollectionTitle = commonHelper.uniqueProductName('tag1');
- var firstCollectionDescription = collectionData.collection.description.first;
- var product = {
- firstTitle: commonHelper.uniqueProductName('tag2'),
- type: productData.product.type,
- tag: productData.product.tag,
- price: productData.product.price
- };
- describe('auto-add product by product tag does not contain', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- var productTag = 'mouse' + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.price);
- addProductPage.selectVendor(productTag);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Product tag');
- addCollectionPage.selectConditionRule(0, 'does not contain');
- addCollectionPage.fillConditionValue(0, product.tag);
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product tag is exactly', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- var productTag = product.tag + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.addTag(productTag);
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.price);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Product tag');
- addCollectionPage.selectConditionRule(0, 'is exactly');
- addCollectionPage.fillConditionValue(0, productTag);
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product tag starts with', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- var productTag = firstCollectionTitle + product.tag;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.addTag(productTag);
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.price);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Product tag');
- addCollectionPage.selectConditionRule(0, 'starts with');
- addCollectionPage.fillConditionValue(0, firstCollectionTitle);
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product tag ends with', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- var productTag = product.tag + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.price);
- addProductPage.addTag(productTag);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Product tag');
- addCollectionPage.selectConditionRule(0, 'ends with');
- addCollectionPage.fillConditionValue(0, unique_value);
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product vendor contains', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- var productTag = product.type + unique_value + 'contains';
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.price);
- addProductPage.addTag(productTag);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Product tag');
- addCollectionPage.selectConditionRule(0, 'contains');
- addCollectionPage.fillConditionValue(0, unique_value);
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- });
- ____________________________________________________________________________________________
- by_vendor.spec.js
- var pageObject = require('./../../../../../../services/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var dashboardPage = pageObject.getDashboardPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var collectionsPage = pageObject.getCollectionsPage();
- var addProductPage = pageObject.getAddProductPage();
- var productListPage = pageObject.getProductListPage();
- var signInData = require('./../../../../../../data/admin/sign_in/index');
- var collectionData = require('./../../../../../../data/admin/collection/index');
- var productData = require('./../../../../../../data/admin/product/index');
- var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
- describe('Add Collection - Auto Adding - By Price', function () {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var firstCollectionTitle = commonHelper.uniqueProductName('weight1');
- var firstCollectionDescription = collectionData.collection.description.first;
- var product = {
- firstTitle: commonHelper.uniqueProductName('weight2'),
- type: productData.product.type,
- firstWeight: productData.product.weight,
- secondWeight: '3',
- thirdWeight: '4',
- fourthWeight: '5',
- firstPrice: productData.product.price
- };
- describe('auto-add product by product weight is equal', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.firstWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is equal to');
- addCollectionPage.fillConditionValue(0, '2.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is not equal', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.secondWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is not equal to');
- addCollectionPage.fillConditionValue(0, '4.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is greater then', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.thirdWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is greater then');
- addCollectionPage.fillConditionValue(0, '3.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is less then', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.fourthWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is less then');
- addCollectionPage.fillConditionValue(0, '6.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- });
- _______________________________________________________________
- by_weight.spec.js
- var pageObject = require('./../../../../../../services/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var dashboardPage = pageObject.getDashboardPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var collectionsPage = pageObject.getCollectionsPage();
- var addProductPage = pageObject.getAddProductPage();
- var productListPage = pageObject.getProductListPage();
- var signInData = require('./../../../../../../data/admin/sign_in/index');
- var collectionData = require('./../../../../../../data/admin/collection/index');
- var productData = require('./../../../../../../data/admin/product/index');
- var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
- describe('Add Collection - Auto Adding - By Price', function () {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var firstCollectionTitle = commonHelper.uniqueProductName('weight1');
- var firstCollectionDescription = collectionData.collection.description.first;
- var product = {
- firstTitle: commonHelper.uniqueProductName('weight2'),
- type: productData.product.type,
- firstWeight: productData.product.weight,
- secondWeight: '3',
- thirdWeight: '4',
- fourthWeight: '5',
- firstPrice: productData.product.price
- };
- describe('auto-add product by product weight is equal', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.firstWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is equal to');
- addCollectionPage.fillConditionValue(0, '2.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is not equal', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.secondWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is not equal to');
- addCollectionPage.fillConditionValue(0, '4.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is greater then', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.thirdWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is greater then');
- addCollectionPage.fillConditionValue(0, '3.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('auto-add product by product weight is less then', function () {
- var unique_value = commonHelper.uniqueValue();
- var collectionTitle = firstCollectionTitle + unique_value;
- var productTitle = product.firstTitle + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should add new product', function () {
- addProductPage.selectType(product.type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(product.firstPrice);
- addProductPage.fillShippingWeight(product.fourthWeight);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should fill title and description fields', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(firstCollectionDescription);
- });
- it('should click auto add product radio button', function () {
- addCollectionPage.clickAddAuto();
- commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
- });
- it('should add condition', function () {
- addCollectionPage.selectConditionVariant(0, 'Weight');
- addCollectionPage.selectConditionRule(0, 'is less then');
- addCollectionPage.fillConditionValue(0, '6.00');
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- });
Add Comment
Please, Sign In to add comment