Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multi_variant/edit_product
- var pageObject = require('./../../../../../services/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var dashboardPage = pageObject.getDashboardPage();
- var addProductPage = pageObject.getAddProductPage();
- var productListPage = pageObject.getProductListPage();
- var productPage = pageObject.getProductPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var collectionsPage = pageObject.getCollectionsPage();
- var homePage = pageObject.getHomePage();
- var checkoutPage = pageObject.getCheckoutPage();
- var ordersPage = pageObject.getOrdersPage();
- var cartPage = pageObject.getCartPage();
- var shippingPage = pageObject.getShippingPage();
- var addShippingZonePage = pageObject.getAddShippingZonePage();
- var shippingData = require('./../../../../../data/admin/settings/shipping');
- var signInData = require('./../../../../../data/admin/sign_in/index');
- var productData = require('./../../../../../data/admin/product/index');
- var coreData = require('./../../../../../data/admin/core/index');
- var commonHelper = require('./../../../../../services/helpers/common.helper.js');
- describe('Edit Multi Variant Product', function () {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var unique_value = commonHelper.uniqueValue();
- var type = productData.product.type;
- var price = productData.product.price;
- var comparePrice = productData.product.comparePrice;
- var weight = productData.product.weight;
- var tag = productData.product.tag;
- var sku = productData.product.sku;
- var tabName = productData.product.tabName;
- var firstImage = 'car.jpg';
- var secondImage = 'bike.png';
- var thirdImage = 'laptop.jpg';
- var firstColor = productData.product.color.first;
- var secondColor = productData.product.color.second;
- var thirdColor = productData.product.color.third;
- var firstColorCode = productData.product.colorCode.first;
- var secondColorCode = productData.product.colorCode.second;
- var firstSize = productData.product.size.first;
- var secondSize = productData.product.size.second;
- var thirdSize = productData.product.size.third;
- var firstStyle = productData.product.style.first;
- var secondStyle = productData.product.style.second;
- var firstMaterial = productData.product.material.first;
- var secondMaterial = productData.product.material.second;
- var firstVariant = firstColor + ' / ' + firstSize;
- var secondVariant = firstColor + ' / ' + secondSize;
- var thirdVariant = firstColor + ' / ' + thirdSize;
- var fourthVariant = secondColor + ' / ' + firstSize;
- var fifthVariant = secondColor + ' / ' + secondSize;
- var sixthVariant = secondColor + ' / ' + thirdSize;
- var seventhVariant = thirdColor + ' / ' + firstSize;
- var eighthVariant = thirdColor + ' / ' + secondSize;
- var ninthVariant = thirdColor + ' / ' + thirdSize;
- var cardNumber = coreData.cardNumber;
- var cardName = coreData.cardName;
- var cardDate = coreData.cardDate;
- var cardCVV = coreData.cardCVV;
- var emailAddress = unique_value + '@mailinator.com';
- var country = coreData.country;
- var firstName = coreData.firstName;
- var lastName = coreData.lastName;
- var streetAddress = coreData.streetAddress;
- var suite = coreData.suite;
- var city = coreData.city;
- var zip = coreData.zip;
- var phone = coreData.phone;
- var name = shippingData.zone.name.first + unique_value;
- var description = shippingData.zone.description.first;
- var rate = '$10.00';
- /*
- describe('multi variant product edit type', function () {
- var title = commonHelper.uniqueProductName('editm1') + unique_value;
- var secondType = type + 'edit';
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit type', function () {
- addProductPage.selectType(secondType);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct selected type', function () {
- expect(addProductPage.selectedType()).toEqual(secondType);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- });
- describe('multi variant product edit collections', function () {
- var title = commonHelper.uniqueProductName('editm2') + unique_value;
- var firstCollectionTitle = 'editm1' + unique_value;
- var secondCollectionTitle = 'editm2' + 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 new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should add first collection', function () {
- addCollectionPage.fillTitle(firstCollectionTitle);
- addCollectionPage.fillDescription('simple description');
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(firstCollectionTitle));
- });
- it('should redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectCollection(firstCollectionTitle);
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should add second collection', function () {
- addCollectionPage.fillTitle(secondCollectionTitle);
- addCollectionPage.fillDescription('simple description');
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(secondCollectionTitle));
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open edit page for added product', function () {
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit collection', function () {
- addProductPage.clickDeleteCollection(firstCollectionTitle);
- addProductPage.selectCollection(secondCollectionTitle);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct selected collection', function () {
- expect(addProductPage.eleSelectedCollection(secondCollectionTitle).isDisplayed()).toBeTruthy();
- });
- 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 show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(title);
- commonHelper.switchToPreviousTab();
- });
- it('should open collection list page', function () {
- dashboardPage.openCollectionListPage();
- });
- it('should show collection page after click on collection link', function () {
- collectionListPage.clickCollection(secondCollectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(title).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit multiple collections', function () {
- var title = commonHelper.uniqueProductName('editm3') + unique_value;
- var firstCollectionTitle = 'editm3' + unique_value;
- var secondCollectionTitle = 'editm4' + 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 new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should add first collection', function () {
- addCollectionPage.fillTitle(firstCollectionTitle);
- addCollectionPage.fillDescription('simple description');
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(firstCollectionTitle));
- });
- it('should redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectCollection(firstCollectionTitle);
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should add second collection', function () {
- addCollectionPage.fillTitle(secondCollectionTitle);
- addCollectionPage.fillDescription('simple description');
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(secondCollectionTitle));
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open edit page for added product', function () {
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit collection', function () {
- addProductPage.selectCollection(secondCollectionTitle);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct selected collection', function () {
- expect(addProductPage.eleSelectedCollection(secondCollectionTitle).isDisplayed()).toBeTruthy();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct selected collection', function () {
- expect(addProductPage.eleSelectedCollection(firstCollectionTitle).isDisplayed()).toBeTruthy();
- expect(addProductPage.eleSelectedCollection(secondCollectionTitle).isDisplayed()).toBeTruthy();
- });
- 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 show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(title);
- commonHelper.switchToPreviousTab();
- });
- it('should open collection list page', function () {
- dashboardPage.openCollectionListPage();
- });
- it('should show collection page after click on second collection link', function () {
- collectionListPage.clickCollection(secondCollectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(title).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- it('should show collection page after click on first collection link', function () {
- collectionListPage.clickCollection(firstCollectionTitle);
- commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
- expect(collectionsPage.productTitle(title).isDisplayed()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit - shipping weight, tags, sku', function () {
- var title = commonHelper.uniqueProductName('editm4') + unique_value;
- var firstTag = 'FirstTag' + unique_value;
- var secondTag = 'SecondTag' + unique_value;
- var secondShippingWeight = '5';
- var secondSku = 'KUV-OK-LR-23-ER-T43';
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- addProductPage.addTag(firstTag);
- addProductPage.fillShippingWeight(weight);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.fillVariantSku(firstVariant, sku);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit weight, tag and sku', function () {
- addProductPage.fillShippingWeight(secondShippingWeight);
- addProductPage.clickDeleteCollection(firstTag);
- addProductPage.addTag(secondTag);
- addProductPage.fillVariantSku(firstVariant, secondSku);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should show correct tag', function () {
- expect(addProductPage.eleSelectedCollection(secondTag).isDisplayed()).toBeTruthy();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- });
- describe('multi variant product edit page SEO title', function () {
- var title = commonHelper.uniqueProductName('editm5') + unique_value;
- var seoTitle = 'seo';
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit seo title', function () {
- addProductPage.fillSeoTitle(seoTitle);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page and show correct title, seo title on product page', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- expect(productPage.productTitle()).toEqual(title);
- expect(homePage.pixelCode('head', seoTitle).isPresent()).toBeTruthy();
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit page SEO url', function () {
- var title = commonHelper.uniqueProductName('editm6') + unique_value;
- var url = commonHelper.uniqueProductName('editm7') + 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open edit page for added product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit url', function () {
- addProductPage.fillUrl(url);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page with correct link', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- expect(productPage.productTitle()).toEqual(title);
- expect(browser.getCurrentUrl()).toContain(url.toLowerCase());
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit variants - add one option value to a changes product look variant', function () {
- var title = commonHelper.uniqueProductName('editm8') + unique_value;
- var secondPrice = '$30.00';
- var firstThumbnail, secondThumbnail, firstProductImage, secondProductImage;
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should save thumbnail source', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(title));
- productListPage.productImage(title).getAttribute('style').then(function (value) {
- firstThumbnail = value;
- });
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should save main image source', function () {
- productPage.eleProductImage.getAttribute('src').then(function (value) {
- firstProductImage = value;
- });
- });
- it('should edit product', function () {
- commonHelper.switchToPreviousTab();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should add new color in first option', function () {
- addProductPage.fillOptionValue(0, secondColor);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(fourthVariant, secondPrice);
- });
- it('should add image', function () {
- addProductPage.uploadImage(1, secondImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should save thumbnail source', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(title));
- productListPage.productImage(title).getAttribute('style').then(function (value) {
- secondThumbnail = value;
- });
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should save main image source', function () {
- productPage.eleProductImage.getAttribute('src').then(function (value) {
- secondProductImage = value;
- });
- });
- it('should not see image changes', function () {
- expect(firstThumbnail).toEqual(secondThumbnail);
- expect(firstProductImage).toEqual(secondProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(title);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(10000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select second color', function () {
- productPage.selectOption('color', secondColor);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit variants - remove option value to changes product look variant', function () {
- var title = commonHelper.uniqueProductName('editm9') + unique_value;
- var secondPrice = '$30.00';
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.fillVariantPrice(fourthVariant, secondPrice);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(2, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should delete color', function () {
- addProductPage.clickDeleteCollection(secondColor);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should not show second color', function () {
- expect(productPage.eleOption(secondColor).isPresent()).toBeFalsy();
- });
- });
- describe('multi variant product variant thumbnail selector edit - via hex value, via image, image back to hex', function () {
- var title = commonHelper.uniqueProductName('editm10') + 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, thirdImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should click thumbnail selector for first option', function () {
- addProductPage.clickThumbnailSelectorRadio(0);
- });
- it('should click add - edit thumbnails for first option', function () {
- addProductPage.clickAddThumbnails(0);
- });
- it('should set color codes for two colors', function () {
- addProductPage.fillColorCode(firstColor, firstColorCode);
- addProductPage.fillColorCode(secondColor, secondColorCode);
- });
- it('should click submit button in add - edit', function () {
- addProductPage.clickSubmitThumbnail();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show color buttons', function () {
- expect(productPage.eleColor(firstColorCode).isPresent()).toBeTruthy();
- expect(productPage.eleColor(secondColorCode).isPresent()).toBeTruthy();
- });
- it('should edit product', function () {
- commonHelper.switchToPreviousTab();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should click add - edit thumbnails for first option', function () {
- addProductPage.clickAddThumbnails(0);
- });
- it('should click swatch image', function () {
- addProductPage.clickSwatchImage(firstColor);
- addProductPage.clickSwatchImage(secondColor);
- });
- it('should add images', function () {
- addProductPage.uploadImage(2, firstImage);
- addProductPage.uploadImage(3, secondImage);
- });
- it('should click submit button in add - edit', function () {
- addProductPage.clickSubmitThumbnail();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show color buttons', function () {
- expect(productPage.allColorButtons.count()).toEqual(2);
- });
- it('should edit product', function () {
- commonHelper.switchToPreviousTab();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should click add - edit thumbnails for first option', function () {
- addProductPage.clickAddThumbnails(0);
- });
- it('should click swatch image', function () {
- addProductPage.clickColorCode(firstColor);
- addProductPage.clickColorCode(secondColor);
- });
- it('should set color codes for two colors', function () {
- addProductPage.fillColorCode(firstColor, firstColorCode);
- addProductPage.fillColorCode(secondColor, secondColorCode);
- });
- it('should click submit button in add - edit', function () {
- addProductPage.clickSubmitThumbnail();
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show color buttons', function () {
- expect(productPage.eleColor(firstColorCode).isPresent()).toBeTruthy();
- expect(productPage.eleColor(secondColorCode).isPresent()).toBeTruthy();
- });
- });
- describe('multi variant product edit - add another variant that changes product look', function () {
- var title = commonHelper.uniqueProductName('editm11') + unique_value;
- var secondPrice = '$40.00';
- var secondComparePrice = '$50.00';
- 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should add third option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(2, 'Style');
- addProductPage.fillOptionValue(2, firstStyle);
- addProductPage.fillOptionValue(2, secondStyle);
- addProductPage.clickProductLookCheckbox(2);
- });
- it('should add images for first color', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should add images for second color', function () {
- addProductPage.uploadImage(2, secondImage);
- addProductPage.uploadImage(2, thirdImage);
- });
- it('should fill first variant', function () {
- var firstVariant = firstColor + ' / ' + firstSize + ' / ' + firstStyle;
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(title);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select second color', function () {
- productPage.selectOption('color', secondColor);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select second size', function () {
- productPage.selectOption('size', secondSize);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select second color', function () {
- productPage.selectOption('style', secondStyle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- });
- describe('multi variant product edit - add another variant that does not change product look', function () {
- var title = commonHelper.uniqueProductName('editm12') + unique_value;
- var secondPrice = '$40.00';
- var secondComparePrice = '$50.00';
- 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 select multi variant', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should add third option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(2, 'Style');
- addProductPage.fillOptionValue(2, firstStyle);
- addProductPage.fillOptionValue(2, secondStyle);
- });
- it('should add image', function () {
- addProductPage.uploadImage(1, thirdImage);
- });
- it('should fill variant price', function () {
- var firstVariant = firstColor + ' / ' + firstSize + ' / ' + firstStyle;
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(title);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- it('should select second color', function () {
- productPage.selectOption('color', secondColor);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- it('should select second size', function () {
- productPage.selectOption('size', secondSize);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- it('should select second color', function () {
- productPage.selectOption('style', secondStyle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- });
- describe('multi variant product edit to delete all variants and replace with new ones', function () {
- var title = commonHelper.uniqueProductName('editm13') + 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- });
- it('should add image', function () {
- addProductPage.uploadImage(1, firstImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should delete all variants', function(){
- addProductPage.clickDeleteOption(0);
- addProductPage.clickDeleteOption(0);
- });
- it('should add first option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- });
- describe('multi variant product edit to add more images', function () {
- var title = commonHelper.uniqueProductName('editm14') + 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.fillOptionValue(0, thirdColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillOptionValue(1, thirdSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images for first color', function () {
- addProductPage.uploadImage(1, firstImage);
- });
- it('should add images for second color', function () {
- addProductPage.uploadImage(2, secondImage);
- });
- it('should add images for third color', function () {
- addProductPage.uploadImage(3, thirdImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should add images to first color', function () {
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, thirdImage);
- });
- it('should add images to second color', function () {
- addProductPage.uploadImage(2, firstImage);
- addProductPage.uploadImage(2, thirdImage);
- });
- it('should add images to third color', function () {
- addProductPage.uploadImage(3, firstImage);
- addProductPage.uploadImage(3, secondImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- });
- describe('multi-variant product edit prices and compare at prices', function () {
- var title = commonHelper.uniqueProductName('editm15') + unique_value;
- var secondPrice = '$40.00';
- var secondComparePrice = '$50.00';
- 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct new product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product new compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- });
- describe('multi-variant product edit default variant selection', function () {
- var title = commonHelper.uniqueProductName('editm16') + unique_value;
- var secondPrice = '$40.00';
- var secondComparePrice = '$50.00';
- 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill first and second variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.fillVariantPrice(secondVariant, secondPrice);
- addProductPage.fillVariantComparePrice(secondVariant, secondComparePrice);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should change the default variant', function () {
- addProductPage.clickDefaultVariantCheckbox(secondVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should select second size', function () {
- productPage.selectOption('size', firstSize);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- });
- describe('multi-variant product edit some of them to off via switch', function () {
- var title = commonHelper.uniqueProductName('editm17') + 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill first and second variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should edit product', function () {
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should switch off second variant', function () {
- addProductPage.clickSwitchOff(secondVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should not show disabled variant', function () {
- expect(productPage.eleOption(secondSize).isPresent()).toBeFalsy();
- });
- });
- */
- describe('checking for edit multi variant product prices, images and names and then checking effect on existing Orders with it', function () {
- var productTitle = commonHelper.uniqueProductName('editm18') + unique_value;
- var secondProductTitle = commonHelper.uniqueProductName('editm19') + unique_value;
- var secondPrice = '$30.00';
- var secondComparePrice = '$35.00';
- var orderNumber;
- 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 shipping page', function () {
- dashboardPage.openShippingPage();
- });
- it('should delete all zones', function check(done) {
- commonHelper.waitUntilElementInvisible(shippingPage.imgLoader);
- shippingPage.allShippings.count().then(function(result) {
- if(result == 0) {
- done();
- } else {
- shippingPage.allShippings.get(0).getText().then(function (value) {
- shippingPage.openForEdit(value);
- addShippingZonePage.clickDeleteZone();
- });
- check(done);
- }
- })
- }, 30000);
- it('should open new zone page', function () {
- shippingPage.clickAddZone();
- addShippingZonePage.waitForSaveButton();
- });
- it('should add new zone', function () {
- addShippingZonePage.setZoneName(name);
- addShippingZonePage.setShippingRate(rate.replace('$', ''));
- addShippingZonePage.setServiceDescription(description);
- addShippingZonePage.setCountry(country);
- addShippingZonePage.clickSave();
- });
- it('should contain new shipping zone', function() {
- commonHelper.waitUntilElementVisible(shippingPage.shippingZoneEntry(name));
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, secondImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should show product image', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(productTitle));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(productTitle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(productTitle);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select 1 product', function () {
- productPage.clickUp(1);
- });
- it('should click add to cart button', function () {
- productPage.clickAddToCart();
- commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- });
- it('should show correct total price in cart', function () {
- expect(cartPage.totalPrice()).toEqual('25.00');
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should show correct product', function () {
- expect(checkoutPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(productTitle)).toEqual('$25.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(productTitle)).toEqual('$25.00');
- });
- it('should fill email address', function () {
- checkoutPage.fillEmailAddress(emailAddress);
- });
- it('should fill contact information form', function () {
- checkoutPage.selectCountry(country);
- checkoutPage.selectState(city);
- checkoutPage.fillCity(city);
- checkoutPage.fillZip(zip);
- commonHelper.waitUntilElementPresent(checkoutPage.selectedShipping(description));
- checkoutPage.fillFirstName(firstName);
- checkoutPage.fillLastName(lastName);
- checkoutPage.fillStreetAddress(streetAddress);
- checkoutPage.fillSuite(suite);
- checkoutPage.fillPhone(phone);
- });
- it('should fill payment form', function () {
- checkoutPage.fillCardNumberField(cardNumber);
- checkoutPage.fillCardNameField(cardName);
- checkoutPage.fillCardDateField(cardDate);
- checkoutPage.fillCVVField(cardCVV);
- });
- it('should show correct prices', function () {
- commonHelper.waitUntilElementVisible(checkoutPage.txtShippingPrice);
- expect(checkoutPage.shippingPrice()).toEqual('$10.00');
- expect(checkoutPage.subtotalPrice()).toEqual('$35.00');
- expect(checkoutPage.taxes()).toEqual('$0.00');
- expect(checkoutPage.totalPrice()).toEqual('$35.00');
- });
- it('should click complete order', function () {
- checkoutPage.clickCompleteOrder();
- commonHelper.waitUntilElementVisible(checkoutPage.txtOrder);
- });
- it('should save order number', function () {
- checkoutPage.txtOrder.getText().then(function (value) {
- orderNumber = value.split(' ')[1];
- });
- });
- it('should redirect on admin dashboard page', function () {
- browser.get(signInData.link);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders list', function () {
- dashboardPage.openOrdersPage();
- commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- });
- it('should show last order in the first row', function () {
- expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- });
- it('should open needed order', function () {
- ordersPage.clickOrderEntry(orderNumber);
- commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- });
- it('should show correct products', function () {
- expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product image', function () {
- expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$25.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$35.00');
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open edit product', function () {
- productListPage.editProduct(productTitle);
- addProductPage.waitForSaveButton();
- });
- it('should edit product prices and title', function () {
- addProductPage.fillTitle(secondProductTitle);
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should delete old pictures', function () {
- addProductPage.deleteImage(1);
- addProductPage.deleteImage(1);
- });
- it('should add another pictures', function () {
- addProductPage.uploadImage(1, thirdImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(secondProductTitle));
- });
- it('should redirect on admin dashboard page', function () {
- browser.get(signInData.link);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders list', function () {
- dashboardPage.openOrdersPage();
- commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- });
- it('should show last order in the first row', function () {
- expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- });
- it('should open needed order', function () {
- ordersPage.clickOrderEntry(orderNumber);
- commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- });
- it('should show new correct products', function () {
- expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product image', function () {
- expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$25.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$35.00');
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(secondProductTitle));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(secondProductTitle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(secondProductTitle);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select 1 product', function () {
- productPage.clickUp(1);
- });
- it('should click add to cart button', function () {
- productPage.clickAddToCart();
- commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- });
- it('should show correct total price in cart', function () {
- expect(cartPage.totalPrice()).toEqual('30.00');
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should show correct product', function () {
- expect(checkoutPage.productName(secondProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(secondProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(secondProductTitle)).toEqual('$30.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(secondProductTitle)).toEqual('$30.00');
- });
- });
- describe('checking for delete purchased variant from product and then checking effect on existing orders with it', function () {
- var productTitle = commonHelper.uniqueProductName('editm20') + unique_value;
- var secondPrice = '$30.00';
- var secondComparePrice = '$35.00';
- var thirdPrice = '$35.00';
- var thirdComparePrice = '$40.00';
- var orderNumber;
- 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 shipping page', function () {
- dashboardPage.openShippingPage();
- });
- it('should delete all zones', function check(done) {
- commonHelper.waitUntilElementInvisible(shippingPage.imgLoader);
- shippingPage.allShippings.count().then(function(result) {
- if(result == 0) {
- done();
- } else {
- shippingPage.allShippings.get(0).getText().then(function (value) {
- shippingPage.openForEdit(value);
- addShippingZonePage.clickDeleteZone();
- });
- check(done);
- }
- })
- }, 30000);
- it('should open new zone page', function () {
- shippingPage.clickAddZone();
- addShippingZonePage.waitForSaveButton();
- });
- it('should add new zone', function () {
- addShippingZonePage.setZoneName(name);
- addShippingZonePage.setShippingRate(rate.replace('$', ''));
- addShippingZonePage.setServiceDescription(description);
- addShippingZonePage.setCountry(country);
- addShippingZonePage.clickSave();
- });
- it('should contain new shipping zone', function() {
- commonHelper.waitUntilElementVisible(shippingPage.shippingZoneEntry(name));
- });
- it('should redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(productTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill first variant', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, secondImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should show product image', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(productTitle));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(productTitle);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should select 1 product', function () {
- productPage.clickUp(1);
- });
- it('should click add to cart button', function () {
- productPage.clickAddToCart();
- commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should fill email address', function () {
- checkoutPage.fillEmailAddress(emailAddress);
- });
- it('should fill contact information form', function () {
- checkoutPage.selectCountry(country);
- checkoutPage.selectState(city);
- checkoutPage.fillCity(city);
- checkoutPage.fillZip(zip);
- commonHelper.waitUntilElementPresent(checkoutPage.selectedShipping(description));
- checkoutPage.fillFirstName(firstName);
- checkoutPage.fillLastName(lastName);
- checkoutPage.fillStreetAddress(streetAddress);
- checkoutPage.fillSuite(suite);
- checkoutPage.fillPhone(phone);
- });
- it('should fill payment form', function () {
- checkoutPage.fillCardNumberField(cardNumber);
- checkoutPage.fillCardNameField(cardName);
- checkoutPage.fillCardDateField(cardDate);
- checkoutPage.fillCVVField(cardCVV);
- });
- it('should show correct prices', function () {
- commonHelper.waitUntilElementVisible(checkoutPage.txtShippingPrice);
- expect(checkoutPage.shippingPrice()).toEqual('$10.00');
- expect(checkoutPage.subtotalPrice()).toEqual('$35.00');
- expect(checkoutPage.taxes()).toEqual('$0.00');
- expect(checkoutPage.totalPrice()).toEqual('$35.00');
- });
- it('should click complete order', function () {
- checkoutPage.clickCompleteOrder();
- commonHelper.waitUntilElementVisible(checkoutPage.txtOrder);
- });
- it('should save order number', function () {
- checkoutPage.txtOrder.getText().then(function (value) {
- orderNumber = value.split(' ')[1];
- });
- });
- it('should redirect on admin dashboard page after login', function () {
- browser.get(signInData.link);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders list', function () {
- dashboardPage.openOrdersPage();
- commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- });
- it('should show last order in the first row', function () {
- expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- });
- it('should open needed order', function () {
- ordersPage.clickOrderEntry(orderNumber);
- commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- });
- it('should show correct products', function () {
- expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product image', function () {
- expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$25.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$35.00');
- });
- it('should open 2 edit product', function () {
- commonHelper.switchToPreviousTab();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- productListPage.editProduct(productTitle);
- addProductPage.waitForSaveButton();
- });
- it('should delete product colors and sizes', function () {
- addProductPage.clickDeleteCollection(firstColor);
- addProductPage.clickDeleteCollection(secondColor);
- addProductPage.clickDeleteCollection(firstSize);
- addProductPage.clickDeleteCollection(secondSize);
- });
- it('should add first option', function () {
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.fillOptionValue(0, thirdColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillOptionValue(1, thirdSize);
- });
- it('should add pictures for first color', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, secondImage);
- });
- it('should add pictures for second color', function () {
- addProductPage.uploadImage(1, thirdImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should fill first variant', function () {
- var firstVariant = secondColor + ' / ' + secondSize;
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should redirect on admin dashboard page after login', function () {
- browser.get(signInData.link);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders list', function () {
- dashboardPage.openOrdersPage();
- commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- });
- it('should show last order in the first row', function () {
- expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- });
- it('should open needed order', function () {
- ordersPage.clickOrderEntry(orderNumber);
- commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- });
- it('should show correct products', function () {
- expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product image', function () {
- expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$25.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$35.00');
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(productTitle);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should select 1 product', function () {
- productPage.clickUp(1);
- });
- it('should click add to cart button', function () {
- productPage.clickAddToCart();
- commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should show correct product', function () {
- expect(checkoutPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(productTitle)).toEqual('$30.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(productTitle)).toEqual('$30.00');
- commonHelper.switchToPreviousTab();
- });
- it('should open products list page', function () {
- commonHelper.switchToPreviousTab();
- dashboardPage.openProductListPage();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should open edit product', function () {
- productListPage.editProduct(productTitle);
- addProductPage.waitForSaveButton();
- });
- it('should delete old options', function () {
- addProductPage.clickDeleteOption(1);
- addProductPage.clickDeleteOption(0);
- });
- it('should add second option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(0, 'Style');
- addProductPage.fillOptionValue(0, firstStyle);
- addProductPage.fillOptionValue(0, secondStyle);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add third option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(1, 'Material');
- addProductPage.fillOptionValue(1, firstMaterial);
- addProductPage.fillOptionValue(1, secondMaterial);
- });
- it('should add pictures for t-shirt', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, secondImage);
- addProductPage.uploadImage(1, thirdImage);
- addProductPage.uploadImage(1, firstImage);
- });
- it('should fill sixth variant', function () {
- var firstVariant = firstStyle + ' / ' + firstMaterial;
- addProductPage.fillVariantPrice(firstVariant, thirdPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, thirdComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- });
- it('should redirect on admin dashboard page after login', function () {
- browser.get(signInData.link);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders list', function () {
- dashboardPage.openOrdersPage();
- commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- });
- it('should show last order in the first row', function () {
- expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- });
- it('should open needed order', function () {
- ordersPage.clickOrderEntry(orderNumber);
- commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- });
- it('should show new correct products', function () {
- expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product image', function () {
- expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$25.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$35.00');
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(productTitle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(thirdPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(thirdComparePrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(productTitle);
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should select 1 product', function () {
- productPage.clickUp(1);
- });
- it('should click add to cart button', function () {
- productPage.clickAddToCart();
- commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should show correct product', function () {
- expect(checkoutPage.productName(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(productTitle)).toEqual('$35.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(productTitle)).toEqual('$35.00');
- });
- });
- describe('multi-variant product edit image order', function () {
- var title = commonHelper.uniqueProductName('editm21') + unique_value;
- var firstThumbnail, secondThumbnail, firstProductImage, secondProductImage;
- 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 product list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should open new product page', function () {
- productListPage.clickAddProduct();
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill first and second variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add some images', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should save thumbnail source', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(title));
- productListPage.productImage(title).getAttribute('style').then(function (value) {
- firstThumbnail = value;
- });
- });
- it('should edit product', function () {
- commonHelper.switchToPreviousTab();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should change order for images', function () {
- addProductPage.dragAndDropImage(1, 2);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should save thumbnail source', function () {
- commonHelper.waitUntilElementVisible(productListPage.productImage(title));
- productListPage.productImage(title).getAttribute('style').then(function (value) {
- secondThumbnail = value;
- });
- });
- it('should open product page', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- it('should save main image source', function () {
- productPage.eleProductImage.getAttribute('src').then(function (value) {
- secondProductImage = value;
- });
- commonHelper.switchToPreviousTab();
- });
- it('should see image changes', function () {
- expect(firstThumbnail).not.toEqual(secondThumbnail);
- expect(firstProductImage).not.toEqual(secondProductImage);
- });
- });
- // describe('checking for edit multi variant product price and checking effect on cart and checkout on fes', function () {
- //
- // var productTitle = commonHelper.uniqueProductName('editm20') + unique_value;
- //
- // var firstPrice = '$10.00';
- // var firstComparePrice = '$10.00';
- // var secondPrice = '$20.00';
- // var secondComparePrice = '$20.00';
- // var thirdPrice = '$30.00';
- // var thirdComparePrice = '$30.00';
- //
- // var orderNumber;
- //
- // 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 shipping page', function () {
- // dashboardPage.openShippingPage();
- // });
- //
- // it('should delete all zones', function check(done) {
- // commonHelper.waitUntilElementInvisible(shippingPage.imgLoader);
- // shippingPage.allShippings.count().then(function (result) {
- // if (result == 0) {
- // done();
- // } else {
- // shippingPage.allShippings.get(0).getText().then(function (value) {
- // shippingPage.openForEdit(value);
- // addShippingZonePage.clickDeleteZone();
- // });
- // check(done);
- // }
- // })
- // }, 30000);
- //
- // it('should open new zone page', function () {
- // shippingPage.clickAddZone();
- // addShippingZonePage.waitForSaveButton();
- // });
- //
- // it('should add new zone', function () {
- // addShippingZonePage.setZoneName(name);
- // addShippingZonePage.setShippingRate(rate.replace('$', ''));
- // addShippingZonePage.setServiceDescription(description);
- // addShippingZonePage.setCountry(country);
- // addShippingZonePage.clickSave();
- // });
- //
- // it('should contain new shipping zone', function () {
- // commonHelper.waitUntilElementVisible(shippingPage.shippingZoneEntry(name));
- // });
- //
- // it('should redirect on add product page', function () {
- // browser.get(productData.addLink);
- // addProductPage.waitForPublishButton();
- // });
- //
- // it('should select multi variant', function () {
- // addProductPage.clickMulti();
- // });
- //
- // it('should fill new product form', function () {
- // addProductPage.selectType(type);
- // addProductPage.selectFirstCollection();
- // addProductPage.fillTitle(productTitle);
- // addProductPage.fillShippingWeight(weight);
- // addProductPage.addTag(tag);
- // });
- //
- // it('should add first option', function () {
- // addProductPage.fillOptionTitle(0, 'Color');
- // addProductPage.fillOptionValue(0, firstColor);
- // addProductPage.fillOptionValue(0, secondColor);
- // addProductPage.clickProductLookCheckbox(0);
- // });
- //
- // it('should add second option', function () {
- // addProductPage.fillOptionTitle(1, 'Size');
- // addProductPage.fillOptionValue(1, firstSize);
- // addProductPage.fillOptionValue(1, secondSize);
- // });
- //
- // it('should fill first variant', function () {
- // addProductPage.fillVariantPrice(firstVariant, firstPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // addProductPage.fillVariantComparePrice(firstVariant, firstComparePrice);
- // addProductPage.clickVariantComparePriceAutofill(firstVariant);
- // });
- //
- // it('should add images for red and blue', function () {
- // addProductPage.uploadImage(0, firstImage);
- // addProductPage.uploadImage(0, secondImage);
- // addProductPage.uploadImage(1, firstImage);
- // addProductPage.uploadImage(1, secondImage);
- // });
- //
- // it('should publish product', function () {
- // addProductPage.clickPublish();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- // });
- //
- // it('should show product image', function () {
- // commonHelper.waitUntilElementVisible(productListPage.productImage(productTitle));
- // });
- //
- // it('should show product page after click on product link', function () {
- // productListPage.clickProduct(productTitle);
- // commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- // });
- //
- // it('should select 1 product', function () {
- // productPage.clickUp(1);
- // });
- //
- // it('should click add to cart button before switch', function () {
- // productPage.clickAddToCart();
- // commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- // });
- //
- // it('should show correct total price in cart', function () {
- // expect(cartPage.totalPrice()).toEqual('10.00');
- // });
- //
- // it('should go to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open edit product', function () {
- // productListPage.editProduct(productTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should fill first and second variant prices', function () {
- // addProductPage.fillVariantPrice(firstVariant, secondPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- // addProductPage.clickVariantComparePriceAutofill(firstVariant);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- // });
- //
- // it('should go to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- //
- // it('should click checkout button', function () {
- // cartPage.clickCheckout();
- // commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- // });
- //
- // it('should show correct product', function () {
- // expect(checkoutPage.productName(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show product images', function () {
- // expect(checkoutPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show correct prices for products', function () {
- // expect(checkoutPage.productPrice(productTitle)).toEqual('$20.00 x 1');
- // });
- //
- // it('should show correct subtotals for products', function () {
- // expect(checkoutPage.productSubtotal(productTitle)).toEqual('$20.00');
- // });
- //
- // it('should go to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open 3 edit product', function () {
- // productListPage.editProduct(productTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should fill first and second variant prices', function () {
- // addProductPage.fillVariantPrice(firstVariant, thirdPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // addProductPage.fillVariantComparePrice(firstVariant, thirdComparePrice);
- // addProductPage.clickVariantComparePriceAutofill(firstVariant);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- // });
- //
- // it('should go to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- //
- // it('should show correct product', function () {
- // expect(checkoutPage.productName(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show product images', function () {
- // expect(checkoutPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show correct prices for products', function () {
- // expect(checkoutPage.productPrice(productTitle)).toEqual('$20.00 x 1');
- // });
- //
- // it('should show correct subtotals for products', function () {
- // expect(checkoutPage.productSubtotal(productTitle)).toEqual('$20.00');
- // });
- //
- // it('should fill email address', function () {
- // checkoutPage.fillEmailAddress(emailAddress);
- // });
- //
- // it('should fill contact information form', function () {
- // checkoutPage.selectCountry(country);
- // checkoutPage.selectState(city);
- // checkoutPage.fillCity(city);
- // checkoutPage.fillZip(zip);
- // commonHelper.waitUntilElementPresent(checkoutPage.selectedShipping(description));
- // checkoutPage.fillFirstName(firstName);
- // checkoutPage.fillLastName(lastName);
- // checkoutPage.fillStreetAddress(streetAddress);
- // checkoutPage.fillSuite(suite);
- // checkoutPage.fillPhone(phone);
- // });
- //
- // it('should fill payment form', function () {
- // checkoutPage.fillCardNumberField(cardNumber);
- // checkoutPage.fillCardNameField(cardName);
- // checkoutPage.fillCardDateField(cardDate);
- // checkoutPage.fillCVVField(cardCVV);
- // });
- //
- // it('should show correct prices', function () {
- // commonHelper.waitUntilElementVisible(checkoutPage.txtShippingPrice);
- // expect(checkoutPage.shippingPrice()).toEqual('$10.00');
- // expect(checkoutPage.subtotalPrice()).toEqual('$30.00');
- // expect(checkoutPage.taxes()).toEqual('$0.00');
- // expect(checkoutPage.totalPrice()).toEqual('$30.00');
- // });
- //
- // it('should click complete order', function () {
- // checkoutPage.clickCompleteOrder();
- // });
- //
- // it('should show error message', function () {
- // browser.sleep(2000);
- // expect(checkoutPage.chkErrorMessage()).toEqual('Products in your cart have been updated by the store owner, please refresh the page to review the changes');
- // });
- //
- // it('should click complete order', function () {
- // checkoutPage.clickCompleteOrder();
- // commonHelper.waitUntilElementVisible(checkoutPage.txtOrder);
- // });
- //
- // it('should save order number', function () {
- // checkoutPage.txtOrder.getText().then(function (value) {
- // orderNumber = value.split(' ')[1];
- // });
- // });
- //
- // it('should redirect on admin dashboard page after login', function () {
- // browser.get(signInData.link);
- // commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- // });
- //
- // it('should open orders list', function () {
- // dashboardPage.openOrdersPage();
- // commonHelper.waitUntilElementVisible(ordersPage.orderEntry(orderNumber));
- // });
- //
- // it('should show last order in the first row', function () {
- // expect(ordersPage.firstOrder().getText()).toContain(orderNumber);
- // });
- //
- // it('should open needed order', function () {
- // ordersPage.clickOrderEntry(orderNumber);
- // commonHelper.waitUntilElementVisible(ordersPage.lnkAllItems);
- // });
- //
- // it('should show new correct products', function () {
- // expect(ordersPage.productName(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show product image', function () {
- // expect(ordersPage.productImage(productTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show correct order price', function () {
- // commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- // expect(ordersPage.subtotalPrice()).toEqual('$30.00');
- // expect(ordersPage.shippingPrice()).toEqual('$10.00');
- // expect(ordersPage.taxes()).toEqual('$0.00');
- // expect(ordersPage.totalPrice()).toEqual('$40.00');
- // });
- // });
- describe('multi variant product edit description', function () {
- var title = commonHelper.uniqueProductName('editm21') + unique_value;
- var firstDescription = 'first description';
- var secondDescription = 'second description';
- 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 select multi variant', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- });
- it('should fill description', function () {
- addProductPage.fillDescription(firstDescription);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, thirdColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should fill first variant price', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, price);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct description on product page', function () {
- expect(productPage.productDescription()).toContain(tabName);
- expect(productPage.productDescription()).toContain(firstDescription);
- });
- it('should open edit page for added product', function () {
- commonHelper.switchToPreviousTab();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should edit description', function () {
- addProductPage.fillDescription(secondDescription);
- });
- 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);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct description on product page', function () {
- expect(productPage.productDescription()).toContain(tabName);
- expect(productPage.productDescription()).toContain(secondDescription);
- commonHelper.switchToPreviousTab();
- });
- });
- describe('multi variant product edit to delete all images and add new ones', function () {
- var title = commonHelper.uniqueProductName('editm22') + 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 redirect on add product page', function () {
- browser.get(productData.addLink);
- addProductPage.waitForPublishButton();
- });
- it('should select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- });
- it('should fill variant prices', function () {
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should open edit page for added product', function () {
- commonHelper.switchToPreviousTab();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should delete old images', function () {
- addProductPage.deleteImage(1);
- addProductPage.deleteImage(1);
- });
- it('should add new images', function () {
- addProductPage.uploadImage(1, thirdImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, thirdImage);
- });
- 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);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(3);
- });
- });
- describe('multi variant product edit - delete variant that changes product look', function () {
- var title = commonHelper.uniqueProductName('editm23') + unique_value;
- var secondPrice = '$40.00';
- var secondComparePrice = '$50.00';
- 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 select multi variant option', function () {
- addProductPage.clickMulti();
- });
- it('should fill new product form', function () {
- addProductPage.selectType(type);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(title);
- });
- it('should add first option', function () {
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.clickProductLookCheckbox(0);
- });
- it('should add second option', function () {
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.clickProductLookCheckbox(1);
- });
- it('should add third option', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(2, 'Style');
- addProductPage.fillOptionValue(2, firstStyle);
- addProductPage.fillOptionValue(2, secondStyle);
- });
- it('should fill first variant', function () {
- var firstVariant = firstColor + ' / ' + firstSize + ' / ' + firstStyle;
- addProductPage.fillVariantPrice(firstVariant, price);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(2, thirdImage);
- addProductPage.uploadImage(2, firstImage);
- addProductPage.uploadImage(3, firstImage);
- addProductPage.uploadImage(3, thirdImage);
- });
- it('should publish product', function () {
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(title);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show add to cart button', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should open edit page for added product', function () {
- commonHelper.switchToPreviousTab();
- productListPage.editProduct(title);
- addProductPage.waitForSaveButton();
- });
- it('should delete variant that changes product', function () {
- addProductPage.clickDeleteOption(1);
- });
- it('should fill first variant', function () {
- var firstVariant = firstColor + ' / ' + firstStyle;
- addProductPage.fillVariantPrice(firstVariant, secondPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, secondComparePrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, firstImage);
- });
- 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);
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- });
- it('should show correct product price', function () {
- expect(productPage.productPrice()).toEqual(secondPrice.replace('$', ''));
- });
- it('should show correct product compare price', function () {
- expect(productPage.productComparePrice()).toEqual(secondComparePrice.replace('$', ''));
- });
- it('should show correct number of thumbs', function () {
- commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- browser.sleep(1000);
- expect(productPage.allThumbs.count()).toEqual(2);
- });
- it('should not see size', function () {
- expect(productPage.selField('Size').isPresent()).toBeFalsy();
- });
- });
- // describe('checking for delete purchased variant from product and then checking effect on cart and checkout on fes', function () {
- //
- // var productTitle = commonHelper.uniqueProductName('editm24') + 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 shipping page', function () {
- // dashboardPage.openShippingPage();
- // });
- //
- // it('should delete all zones', function check(done) {
- // commonHelper.waitUntilElementInvisible(shippingPage.imgLoader);
- // shippingPage.allShippings.count().then(function(result) {
- // if(result == 0) {
- // done();
- // } else {
- // shippingPage.allShippings.get(0).getText().then(function (value) {
- // shippingPage.openForEdit(value);
- // addShippingZonePage.clickDeleteZone();
- // });
- // check(done);
- // }
- // })
- // }, 30000);
- //
- // it('should open new zone page', function () {
- // shippingPage.clickAddZone();
- // addShippingZonePage.waitForSaveButton();
- // });
- //
- // it('should add new zone', function () {
- // addShippingZonePage.setZoneName(name);
- // addShippingZonePage.setShippingRate(rate.replace('$', ''));
- // addShippingZonePage.setServiceDescription(description);
- // addShippingZonePage.setCountry(country);
- // addShippingZonePage.clickSave();
- // });
- //
- // it('should contain new shipping zone', function() {
- // commonHelper.waitUntilElementVisible(shippingPage.shippingZoneEntry(name));
- // });
- //
- // it('should open products list page', function () {
- // dashboardPage.openProductListPage();
- // });
- //
- // it('should open new product page', function () {
- // productListPage.clickAddProduct();
- // addProductPage.waitForPublishButton();
- // });
- //
- // it('should select multi variant', function () {
- // addProductPage.clickMulti();
- // });
- //
- // it('should fill new product form', function () {
- // addProductPage.selectType(type);
- // addProductPage.selectFirstCollection();
- // addProductPage.fillTitle(productTitle);
- // addProductPage.fillShippingWeight(weight);
- // addProductPage.addTag(tag);
- // });
- //
- // it('should add first option', function () {
- // addProductPage.fillOptionTitle(0, 'Color');
- // addProductPage.fillOptionValue(0, firstColor);
- // addProductPage.fillOptionValue(0, secondColor);
- // addProductPage.clickProductLookCheckbox(0);
- // });
- //
- // it('should add second option', function () {
- // addProductPage.fillOptionTitle(1, 'Size');
- // addProductPage.fillOptionValue(1, firstSize);
- // addProductPage.fillOptionValue(1, secondSize);
- // });
- //
- // it('should fill variant prices', function () {
- // addProductPage.fillVariantPrice(firstVariant, price);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // addProductPage.fillVariantComparePrice(firstVariant, comparePrice);
- // addProductPage.clickVariantComparePriceAutofill(firstVariant);
- // });
- //
- // it('should add images', function () {
- // addProductPage.uploadImage(0, firstImage);
- // addProductPage.uploadImage(0, secondImage);
- // addProductPage.uploadImage(1, firstImage);
- // addProductPage.uploadImage(1, secondImage);
- // });
- //
- // it('should publish product', function () {
- // addProductPage.clickPublish();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- // });
- //
- // it('should show product image', function () {
- // commonHelper.waitUntilElementVisible(productListPage.productImage(productTitle));
- // });
- //
- // it('should show product page after click on product link', function () {
- // productListPage.clickProduct(productTitle);
- // });
- //
- // it('should show main product image', function () {
- // commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- // commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- // });
- //
- // it('should show correct product price', function () {
- // expect(productPage.productPrice()).toEqual(price.replace('$', ''));
- // });
- //
- // it('should show correct product compare price', function () {
- // expect(productPage.productComparePrice()).toEqual(comparePrice.replace('$', ''));
- // });
- //
- // it('should show correct product name', function () {
- // expect(productPage.productTitle()).toEqual(productTitle);
- // });
- //
- // it('should show correct number of thumbs', function () {
- // commonHelper.waitUntilElementVisible(productPage.eleThumbsContainer);
- // commonHelper.waitUntilElementVisible(productPage.eleImageBorder);
- // browser.sleep(1000);
- // expect(productPage.allThumbs.count()).toEqual(2);
- // });
- //
- // it('should select 1 product', function () {
- // productPage.clickUp(1);
- // });
- //
- // it('should click add to cart button', function () {
- // productPage.clickAddToCart();
- // commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- // });
- //
- // it('should show correct total price in cart', function () {
- // expect(cartPage.totalPrice()).toEqual('25.00');
- // });
- //
- // it('should click checkout button', function () {
- // cartPage.clickCheckout();
- // commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- // });
- //
- // it('should switch to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should edit product', function () {
- // productListPage.editProduct(productTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should delete old options', function () {
- // addProductPage.clickDeleteOption(1);
- // addProductPage.clickDeleteOption(0);
- // });
- //
- // it('should add second option', function () {
- // addProductPage.clickAddOption();
- // addProductPage.fillOptionTitle(0, 'Style');
- // addProductPage.fillOptionValue(0, firstStyle);
- // addProductPage.fillOptionValue(0, secondStyle);
- // addProductPage.clickProductLookCheckbox(0);
- // });
- //
- // it('should add third option', function () {
- // addProductPage.clickAddOption();
- // addProductPage.fillOptionTitle(1, 'Material');
- // addProductPage.fillOptionValue(1, firstMaterial);
- // addProductPage.fillOptionValue(1, secondMaterial);
- // });
- //
- // it('should add pictures for t-shirt', function () {
- // addProductPage.uploadImage(0, firstImage);
- // addProductPage.uploadImage(0, secondImage);
- // addProductPage.uploadImage(1, thirdImage);
- // addProductPage.uploadImage(1, firstImage);
- // });
- //
- // it('should fill sixth variant', function () {
- // var firstVariant = firstStyle + ' / ' + firstMaterial;
- // addProductPage.fillVariantPrice(firstVariant, thirdPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // addProductPage.fillVariantComparePrice(firstVariant, thirdComparePrice);
- // addProductPage.clickVariantComparePriceAutofill(firstVariant);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
- // });
- //
- // it('should switch to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- //
- // it('should fill contact information form', function () {
- // checkoutPage.selectCountry(country);
- // checkoutPage.selectState(city);
- // checkoutPage.fillCity(city);
- // checkoutPage.fillZip(zip);
- // commonHelper.waitUntilElementPresent(checkoutPage.selectedShipping(description));
- // checkoutPage.fillFirstName(firstName);
- // checkoutPage.fillLastName(lastName);
- // checkoutPage.fillStreetAddress(streetAddress);
- // checkoutPage.fillSuite(suite);
- // checkoutPage.fillPhone(phone);
- // });
- //
- // it('should fill payment form', function () {
- // checkoutPage.fillCardNumberField(cardNumber);
- // checkoutPage.fillCardNameField(cardName);
- // checkoutPage.fillCardDateField(cardDate);
- // checkoutPage.fillCVVField(cardCVV);
- // });
- //
- // it('should show correct prices', function () {
- // commonHelper.waitUntilElementVisible(checkoutPage.txtShippingPrice);
- // expect(checkoutPage.shippingPrice()).toEqual('$10.00');
- // expect(checkoutPage.subtotalPrice()).toEqual('$35.00');
- // expect(checkoutPage.taxes()).toEqual('$0.00');
- // expect(checkoutPage.totalPrice()).toEqual('$35.00');
- // });
- //
- // it('should click complete order', function () {
- // checkoutPage.clickCompleteOrder();
- // commonHelper.waitUntilElementVisible(checkoutPage.txtOrder);
- // });
- //
- // it('should show error message', function () {
- // browser.sleep(1000);
- // expect(checkoutPage.chkErrorMessage()).toEqual('The product you were trying to buy has been changed. Please re-add it to cart and submit the order again');
- // });
- // });
- });
Add Comment
Please, Sign In to add comment