Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- core_edit2_spec.js(то что закомментированно - не работает из-за бага изменения на разных вкладках; последнее не успел доделать, сделаю в пн)
- 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 cartPage = pageObject.getCartPage();
- var addCollectionPage = pageObject.getAddCollectionPage();
- var collectionListPage = pageObject.getCollectionListPage();
- var paymentProcessingPage = pageObject.getPaymentProcessingPage();
- var shippingPage = pageObject.getShippingPage();
- var addShippingZonePage = pageObject.getAddShippingZonePage();
- var checkoutPage = pageObject.getCheckoutPage();
- var ordersPage = pageObject.getOrdersPage();
- var carriersPage = pageObject.getShippingCarriersPage();
- var addCarrierPage = pageObject.getAddShippingCarrierPage();
- var signUpPage = pageObject.getSignUpPage();
- var couponCodesPage = pageObject.getCouponCodesPage();
- var addCouponPage = pageObject.getAddCouponPage();
- var addCampaignPage = pageObject.getAddCampaignPage();
- var upsellCampaignsPage = pageObject.getUpsellCampaignsPage();
- var generalSettingsPage = pageObject.getGeneralSettingsPage();
- var signInData = require('./../../../data/admin/sign_in/index');
- var collectionData = require('./../../../data/admin/collection/index');
- var productData = require('./../../../data/admin/product/index');
- var coreData = require('./../../../data/admin/core/index');
- var shippingData = require('./../../../data/admin/settings/shipping');
- var carriersData = require('./../../../data/admin/settings/shipping_carrier/index');
- var commonHelper = require('./../../../services/helpers/common.helper.js');
- describe('Edit Actions', function () {
- var unique_value = commonHelper.uniqueValue();
- var cardNumber = coreData.cardNumber;
- var cardName = coreData.cardName;
- var cardDate = coreData.cardDate;
- var cardCVV = coreData.cardCVV;
- 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 fourthColor = 'Green';
- var fifthColor = 'Black';
- var sixthColor = 'Blue';
- var seventhColor = 'Pink';
- var eightColor = 'Purple';
- var firstSize = productData.product.size.first;
- var secondSize = productData.product.size.second;
- var thirdSize = productData.product.size.third;
- var fourthSize = 'Large';
- var fifthSize = 'XL';
- var sixthSize = '2XL';
- var seventhSize = '3XL';
- var firstMaterial = 'Catton';
- var secondMaterial = 'Wool';
- var firstStyle = productData.product.style.first;
- var secondStyle = productData.product.style.second;
- var firstVariant = firstColor + ' / ' + firstSize;
- var secondVariant = firstColor + ' / ' + fourthSize;
- var thirdVariant = firstColor + ' / ' + thirdSize;
- var fourthVariant = secondColor + ' / ' + firstSize;
- var adminUsername = browser.params.adminPanel.username;
- var adminPassword = browser.params.adminPanel.password;
- var collectionTitle = commonHelper.uniqueProductName('collection') + unique_value;
- var collectionDescription = collectionData.collection.description.first;
- var firstProductTitle = commonHelper.uniqueProductName('core1') + unique_value;
- var secondProductTitle = commonHelper.uniqueProductName('core2') + unique_value;
- var thirdProductTitle = commonHelper.uniqueProductName('core3') + unique_value;
- var fourthProductTitle = commonHelper.uniqueProductName('core4') + unique_value;
- var fifthProductTitle = commonHelper.uniqueProductName('core5') + unique_value;
- var sixthProductTitle = commonHelper.uniqueProductName('core6') + unique_value;
- var seventhProductTitle = commonHelper.uniqueProductName('core7') + unique_value;
- var eighthProductTitle = commonHelper.uniqueProductName('core8') + unique_value;
- var ninthProductTitle = commonHelper.uniqueProductName('core9') + unique_value;
- var tenthProductTitle = commonHelper.uniqueProductName('core10') + unique_value;
- var weight = productData.product.weight;
- var tag = productData.product.tag;
- var productType = productData.product.type;
- var firstProductPrice = '$25.00';
- var secondProductPrice = '$30.00';
- var thirdProductPrice = '$40.00';
- var fourthProductPrice = '$10.00';
- var firstCompareProductPrice = '$30.00';
- var secondCompareProductPrice = '$35.00';
- var thirdCompareProductPrice = '$40.00';
- var name = shippingData.zone.name.first + unique_value;
- var description = shippingData.zone.description.first;
- var rate = '$10.00';
- var storeName = coreData.storeName + '2' + unique_value;
- var storeLink = 'https://' + storeName + '.' + browser.params.adminPanel.domain;
- var emailAddress = storeName + '@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 carrierTitle = carriersData.title + unique_value;
- var trackUrl = carriersData.trackUrl;
- var firstCampaignName = commonHelper.uniqueProductName('upsell') + commonHelper.randomAlphaNumeric();
- var secondCampaignName = commonHelper.uniqueProductName('upsell') + commonHelper.randomAlphaNumeric();
- var couponName = 'Big Test';
- var validFrom = '11/28/2016';
- var couponType = '% off from order total';
- var couponDiscount = '10';
- var couponCode = 'BIGTEST';
- var orderNumber;
- var signUpLink;
- var firstOrderNumber, secondOrderNumber, thirdOrderNumber, fourthOrderNumber, fifthOrderNumber, sixthOrderNumber;
- describe('create new store and add products', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(browser.params.adminPanel.url);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on admin dashboard page after login', function () {
- signInPage.login(adminUsername, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSuperAdminSearch);
- });
- it('should open first plan details', function () {
- dashboardPage.openPlansPage();
- dashboardPage.openFirstPlanDetails();
- });
- it('should save sign up link', function () {
- dashboardPage.txtSignUpLink.getAttribute('value').then(function (value) {
- signUpLink = value;
- });
- });
- it('should logout as admin', function () {
- dashboardPage.logoutAdmin();
- commonHelper.waitUntilElementVisible(signInPage.btnLogin);
- });
- it('should redirect on sign up page', function () {
- browser.get(signUpLink);
- commonHelper.waitUntilElementVisible(signUpPage.btnSignUp);
- });
- it('should submit sign up form', function () {
- signUpPage.fillFullNameField(storeName);
- signUpPage.fillEmailField(emailAddress);
- signUpPage.fillRetypeEmailField(emailAddress);
- signUpPage.fillPasswordField(adminPassword);
- signUpPage.clickSignUp();
- commonHelper.waitUntilElementVisible(signUpPage.btnCompleteSignUp);
- });
- it('should submit payment details', function () {
- signUpPage.fillCardNumberField(cardNumber);
- signUpPage.fillCardNameField(cardName);
- signUpPage.fillCardDateField(cardDate);
- signUpPage.fillCVVField(cardCVV);
- signUpPage.clickCompleteSignUp();
- commonHelper.waitUntilElementVisible(signUpPage.btnStartBuildingStore);
- });
- it('should submit account information form', function () {
- signUpPage.fillAddress(streetAddress);
- signUpPage.fillCity(city);
- signUpPage.fillSuite(suite);
- signUpPage.fillZip(zip);
- signUpPage.fillStoreName(storeName);
- signUpPage.fillStoreSubdomain(storeName);
- signUpPage.fillPhone(phone);
- signUpPage.clickStartBuildingStore();
- commonHelper.waitUntilElementVisible(signUpPage.btnSignIn);
- });
- it('should click sign-in button', function () {
- signUpPage.clickSignIn();
- commonHelper.waitUntilElementVisible(signInPage.btnLogin);
- });
- it('should redirect on dashboard page after login', function () {
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open new collection page', function () {
- dashboardPage.openAddCollectionPage();
- });
- it('should add new collection', function () {
- addCollectionPage.fillTitle(collectionTitle);
- addCollectionPage.fillDescription(collectionDescription);
- addCollectionPage.clickPublish();
- commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
- });
- it('should open payment processing page', function () {
- dashboardPage.openPaymentProcessingPage();
- });
- it('should activate stripe if not activated', function check(done) {
- paymentProcessingPage.btnSelectCurrency.isPresent().then(function(result) {
- if(result) {
- paymentProcessingPage.clickCurrency('USD');
- paymentProcessingPage.clickSelectCurrency();
- paymentProcessingPage.clickStripeSetup();
- paymentProcessingPage.clickConnectWithStripe();
- paymentProcessingPage.clickSkipAccountForm();
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- check(done);
- } else {
- done();
- }
- })
- }, 50000);
- 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 shipping carriers page', function () {
- dashboardPage.openShippingCarriersPage();
- commonHelper.waitUntilElementClickable(carriersPage.btnAddCarrier);
- });
- it('should open new carrier modal', function () {
- carriersPage.clickAddCarrier();
- commonHelper.waitUntilElementVisible(addCarrierPage.btnAdd);
- });
- it('should add new carrier', function () {
- addCarrierPage.fillName(carrierTitle);
- addCarrierPage.fillUrl(trackUrl);
- addCarrierPage.clickAdd();
- commonHelper.waitUntilElementVisible(carriersPage.shippingEntry(carrierTitle));
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add first product', function () {
- addProductPage.fillType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(firstProductTitle);
- addProductPage.fillPrice(firstProductPrice.replace('$', ''));
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(firstProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add second product', function () {
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection(collectionTitle);
- addProductPage.fillTitle(secondProductTitle);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.fillPrice(secondProductPrice.replace('$', ''));
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(secondProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add third product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(thirdProductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, sixthColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillVariantPrice(firstVariant, firstProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(thirdProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add fourth product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(fourthProductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, secondColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, fourthSize);
- addProductPage.fillOptionValue(1, fifthSize);
- addProductPage.fillVariantPrice(secondVariant, firstProductPrice);
- addProductPage.clickVariantPriceAutofill(secondVariant);
- addProductPage.fillVariantComparePrice(secondVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(secondVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(fourthProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add fifth product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(fifthProductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, sixthColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillVariantPrice(firstVariant, fourthProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(fifthProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add sixth product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(sixthProductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, sixthColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillVariantPrice(firstVariant, firstProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(sixthProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add seventh product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(seventhProductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, sixthColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillVariantPrice(firstVariant, firstProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(sixthProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open add product page', function () {
- dashboardPage.openAddProductPage();
- addProductPage.waitForPublishButton();
- });
- it('should add seventh product', function () {
- addProductPage.clickMulti();
- addProductPage.selectType(productType);
- addProductPage.selectFirstCollection();
- addProductPage.fillTitle(eighthroductTitle);
- addProductPage.fillShippingWeight(weight);
- addProductPage.addTag(tag);
- addProductPage.fillOptionTitle(0, 'Color');
- addProductPage.fillOptionValue(0, firstColor);
- addProductPage.fillOptionValue(0, sixthColor);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.fillOptionTitle(1, 'Size');
- addProductPage.fillOptionValue(1, firstSize);
- addProductPage.fillOptionValue(1, secondSize);
- addProductPage.fillVariantPrice(firstVariant, firstProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- addProductPage.fillVariantComparePrice(firstVariant, firstCompareProductPrice);
- addProductPage.clickVariantComparePriceAutofill(firstVariant);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(0, firstImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.uploadImage(1, secondImage);
- addProductPage.clickPublish();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(sixthProductTitle));
- dashboardPage.clickCloseAlert();
- });
- it('should open codes page', function () {
- dashboardPage.openCouponCodesPage();
- commonHelper.waitUntilElementPresent(couponCodesPage.btnAdd);
- });
- it('should open new coupon code page', function () {
- couponCodesPage.clickAddCouponCode();
- commonHelper.waitUntilElementVisible(addCouponPage.txtName);
- });
- it('should add new coupon code', function () {
- addCouponPage.fillName(couponName);
- addCouponPage.fillValidFrom(validFrom);
- addCouponPage.selectDiscountType(couponType);
- addCouponPage.fillDiscount(couponDiscount);
- addCouponPage.fillCode(couponCode);
- addCouponPage.clickSave();
- commonHelper.waitUntilElementInvisible(addCouponPage.imgLoader);
- commonHelper.waitUntilElementVisible(couponCodesPage.couponCodeEntry(couponName));
- });
- it('should close add coupon code page', function () {
- addCouponPage.clickClose();
- commonHelper.waitUntilElementVisible(couponCodesPage.eleDiscountCode);
- });
- it('should open up-sell campaigns page', function () {
- dashboardPage.openUpsellCampaignsPage();
- commonHelper.waitUntilElementPresent(upsellCampaignsPage.btnAdd);
- });
- it('should open new campaign page', function () {
- upsellCampaignsPage.clickAddCampaign();
- upsellCampaignsPage.selectBuyType();
- });
- it('should fill campaign name', function () {
- commonHelper.waitUntilElementPresent(addCampaignPage.btnSubmit);
- addCampaignPage.fillName(firstCampaignName);
- });
- it('should add product to campaign', function () {
- addCampaignPage.selectManual();
- addCampaignPage.clickAddItems();
- addCampaignPage.fillSearch(seventhProductTitle);
- commonHelper.waitUntilElementVisible(addCampaignPage.searchedProductEntry(seventhProductTitle));
- addCampaignPage.clickProduct(ninethProductTitle);
- addCampaignPage.clickCloseAddItems();
- });
- it('should add new campaign', function () {
- addCampaignPage.fillBuyItems('10');
- addCampaignPage.fillItemsFree('1');
- addCampaignPage.clickSubmit();
- commonHelper.waitUntilElementVisible(upsellCampaignsPage.campaignEntry(firstCampaignName));
- });
- it('should open up-sell campaigns page', function () {
- dashboardPage.openUpsellCampaignsPage();
- commonHelper.waitUntilElementPresent(upsellCampaignsPage.btnAdd);
- });
- it('should open new campaign page', function () {
- upsellCampaignsPage.clickAddCampaign();
- upsellCampaignsPage.selectBuyTypeStorewide();
- });
- it('should add product to compaign', function () {
- addCampaignPage.selectManual();
- addCampaignPage.clickAddItems();
- addCampaignPage.fillSearch(eighthProductTitle);
- commonHelper.waitUntilElementVisible(addCampaignPage.searchedProductEntry(eighthProductTitle));
- addCampaignPage.clickProduct(eighthProductTitle);
- addCampaignPage.clickCloseAddItems();
- });
- it('should add new campaign', function () {
- addCampaignPage.fillDiscount('1');
- addCampaignPage.fillDiscountExpiration('10');
- addCampaignPage.fillButtonText('Button text');
- addCampaignPage.clickSubmit();
- commonHelper.waitUntilElementVisible(upsellCampaignsPage.campaignEntry(secondCampaignName));
- });
- });
- describe('checking for edit single variant product and checking effect on existing orders with it', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(firstProductTitle);
- });
- it('should show main product image', function () {
- commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
- commonHelper.waitUntilElementVisible(productPage.eleProductImage);
- });
- 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 open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(firstProductTitle).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(firstProductTitle));
- });
- it('should open edit product', function () {
- productListPage.editProduct(firstProductTitle);
- addProductPage.waitForSaveButton();
- });
- it('should edit product prices and title', function () {
- addProductPage.fillTitle(ninethProductTitle);
- addProductPage.fillPrice(secondProductPrice);
- });
- 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(ninethProductTitle));
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- 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(firstProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show new product image', function () {
- expect(ordersPage.productImage(firstProductTitle).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(ninthProductTitle);
- });
- 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(secondProductPrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(ninthProductTitle);
- });
- 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(ninthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(ninthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(ninthProductTitle)).toEqual('$30.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(ninthProductTitle)).toEqual('$30.00');
- });
- });
- //
- // describe('checking for edit single variant product and checking effect on cart and checkout on fes', function () {
- //
- // beforeAll(function () {
- // commonHelper.acceptAlert();
- // browser.get(signInData.link);
- // });
- //
- // afterAll(function () {
- // commonHelper.clearAllData();
- // });
- //
- // it('should redirect on dashboard page after login', function () {
- // browser.get(storeLink + '/admin');
- // signInPage.login(emailAddress, adminPassword);
- // commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- // });
- //
- // it('should open products list page', function () {
- // dashboardPage.openProductListPage();
- // });
- //
- // it('should show product page after click on product link', function () {
- // productListPage.clickProduct(secondProductTitle);
- // });
- //
- // it('should click add to cart button', function () {
- // productPage.clickAddToCart();
- // commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- // });
- //
- // it('should switch to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // t('should open edit product', function () {
- // productListPage.editProduct(secondProductTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should fill first and second variant prices', function () {
- // addProductPage.fillPrice(secondProductPrice);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(secondProductTitle));
- // });
- //
- // 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(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');
- // });
- //
- // it('should go to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open edit product', function () {
- // productListPage.editProduct(secondProductTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should fill first and second variant prices', function () {
- // addProductPage.fillPrice(thirdProductPrice);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(secondProductTitle));
- // });
- //
- // it('should go to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- //
- //
- // 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 again', function () {
- // checkoutPage.clickCompleteOrder();
- // });
- // });
- describe('checking for Edit multi variant product prices, images and names and then checking effect on existing orders with it', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(thirdProductTitle);
- });
- it('should click add to cart button', function () {
- browser.sleep(2000);
- 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 open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(thirdProductTitle).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(thirdProductTitle));
- });
- it('should open edit product', function () {
- productListPage.editProduct(thirdProductTitle);
- addProductPage.waitForSaveButton();
- });
- it('should edit product prices and title', function () {
- addProductPage.fillTitle(tenthProductTitle);
- addProductPage.fillVariantPrice(firstVariant, secondProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- });
- it('should delete old pictures', function () {
- browser.sleep(2000);
- addProductPage.deleteImage(0);
- addProductPage.deleteImage(0);
- addProductPage.deleteImage(1);
- addProductPage.deleteImage(1);
- });
- it('should add another pictures', function () {
- addProductPage.uploadImage(0, thirdImage);
- addProductPage.uploadImage(0, secondImage);
- addProductPage.uploadImage(1, thirdImage);
- addProductPage.uploadImage(1, secondImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(tenthProductTitle));
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- 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(thirdProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show new product image', function () {
- expect(ordersPage.productImage(thirdProductTitle).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(tenthProductTitle);
- });
- 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(secondProductPrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(tenthProductTitle);
- });
- 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(tenthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(tenthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(tenthProductTitle)).toEqual('$30.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(tenthProductTitle)).toEqual('$30.00');
- });
- });
- describe('checking for delete purchased variant from product and then checking effect on existing orders with it', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(fourthProductTitle);
- });
- it('should click add to cart button', function () {
- browser.sleep(2000);
- 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 open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(fourthProductTitle).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(fourthProductTitle));
- });
- it('should open edit product', function () {
- browser.sleep(5000);
- productListPage.editProduct(fourthProductTitle);
- addProductPage.waitForSaveButton();
- });
- it('should delete old variants', function () {
- addProductPage.clickDeleteCollection(firstColor);
- addProductPage.clickDeleteCollection(secondColor);
- addProductPage.clickDeleteCollection(fourthSize);
- addProductPage.clickDeleteCollection(fifthSize);
- });
- it('should add new variants', function () {
- addProductPage.fillOptionValue(0, seventhColor);
- addProductPage.fillOptionValue(0, eightColor);
- addProductPage.fillOptionValue(1, sixthSize);
- addProductPage.fillOptionValue(1, secondSize);
- });
- it('should edit product prices and title', function () {
- var firstVariant = seventhColor + ' / ' + sixthSize;
- addProductPage.fillVariantPrice(firstVariant, secondProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, thirdImage);
- addProductPage.uploadImage(0, thirdImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, firstImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(fourthProductTitle));
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- 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(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show new product image', function () {
- expect(ordersPage.productImage(fourthProductTitle).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(fourthProductTitle);
- });
- 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(secondProductPrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(fourthProductTitle);
- });
- 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(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(fourthProductTitle)).toEqual('$30.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(fourthProductTitle)).toEqual('$30.00');
- });
- it('should open products list page', function () {
- commonHelper.switchToPreviousTab();
- dashboardPage.openProductListPage();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(thirdProductTitle));
- });
- it('should open edit product', function () {
- productListPage.editProduct(fourthProductTitle);
- addProductPage.waitForSaveButton();
- });
- it('should delete old options', function () {
- addProductPage.clickDeleteOption(1);
- addProductPage.clickDeleteOption(0);
- });
- it('should add option variants', function () {
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(0, 'Style');
- addProductPage.fillOptionValue(0, firstStyle);
- addProductPage.fillOptionValue(0, secondStyle);
- addProductPage.clickProductLookCheckbox(0);
- addProductPage.clickAddOption();
- addProductPage.fillOptionTitle(1, 'Material');
- addProductPage.fillOptionValue(1, firstMaterial);
- addProductPage.fillOptionValue(1, secondMaterial);
- });
- it('should edit product prices and title', function () {
- var firstVariant = firstStyle + ' / ' + firstMaterial;
- addProductPage.fillVariantPrice(firstVariant, thirdProductPrice);
- addProductPage.clickVariantPriceAutofill(firstVariant);
- });
- it('should add images', function () {
- addProductPage.uploadImage(0, thirdImage);
- addProductPage.uploadImage(0, thirdImage);
- addProductPage.uploadImage(1, firstImage);
- addProductPage.uploadImage(1, firstImage);
- });
- it('should save product', function () {
- addProductPage.clickSave();
- commonHelper.waitUntilElementVisible(productListPage.productEntry(fourthProductTitle));
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- 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(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show new product image', function () {
- expect(ordersPage.productImage(fourthProductTitle).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(fourthProductTitle);
- });
- 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(thirdProductPrice.replace('$', ''));
- });
- it('should show correct product name', function () {
- expect(productPage.productTitle()).toEqual(fourthProductTitle);
- });
- 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('40.00');
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- it('should show correct product', function () {
- expect(checkoutPage.productName(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show product images', function () {
- expect(checkoutPage.productImage(fourthProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct prices for products', function () {
- expect(checkoutPage.productPrice(fourthProductTitle)).toEqual('$40.00 x 1');
- });
- it('should show correct subtotals for products', function () {
- expect(checkoutPage.productSubtotal(fourthProductTitle)).toEqual('$40.00');
- });
- });
- // describe('checking for edit multi variant product price and checking effect on Cart and checkout on fes', function () {
- //
- // var secondProductPrice = '$20.00';
- // var thirdProductPrice = '$30.00';
- //
- // beforeAll(function () {
- // commonHelper.acceptAlert();
- // browser.get(signInData.link);
- // });
- //
- // afterAll(function () {
- // commonHelper.clearAllData();
- // });
- //
- // it('should redirect on dashboard page after login', function () {
- // browser.get(storeLink + '/admin');
- // signInPage.login(emailAddress, adminPassword);
- // commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- // });
- //
- // it('should open products list page', function () {
- // browser.sleep(1000);
- // dashboardPage.openProductListPage();
- // });
- //
- // it('should show product page after click on product link', function () {
- // productListPage.clickProduct(fifthProductTitle);
- // });
- //
- // it('should click add to cart button', function () {
- // browser.sleep(2000);
- // productPage.clickAddToCart();
- // commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- // });
- //
- // it('should switch to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open edit product', function () {
- // productListPage.editProduct(fifthProductTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should edit prices', function () {
- // addProductPage.fillVariantPrice(firstVariant, secondProductPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(fifthProductTitle));
- // });
- //
- // it('should switch on the 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(fifthProductTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show product images', function () {
- // expect(checkoutPage.productImage(fifthProductTitle).isDisplayed()).toBeTruthy();
- // });
- //
- // it('should show correct prices for products', function () {
- // expect(checkoutPage.productPrice(fifthProductTitle)).toEqual('$20.00 x 1');
- // });
- //
- // it('should show correct subtotals for products', function () {
- // expect(checkoutPage.productSubtotal(fifthProductTitle)).toEqual('$20.00');
- // });
- //
- // it('should go to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open edit product', function () {
- // productListPage.editProduct(fifthProductTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should change variant prices', function () {
- // addProductPage.fillVariantPrice(firstVariant, thirdProductPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // });
- //
- // it('should save product', function () {
- // addProductPage.clickSave();
- // commonHelper.waitUntilElementVisible(productListPage.productEntry(fifthProductTitle));
- // });
- //
- // it('should go to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- //
- // 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('$40.00');
- // expect(checkoutPage.taxes()).toEqual('$0.00');
- // expect(checkoutPage.totalPrice()).toEqual('$40.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 again', function () {
- // checkoutPage.clickCompleteOrder();
- // });
- //});
- //
- // describe('checking for delete purchased variant from product and then checking effect on cart and checkout on fes', function () {
- //
- // beforeAll(function () {
- // commonHelper.acceptAlert();
- // browser.get(signInData.link);
- // });
- //
- // afterAll(function () {
- // commonHelper.clearAllData();
- // });
- //
- // it('should redirect on dashboard page after login', function () {
- // browser.get(storeLink + '/admin');
- // signInPage.login(emailAddress, adminPassword);
- // commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- // });
- //
- // it('should open products list page', function () {
- // dashboardPage.openProductListPage();
- // });
- //
- // it('should show product page after click on product link', function () {
- // productListPage.clickProduct(sixthProductTitle);
- // });
- //
- // it('should click add to cart button', function () {
- // browser.sleep(2000);
- // productPage.clickAddToCart();
- // commonHelper.waitUntilElementVisible(cartPage.btnCheckout);
- // });
- //
- // it('should click checkout button', function () {
- // cartPage.clickCheckout();
- // commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- // });
- //
- // it('should switch to previous tab', function () {
- // commonHelper.switchToPreviousWithoutClose();
- // });
- //
- // it('should open edit product', function () {
- // productListPage.editProduct(sixthProductTitle);
- // addProductPage.waitForSaveButton();
- // });
- //
- // it('should delete old options', function () {
- // addProductPage.clickDeleteOption(1);
- // addProductPage.clickDeleteOption(0);
- // });
- //
- // it('should add option variants', function () {
- // addProductPage.clickAddOption();
- // addProductPage.fillOptionTitle(0, 'Style');
- // addProductPage.fillOptionValue(0, firstStyle);
- // addProductPage.fillOptionValue(0, secondStyle);
- // addProductPage.clickProductLookCheckbox(0);
- // addProductPage.clickAddOption();
- // addProductPage.fillOptionTitle(1, 'Material');
- // addProductPage.fillOptionValue(1, firstMaterial);
- // addProductPage.fillOptionValue(1, secondMaterial);
- // });
- //
- // it('should edit product prices and title', function () {
- // var firstVariant = firstStyle + ' / ' + firstMaterial;
- // addProductPage.fillVariantPrice(firstVariant, thirdProductPrice);
- // addProductPage.clickVariantPriceAutofill(firstVariant);
- // });
- //
- // it('should add images', function () {
- // addProductPage.uploadImage(0, thirdImage);
- // addProductPage.uploadImage(0, thirdImage);
- // addProductPage.uploadImage(1, firstImage);
- // addProductPage.uploadImage(1, firstImage);
- // });
- //
- // it('should switch to next tab', function () {
- // commonHelper.switchToNextTab();
- // });
- // });
- describe('checking for delete purchased variant from product and then checking effect on cart and checkout on fes', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(seventhProductTitle);
- });
- it('should select 11 product', function () {
- productPage.clickUp(11);
- });
- 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('250.00');
- });
- 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('$260.00');
- expect(checkoutPage.taxes()).toEqual('$0.00');
- expect(checkoutPage.totalPrice()).toEqual('$260.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 open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(seventhProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$275.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$260.00');
- });
- it('should open up-sell campaigns page', function () {
- dashboardPage.openUpsellCampaignsPage();
- commonHelper.waitUntilElementPresent(upsellCampaignsPage.btnAdd);
- });
- it('should select compaign', function () {
- upsellCampaignsPage.selectCampaign(firstCampaignName);
- });
- it('should delete compaign', function () {
- upsellCampaignsPage.clickDeleteCompaign();
- upsellCampaignsPage.clickConfirm();
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(seventhProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$275.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$260.00');
- });
- });
- describe('checking for delete purchased variant from product and then checking effect on cart and checkout on fes', function () {
- beforeAll(function () {
- commonHelper.acceptAlert();
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', function () {
- browser.get(storeLink + '/admin');
- signInPage.login(emailAddress, adminPassword);
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open products list page', function () {
- dashboardPage.openProductListPage();
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(eighthProductTitle);
- });
- 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('$25.00');
- expect(checkoutPage.taxes()).toEqual('$0.00');
- expect(checkoutPage.totalPrice()).toEqual('$25.00');
- });
- it('should click complete order', function () {
- checkoutPage.clickCompleteOrder();
- commonHelper.waitUntilElementVisible(checkoutPage.txtOrder);
- });
- it('should show thank you discount', function () {
- expect(checkoutPage.txtThankYouDiscount().isPresent()).toBeTruthy();
- });
- it('should redirect on dashboard page', function () {
- browser.get(storeLink + '/admin');
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should show product page after click on product link', function () {
- productListPage.clickProduct(eighthProductTitle);
- });
- it('should click checkout button', function () {
- cartPage.clickCheckout();
- commonHelper.waitUntilElementVisible(checkoutPage.btnCompleteOrder);
- });
- 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 dashboard page', function () {
- browser.get(storeLink + '/admin');
- commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
- });
- it('should open orders page', function () {
- commonHelper.switchToPreviousTab();
- 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 product image', function () {
- expect(ordersPage.productImage(seventhProductTitle).isDisplayed()).toBeTruthy();
- });
- it('should show correct order price', function () {
- commonHelper.moveMouseOver(ordersPage.txtTotalPrice);
- expect(ordersPage.subtotalPrice()).toEqual('$34.00');
- expect(ordersPage.shippingPrice()).toEqual('$10.00');
- expect(ordersPage.taxes()).toEqual('$0.00');
- expect(ordersPage.totalPrice()).toEqual('$260.00');
- });
- });
- });
- -----------------------------------------------------------------------------------------------------------------------
- upsell_compaigns.po.js
- var commonHelper = require('./../../../helpers/common.helper');
- var UpsellCampaignsPage = function () {
- //--------------------------------------------------------------------------
- // Locators
- //--------------------------------------------------------------------------
- var btnNewCampaign = '[href="/admin/upsells/create"]';
- var campaignLocator = 'item in vm.campaigns';
- var campaignTitle = "item.title";
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnAddFirstCampaign = $('.empty-state ' + btnNewCampaign);
- this.btnAddCampaign = $('[data-ng-if="vm.campaigns.length"] ' + btnNewCampaign);
- this.btnAdd = element.all(by.css(btnNewCampaign)).first();
- this.eleBuyType = $('[href="/admin/upsells/campaign?type=x-items"]');
- this.eleBuyTypeStore = $('[href="/admin/upsells/campaign?type=storewide"]');
- this.campaignsList = element.all(by.repeater(campaignLocator));
- this.btnEditSettings = element(by.buttonText('Edit Settings'));
- this.btnDeleteCompaign = element(by.buttonText('Delete Campaign'));
- this.btnConfirm = element(by.buttonText('Confirm'));
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickAddCampaign = function() {
- var btnFirst = this.btnAddFirstCampaign;
- var btnAdd = this.btnAddCampaign;
- btnFirst.isPresent().then(function(result) {
- if(result) {
- btnFirst.click();
- } else {
- btnAdd.click();
- }
- });
- };
- this.selectBuyType = function() {
- commonHelper.waitUntilElementVisible(this.eleBuyType);
- commonHelper.moveMouseOver(this.eleBuyType);
- this.eleBuyType.click();
- commonHelper.waitUntilElementIsNotPresent(this.eleBuyType);
- browser.sleep(1000);
- };
- this.selectBuyTypeStorewide = function() {
- commonHelper.waitUntilElementVisible(this.eleBuyTypeStorewide);
- commonHelper.moveMouseOver(this.eleBuyType);
- this.eleBuyTypeStorewide.click();
- commonHelper.waitUntilElementIsNotPresent(this.eleBuyTypeStorewide);
- browser.sleep(1000);
- };
- this.campaignEntry = function(name) {
- return element(by.cssContainingText("[ng-repeat='" + campaignLocator + "']", name));
- };
- this.campaignName = function(name) {
- var items = this.campaignsList.filter(function(item) {
- return item.element(by.binding(campaignTitle)).getText().then(function(_name) {
- return _name === name;
- });
- });
- return items.first();
- };
- this.selectCampaign = function(name) {
- this.campaignName(name).click();
- };
- this.clickEditSettings = function() {
- commonHelper.waitUntilElementVisible(this.btnEditSettings);
- this.btnEditSettings.click();
- browser.sleep(1000);
- };
- this.clickDeleteCompaign = function () {
- commonHelper.waitUntilElementVisible(this.btnDeleteCompaign);
- this.btnDeleteCompaign.click();
- browser.sleep(1000);
- };
- this.clickConfirm = function () {
- commonHelper.waitUntilElementVisible(this.btnConfirm);
- this.btnConfirm.click();
- browser.sleep(1000);
- };
- };
- module.exports = UpsellCampaignsPage;
Add Comment
Please, Sign In to add comment