Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- product_setup.spec
- var pageObject = require('./../../../../services/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var dashboardPage = pageObject.getDashboardPage();
- var addProductPage = pageObject.getAddProductPage();
- var productListPage = pageObject.getProductListPage();
- var productSetupPage = pageObject.getProductSetupPage();
- var signUpPage = pageObject.getSignUpPage();
- var productPage = pageObject.getProductPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var collectionsPage = pageObject.getCollectionsPage();
- var signInData = require('./../../../../data/admin/sign_in/index');
- var productData = require('./../../../../data/admin/product/index');
- var coreData = require('./../../../../data/admin/core/index');
- var collectionData = require('./../../../../data/admin/collection/index');
- var commonHelper = require('./../../../../services/helpers/common.helper.js');
- describe('Product setup', function () {
- var unique_value = commonHelper.uniqueValue();
- var storeName = coreData.storeName + unique_value;
- var mainStoreLink= signInData.link;
- var storeLink = 'https://' + storeName + '.' + mainStoreLink.split('.')[1] + '.com';
- var type = productData.product.type;
- var price = productData.product.price;
- var weight = productData.product.weight;
- var vendor = productData.product.vendor;
- var sku = productData.product.sku;
- var tag = productData.product.tag;
- var secondPrice = '145.00';
- var comparePrice = productData.product.comparePrice;
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- describe('Product page scenarios - create new store', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(mainStoreLink);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should click build new store', function () {
- dashboardPage.clickBuildNewStore();
- commonHelper.waitUntilElementVisible(signUpPage.btnStartBuildingStoreNow);
- });
- it('should submit new store form', function () {
- signUpPage.fillStoreName(storeName);
- signUpPage.fillStoreSubdomain(storeName);
- signUpPage.clickStartBuildingStoreNow();
- commonHelper.waitUntilElementVisible(signUpPage.btnSignIn);
- });
- });
- describe('Product page scenarios - checking for type', function () {
- var title = commonHelper.uniqueProductName('type1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('type2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.fillType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off type setup', function () {
- productSetupPage.clickSetup('Type');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see type field', function () {
- expect(addProductPage.selType.isPresent()).toBeFalsy();
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see type field', function () {
- expect(addProductPage.selType.isPresent()).toBeFalsy();
- });
- it('should fill second product form', function () {
- addProductPage.fillTitle(secondTitle);
- addProductPage.fillPrice(secondPrice);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on type setup', function () {
- productSetupPage.clickSetup('Type');
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct selected type', function () {
- expect(addProductPage.selType.isPresent()).toBeTruthy();
- expect(addProductPage.selectedType()).toEqual(type);
- });
- it('should open edit page for second product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(secondTitle);
- addProductPage.waitForSaveButton();
- });
- it('should not be able to save product without title', function () {
- addProductPage.clickSave();
- expect(addProductPage.selType.isPresent()).toBeTruthy();
- expect(addProductPage.errorType()).toEqual('This field is required.');
- });
- it('should add type', function () {
- commonHelper.waitUntilElementVisible(addProductPage.selType);
- addProductPage.selectType(type);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- });
- describe('Product page scenarios - checking for compare at price', function () {
- var title = commonHelper.uniqueProductName('price1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('price2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.fillComparePrice(comparePrice);
- });
- it('should publish first product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off Compare at price setup', function () {
- productSetupPage.clickSetup('Compare at price');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see compare price field', function () {
- expect(addProductPage.txtComparePrice.isPresent()).toBeFalsy();
- });
- it('should fill second product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(secondTitle);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for first product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see compare price field', function () {
- expect(addProductPage.txtComparePrice.isPresent()).toBeFalsy();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not show compare price', function () {
- expect(productPage.txtComparePrice.isDisplayed()).toBeFalsy()
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on compare at price setup', function () {
- productSetupPage.clickSetup('Compare at price');
- });
- it('should show product page after click on first product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not show compare price after switch on', function () {
- expect(productPage.txtComparePrice.isDisplayed()).toBeFalsy();
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should see empty compare at prise field', function () {
- commonHelper.waitUntilElementVisible(addProductPage.txtComparePrice);
- expect(addProductPage.getComparePrice()).toEqual('');
- });
- it('should add compare price', function () {
- addProductPage.fillComparePrice(comparePrice);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- });
- describe('Product page scenarios - checking for shipping', function () {
- var title = commonHelper.uniqueProductName('shipping1') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.fillShippingWeight(weight);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off Shipping weight setup', function () {
- productSetupPage.clickSetup('Shipping weight');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see shipping field', function () {
- expect(addProductPage.txtShippingWeight.isPresent()).toBeFalsy();
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see shipping field', function () {
- expect(addProductPage.txtShippingWeight.isPresent()).toBeFalsy();
- });
- it('should return to previous page', function () {
- browser.navigate().back();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on Shipping weight setup', function () {
- productSetupPage.clickSetup('Shipping weight');
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show shipping weight field', function () {
- expect(addProductPage.txtShippingWeight.isPresent()).toBeTruthy();
- });
- });
- describe('Product page scenarios - checking for vendor', function () {
- var title = commonHelper.uniqueProductName('vendor1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('vendor2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.fillVendor(vendor);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off Vendor setup', function () {
- productSetupPage.clickSetup('Vendor');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see vendor field', function () {
- expect(addProductPage.selVendor.isPresent()).toBeFalsy();
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see vendor field', function () {
- expect(addProductPage.selVendor.isPresent()).toBeFalsy();
- });
- it('should fill second product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(secondTitle);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on vendor setup', function () {
- productSetupPage.clickSetup('Vendor');
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct vendor', function () {
- expect(addProductPage.selVendor.isPresent()).toBeTruthy();
- expect(addProductPage.getVendor()).toEqual(vendor);
- });
- it('should open edit page for second product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(secondTitle);
- addProductPage.waitForSaveButton();
- });
- it('should see vendor field', function () {
- expect(addProductPage.selVendor.isPresent()).toBeTruthy();
- });
- it('should add vendor', function () {
- commonHelper.waitUntilElementVisible(addProductPage.selVendor);
- addProductPage.selectVendor(vendor);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- });
- describe('Product page scenarios - checking for SKU', function () {
- var title = commonHelper.uniqueProductName('sku1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('sku2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.fillSku(sku);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off SKU setup', function () {
- productSetupPage.clickSetup('SKU');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see sku field', function () {
- expect(addProductPage.txtSku.isPresent()).toBeFalsy();
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see sku field', function () {
- expect(addProductPage.txtSku.isPresent()).toBeFalsy();
- });
- it('should return to previous page', function () {
- browser.navigate().back();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on vendor weight setup', function () {
- productSetupPage.clickSetup('SKU');
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show sku field', function () {
- expect(addProductPage.txtSku.isPresent()).toBeTruthy();
- });
- });
- describe('Product page scenarios - checking for tags', function () {
- var title = commonHelper.uniqueProductName('tags1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('tags2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.addTag(tag);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off tags setup', function () {
- productSetupPage.clickSetup('Tags');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see tags field', function () {
- expect(addProductPage.txtTags.isPresent()).toBeFalsy();
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see tags field', function () {
- expect(addProductPage.txtTags.isPresent()).toBeFalsy();
- });
- it('should fill second product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(secondTitle);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on tags setup', function () {
- productSetupPage.clickSetup('Tags');
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct tags', function () {
- expect(addProductPage.eleSelectedCollection(tag).isDisplayed()).toBeTruthy();
- });
- it('should open edit page for second product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(secondTitle);
- addProductPage.waitForSaveButton();
- });
- it('should see tags field', function () {
- expect(addProductPage.txtTags.isPresent()).toBeTruthy();
- });
- });
- describe('Product page scenarios - checking for description', function () {
- var title = commonHelper.uniqueProductName('description1') + unique_value;
- var secondTitle = commonHelper.uniqueProductName('description2') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- addProductPage.fillDescription('simple description')
- });
- it('should publish first product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-off Description Tabs setup', function () {
- productSetupPage.clickSetup('Description Tabs');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see Description Tabs field', function () {
- expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
- });
- it('should not see description field', function () {
- expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
- });
- it('should fill second product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(secondTitle);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for first product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see description field', function () {
- expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not show description', function () {
- expect(productPage.txtDescription.isPresent()).toBeFalsy()
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should switch-on description setup', function () {
- productSetupPage.clickSetup('Description Tabs');
- });
- it('should show product page after click on first product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show description after switch on', function () {
- expect(productPage.txtDescription.isDisplayed()).toBeTruthy();
- expect(productPage.getDescriptionText()).toContain('simple description')
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open edit page for first product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should see description field with previous data', function () {
- commonHelper.waitUntilElementVisible(addProductPage.eleIframe);
- expect(addProductPage.getDescription()).toContain('simple description')
- });
- });
- describe('Product page scenarios - checking for add description tab', function () {
- var title = commonHelper.uniqueProductName('addDescriptionTab') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should add new description tab', function () {
- productSetupPage.fillNewTab('test');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should see added description tab', function () {
- expect(addProductPage.getDescriptionTab()).toContain('test');
- });
- it('should fill product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show added description tab', function () {
- expect(productPage.getDescriptionText()).toContain('test');
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should delete description with data', function () {
- productSetupPage.clickDeleteTab('test');
- });
- });
- describe('Product page scenarios - checking for delete description tab with move content to existing tab selected in pop-up', function () {
- var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should add new description tab', function () {
- productSetupPage.fillNewTab('test1');
- dashboardPage.openProductSetupPage();
- productSetupPage.fillNewTab('test2');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should see added description tab', function () {
- expect(addProductPage.getDescriptionTab()).toContain('test1');
- expect(addProductPage.getDescriptionTab()).toContain('test2');
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- });
- it('should open added description', function () {
- addProductPage.clickDescriptionSection('test1');
- });
- it('should add description', function () {
- addProductPage.fillDescription('first description');
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show added description tabs', function () {
- expect(productPage.getDescriptionText()).toContain('test1');
- expect(productPage.getDescriptionText()).toContain('test2');
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should delete description with data', function () {
- productSetupPage.clickDeleteTab('test1');
- });
- it('should see delete tab popup', function () {
- commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
- });
- it('should move added content to another existing description', function () {
- productSetupPage.selectTabToMoveData('test2');
- productSetupPage.confirmMoveToExistingTab();
- commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
- });
- it('should open edit page for added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should see moved description', function () {
- addProductPage.clickDescriptionSection('test2');
- expect(addProductPage.getDescription()).toContain('first description');
- browser.switchTo().defaultContent();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not see deleted description tabs', function () {
- expect(productPage.getDescriptionText()).not.toContain('test1');
- expect(productPage.getDescriptionText()).toContain('test2');
- });
- it('should display description on correct tab', function () {
- expect(productPage.getDescriptionContent()).not.toContain('first description');
- productPage.clickDescriptionTab('test2');
- expect(productPage.getDescriptionContent()).toContain('first description');
- });
- });
- describe('Product page scenarios - checking for delete description tab with move content to newly created tab', function () {
- var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should add new description tab', function () {
- productSetupPage.fillNewTab('test1');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should see added description tab', function () {
- expect(addProductPage.getDescriptionTab()).toContain('test1');
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- });
- it('should open added description', function () {
- addProductPage.clickDescriptionSection('test1');
- });
- it('should add description', function () {
- addProductPage.fillDescription('first description');
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show added description tab', function () {
- expect(productPage.getDescriptionText()).toContain('test1');
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should delete description with data', function () {
- productSetupPage.clickDeleteTab('test1');
- });
- it('should see delete tab popup', function () {
- commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
- });
- it('should move added content to newly created tab', function () {
- productSetupPage.clickTabDeleteOption('Move content to new tab');
- productSetupPage.createTabToMoveData('newtab');
- productSetupPage.confirmMoveToNewTab();
- commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
- });
- it('should open edit page for added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should see moved description', function () {
- addProductPage.clickDescriptionSection('newtab');
- expect(addProductPage.getDescription()).toContain('first description');
- browser.switchTo().defaultContent();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not see deleted description tab', function () {
- expect(productPage.getDescriptionText()).not.toContain('test1');
- expect(productPage.getDescriptionText()).toContain('newtab');
- });
- it('should display description on correct tab', function () {
- expect(productPage.getDescriptionContent()).not.toContain('first description');
- productPage.clickDescriptionTab('newtab');
- expect(productPage.getDescriptionContent()).toContain('first description');
- });
- });
- describe('Product page scenarios - checking for delete description tab with removing all content', function () {
- var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should add new description tab', function () {
- productSetupPage.fillNewTab('test1');
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should see added description tab', function () {
- expect(addProductPage.getDescriptionTab()).toContain('test1');
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(title);
- addProductPage.fillPrice(price);
- });
- it('should open added description', function () {
- addProductPage.clickDescriptionSection('test1');
- });
- it('should add description', function () {
- addProductPage.fillDescription('test1 description');
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on first product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show added description tab', function () {
- expect(productPage.getDescriptionText()).toContain('test1');
- });
- it('should display description on correct tab', function () {
- expect(productPage.getDescriptionContent()).not.toContain('test1 description');
- productPage.clickDescriptionTab('test1');
- expect(productPage.getDescriptionContent()).toContain('test1 description');
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should delete description with data', function () {
- productSetupPage.clickDeleteTab('test1');
- });
- it('should see delete tab popup', function () {
- commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
- });
- it('should delete tab with all content', function () {
- productSetupPage.clickTabDeleteOption('Delete all tab content');
- productSetupPage.confirmDeleteTab();
- commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
- });
- it('should open edit page for added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see deleted description tab', function () {
- expect(addProductPage.getDescriptionTab()).not.toContain('test1');
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should not see deleted description tab', function () {
- expect(addProductPage.getDescriptionTab()).not.toContain('test1');
- });
- it('should show product page after click on product link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not see deleted description tab', function () {
- expect(productPage.getDescriptionText()).not.toContain('test1');
- });
- it('should open previous page', function () {
- commonHelper.switchToPreviousTab();
- });
- it('should open Product setup page', function () {
- dashboardPage.openProductSetupPage();
- });
- it('should add new description tab', function () {
- productSetupPage.fillNewTab('test1');
- });
- it('should open edit page for first added product', function () {
- dashboardPage.openProductListPage();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should not see description from deleted tab', function () {
- addProductPage.clickDescriptionSection('test1');
- expect(addProductPage.getDescription()).not.toContain('test1 description');
- browser.switchTo().defaultContent();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not display description from previously deleted tab', function () {
- expect(productPage.txtDescriptionContent.isPresent()).toBeFalsy();
- productPage.clickDescriptionTab('test1');
- expect(productPage.txtDescriptionContent.isPresent()).toBeFalsy();
- });
- });
- describe('Product page scenarios - checking the product URL path', function () {
- var productTitle = commonHelper.uniqueProductName('urlpath') + unique_value;
- var collectionTitle = 'collectionTitle' + unique_value;
- var url = commonHelper.uniqueProductName('newurl') + unique_value;
- var collectionDescription = collectionData.collection.description.first;
- beforeAll(function () {
- commonHelper.acceptAlert();
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new product page', function () {
- dashboardPage.openProductListPage();
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should fill first product form', function () {
- addProductPage.selectType(type);
- addProductPage.fillTitle(productTitle);
- addProductPage.fillPrice(price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(productTitle);
- addProductPage.waitForSaveButton();
- });
- it('should edit url', function () {
- addProductPage.fillUrl(url);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- 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(collectionDescription);
- });
- it('should add manual product', function () {
- addCollectionPage.clickAddProducts();
- addCollectionPage.clickProduct(productTitle);
- addCollectionPage.clickCloseProducts();
- });
- it('should add new collection', function () {
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should open product page with correct link', function () {
- dashboardPage.openProductListPage();
- productListPage.clickProduct(productTitle);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- expect(productPage.productTitle()).toEqual(productTitle);
- expect(browser.getCurrentUrl()).toContain(url.toLowerCase());
- expect(browser.getCurrentUrl()).not.toContain(productTitle);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should not be able to open product with previous link', function () {
- browser.get(storeLink + '/product/' + productTitle);
- expect(browser.getCurrentUrl()).not.toContain(url.toLowerCase());
- expect(browser.getCurrentUrl()).toContain(productTitle);
- expect(productPage.btnAddToCart.isPresent()).toBeFalsy();
- commonHelper.switchToPreviousTab();
- });
- it('should open collection list page', function () {
- dashboardPage.openCollectionListPage();
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(collectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should open product page from collection with correct link', function () {
- collectionsPage.openProduct(productTitle);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- expect(productPage.productTitle()).toEqual(productTitle);
- expect(browser.getCurrentUrl()).toContain(url.toLowerCase());
- expect(browser.getCurrentUrl()).not.toContain(productTitle);
- });
- });
- });
Add Comment
Please, Sign In to add comment