Guest User

product_setup.spec

a guest
Feb 9th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.72 KB | None | 0 0
  1. product_setup.spec
  2.  
  3. var pageObject = require('./../../../../services/pages').container.PageObject;
  4. var signInPage = pageObject.getSignInPage();
  5. var dashboardPage = pageObject.getDashboardPage();
  6. var addProductPage = pageObject.getAddProductPage();
  7. var productListPage = pageObject.getProductListPage();
  8. var productSetupPage = pageObject.getProductSetupPage();
  9. var signUpPage = pageObject.getSignUpPage();
  10. var productPage = pageObject.getProductPage();
  11. var addCollectionPage = pageObject.getAddCollectionPage();
  12. var collectionListPage = pageObject.getCollectionListPage();
  13. var collectionsPage = pageObject.getCollectionsPage();
  14.  
  15. var signInData = require('./../../../../data/admin/sign_in/index');
  16. var productData = require('./../../../../data/admin/product/index');
  17. var coreData = require('./../../../../data/admin/core/index');
  18. var collectionData = require('./../../../../data/admin/collection/index');
  19. var commonHelper = require('./../../../../services/helpers/common.helper.js');
  20.  
  21.  
  22. describe('Product setup', function () {
  23.  
  24. var unique_value = commonHelper.uniqueValue();
  25. var storeName = coreData.storeName + unique_value;
  26. var mainStoreLink= signInData.link;
  27. var storeLink = 'https://' + storeName + '.' + mainStoreLink.split('.')[1] + '.com';
  28.  
  29. var type = productData.product.type;
  30. var price = productData.product.price;
  31. var weight = productData.product.weight;
  32. var vendor = productData.product.vendor;
  33. var sku = productData.product.sku;
  34. var tag = productData.product.tag;
  35.  
  36. var secondPrice = '145.00';
  37. var comparePrice = productData.product.comparePrice;
  38.  
  39. var username = signInData.adminAccount.username;
  40. var password = signInData.adminAccount.password;
  41.  
  42. describe('Product page scenarios - create new store', function () {
  43.  
  44. beforeAll(function () {
  45. commonHelper.acceptAlert();
  46. browser.get(mainStoreLink);
  47. });
  48.  
  49. afterAll(function () {
  50. commonHelper.clearAllData();
  51. });
  52.  
  53. it('should redirect on dashboard page after login', function () {
  54. signInPage.login(username, password);
  55. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  56. });
  57.  
  58. it('should click build new store', function () {
  59. dashboardPage.clickBuildNewStore();
  60. commonHelper.waitUntilElementVisible(signUpPage.btnStartBuildingStoreNow);
  61. });
  62.  
  63. it('should submit new store form', function () {
  64. signUpPage.fillStoreName(storeName);
  65. signUpPage.fillStoreSubdomain(storeName);
  66. signUpPage.clickStartBuildingStoreNow();
  67. commonHelper.waitUntilElementVisible(signUpPage.btnSignIn);
  68. });
  69. });
  70.  
  71. describe('Product page scenarios - checking for type', function () {
  72.  
  73. var title = commonHelper.uniqueProductName('type1') + unique_value;
  74. var secondTitle = commonHelper.uniqueProductName('type2') + unique_value;
  75.  
  76. beforeAll(function () {
  77. commonHelper.acceptAlert();
  78. });
  79.  
  80. afterAll(function () {
  81. commonHelper.clearAllData();
  82. });
  83.  
  84. it('should redirect on dashboard page after login', function () {
  85. browser.get(storeLink + '/admin');
  86. signInPage.login(username, password);
  87. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  88. });
  89.  
  90. it('should open new product page', function () {
  91. dashboardPage.openProductListPage();
  92. productListPage.clickAddProduct();
  93. addProductPage.waitForPublishButton();
  94. });
  95.  
  96. it('should fill first product form', function () {
  97. addProductPage.fillType(type);
  98. addProductPage.fillTitle(title);
  99. addProductPage.fillPrice(price);
  100. });
  101.  
  102. it('should publish product', function () {
  103. addProductPage.clickPublish();
  104. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  105. });
  106.  
  107. it('should open Product setup page', function () {
  108. dashboardPage.openProductSetupPage();
  109. });
  110.  
  111. it('should switch-off type setup', function () {
  112. productSetupPage.clickSetup('Type');
  113. });
  114.  
  115. it('should open edit page for first added product', function () {
  116. dashboardPage.openProductListPage();
  117. productListPage.editProduct(title);
  118. addProductPage.waitForSaveButton();
  119. });
  120.  
  121. it('should not see type field', function () {
  122. expect(addProductPage.selType.isPresent()).toBeFalsy();
  123. });
  124.  
  125. it('should open new product page', function () {
  126. dashboardPage.openProductListPage();
  127. productListPage.clickAddProduct();
  128. addProductPage.waitForPublishButton();
  129. });
  130.  
  131. it('should not see type field', function () {
  132. expect(addProductPage.selType.isPresent()).toBeFalsy();
  133. });
  134.  
  135. it('should fill second product form', function () {
  136. addProductPage.fillTitle(secondTitle);
  137. addProductPage.fillPrice(secondPrice);
  138. });
  139.  
  140. it('should publish product', function () {
  141. addProductPage.clickPublish();
  142. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  143. });
  144.  
  145. it('should open Product setup page', function () {
  146. dashboardPage.openProductSetupPage();
  147. });
  148.  
  149. it('should switch-on type setup', function () {
  150. productSetupPage.clickSetup('Type');
  151. });
  152.  
  153. it('should open edit page for first product', function () {
  154. dashboardPage.openProductListPage();
  155. productListPage.editProduct(title);
  156. addProductPage.waitForSaveButton();
  157. });
  158.  
  159. it('should show correct selected type', function () {
  160. expect(addProductPage.selType.isPresent()).toBeTruthy();
  161. expect(addProductPage.selectedType()).toEqual(type);
  162. });
  163.  
  164. it('should open edit page for second product', function () {
  165. dashboardPage.openProductListPage();
  166. productListPage.editProduct(secondTitle);
  167. addProductPage.waitForSaveButton();
  168. });
  169.  
  170. it('should not be able to save product without title', function () {
  171. addProductPage.clickSave();
  172.  
  173. expect(addProductPage.selType.isPresent()).toBeTruthy();
  174. expect(addProductPage.errorType()).toEqual('This field is required.');
  175. });
  176.  
  177. it('should add type', function () {
  178. commonHelper.waitUntilElementVisible(addProductPage.selType);
  179. addProductPage.selectType(type);
  180. });
  181.  
  182. it('should save product', function () {
  183. addProductPage.clickSave();
  184. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  185. });
  186. });
  187.  
  188. describe('Product page scenarios - checking for compare at price', function () {
  189.  
  190. var title = commonHelper.uniqueProductName('price1') + unique_value;
  191. var secondTitle = commonHelper.uniqueProductName('price2') + unique_value;
  192.  
  193. beforeAll(function () {
  194. commonHelper.acceptAlert();
  195. });
  196.  
  197. afterAll(function () {
  198. commonHelper.clearAllData();
  199. });
  200.  
  201. it('should redirect on dashboard page after login', function () {
  202. browser.get(storeLink + '/admin');
  203. signInPage.login(username, password);
  204. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  205. });
  206.  
  207. it('should open new product page', function () {
  208. dashboardPage.openProductListPage();
  209. productListPage.clickAddProduct();
  210. addProductPage.waitForPublishButton();
  211. });
  212.  
  213. it('should fill first product form', function () {
  214. addProductPage.selectType(type);
  215. addProductPage.fillTitle(title);
  216. addProductPage.fillPrice(price);
  217. addProductPage.fillComparePrice(comparePrice);
  218. });
  219.  
  220. it('should publish first product', function () {
  221. addProductPage.clickPublish();
  222. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  223. });
  224.  
  225. it('should open Product setup page', function () {
  226. dashboardPage.openProductSetupPage();
  227. });
  228.  
  229. it('should switch-off Compare at price setup', function () {
  230. productSetupPage.clickSetup('Compare at price');
  231. });
  232.  
  233. it('should open new product page', function () {
  234. dashboardPage.openProductListPage();
  235. productListPage.clickAddProduct();
  236. addProductPage.waitForPublishButton();
  237. });
  238.  
  239. it('should not see compare price field', function () {
  240. expect(addProductPage.txtComparePrice.isPresent()).toBeFalsy();
  241. });
  242.  
  243. it('should fill second product form', function () {
  244. addProductPage.selectType(type);
  245. addProductPage.fillTitle(secondTitle);
  246. addProductPage.fillPrice(price);
  247. });
  248.  
  249. it('should publish product', function () {
  250. addProductPage.clickPublish();
  251. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  252. });
  253.  
  254. it('should open edit page for first product', function () {
  255. productListPage.editProduct(title);
  256. addProductPage.waitForSaveButton();
  257. });
  258.  
  259. it('should not see compare price field', function () {
  260. expect(addProductPage.txtComparePrice.isPresent()).toBeFalsy();
  261. });
  262.  
  263. it('should save product', function () {
  264. addProductPage.clickSave();
  265. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  266. });
  267.  
  268. it('should show product page after click on first product link', function () {
  269. productListPage.clickProduct(title);
  270. });
  271.  
  272. it('should show add to cart button', function () {
  273. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  274. });
  275.  
  276. it('should not show compare price', function () {
  277. expect(productPage.txtComparePrice.isDisplayed()).toBeFalsy()
  278. });
  279.  
  280. it('should open previous page', function () {
  281. commonHelper.switchToPreviousTab();
  282. });
  283.  
  284. it('should open Product setup page', function () {
  285. dashboardPage.openProductSetupPage();
  286. });
  287.  
  288. it('should switch-on compare at price setup', function () {
  289. productSetupPage.clickSetup('Compare at price');
  290. });
  291.  
  292. it('should show product page after click on first product link', function () {
  293. dashboardPage.openProductListPage();
  294. productListPage.clickProduct(title);
  295. });
  296.  
  297. it('should show add to cart button', function () {
  298. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  299. });
  300.  
  301. it('should not show compare price after switch on', function () {
  302. expect(productPage.txtComparePrice.isDisplayed()).toBeFalsy();
  303. });
  304.  
  305. it('should open previous page', function () {
  306. commonHelper.switchToPreviousTab();
  307. });
  308.  
  309. it('should open edit page for first product', function () {
  310. dashboardPage.openProductListPage();
  311. productListPage.editProduct(title);
  312. addProductPage.waitForSaveButton();
  313. });
  314.  
  315. it('should see empty compare at prise field', function () {
  316. commonHelper.waitUntilElementVisible(addProductPage.txtComparePrice);
  317.  
  318. expect(addProductPage.getComparePrice()).toEqual('');
  319. });
  320.  
  321. it('should add compare price', function () {
  322. addProductPage.fillComparePrice(comparePrice);
  323. });
  324.  
  325. it('should save product', function () {
  326. addProductPage.clickSave();
  327. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  328. });
  329. });
  330.  
  331. describe('Product page scenarios - checking for shipping', function () {
  332.  
  333. var title = commonHelper.uniqueProductName('shipping1') + unique_value;
  334.  
  335. beforeAll(function () {
  336. commonHelper.acceptAlert();
  337. });
  338.  
  339. afterAll(function () {
  340. commonHelper.clearAllData();
  341. });
  342.  
  343. it('should redirect on dashboard page after login', function () {
  344. browser.get(storeLink + '/admin');
  345. signInPage.login(username, password);
  346. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  347. });
  348.  
  349. it('should open new product page', function () {
  350. dashboardPage.openProductListPage();
  351. productListPage.clickAddProduct();
  352. addProductPage.waitForPublishButton();
  353. });
  354.  
  355. it('should fill first product form', function () {
  356. addProductPage.selectType(type);
  357. addProductPage.fillTitle(title);
  358. addProductPage.fillPrice(price);
  359. addProductPage.fillShippingWeight(weight);
  360. });
  361.  
  362. it('should publish product', function () {
  363. addProductPage.clickPublish();
  364. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  365. });
  366.  
  367. it('should open Product setup page', function () {
  368. dashboardPage.openProductSetupPage();
  369. });
  370.  
  371. it('should switch-off Shipping weight setup', function () {
  372. productSetupPage.clickSetup('Shipping weight');
  373. });
  374.  
  375. it('should open edit page for first added product', function () {
  376. dashboardPage.openProductListPage();
  377. productListPage.editProduct(title);
  378. addProductPage.waitForSaveButton();
  379. });
  380.  
  381. it('should not see shipping field', function () {
  382. expect(addProductPage.txtShippingWeight.isPresent()).toBeFalsy();
  383. });
  384.  
  385. it('should open new product page', function () {
  386. dashboardPage.openProductListPage();
  387. productListPage.clickAddProduct();
  388. addProductPage.waitForPublishButton();
  389. });
  390.  
  391. it('should not see shipping field', function () {
  392. expect(addProductPage.txtShippingWeight.isPresent()).toBeFalsy();
  393. });
  394.  
  395. it('should return to previous page', function () {
  396. browser.navigate().back();
  397. });
  398.  
  399. it('should open Product setup page', function () {
  400. dashboardPage.openProductSetupPage();
  401. });
  402.  
  403. it('should switch-on Shipping weight setup', function () {
  404. productSetupPage.clickSetup('Shipping weight');
  405. });
  406.  
  407. it('should open edit page for first product', function () {
  408. dashboardPage.openProductListPage();
  409. productListPage.editProduct(title);
  410. addProductPage.waitForSaveButton();
  411. });
  412.  
  413. it('should show shipping weight field', function () {
  414. expect(addProductPage.txtShippingWeight.isPresent()).toBeTruthy();
  415. });
  416.  
  417. });
  418.  
  419. describe('Product page scenarios - checking for vendor', function () {
  420.  
  421. var title = commonHelper.uniqueProductName('vendor1') + unique_value;
  422. var secondTitle = commonHelper.uniqueProductName('vendor2') + unique_value;
  423.  
  424. beforeAll(function () {
  425. commonHelper.acceptAlert();
  426. });
  427.  
  428. afterAll(function () {
  429. commonHelper.clearAllData();
  430. });
  431.  
  432. it('should redirect on dashboard page after login', function () {
  433. browser.get(storeLink + '/admin');
  434. signInPage.login(username, password);
  435. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  436. });
  437.  
  438. it('should open new product page', function () {
  439. dashboardPage.openProductListPage();
  440. productListPage.clickAddProduct();
  441. addProductPage.waitForPublishButton();
  442. });
  443.  
  444. it('should fill first product form', function () {
  445. addProductPage.selectType(type);
  446. addProductPage.fillTitle(title);
  447. addProductPage.fillPrice(price);
  448. addProductPage.fillVendor(vendor);
  449. });
  450.  
  451. it('should publish product', function () {
  452. addProductPage.clickPublish();
  453. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  454. });
  455.  
  456. it('should open Product setup page', function () {
  457. dashboardPage.openProductSetupPage();
  458. });
  459.  
  460. it('should switch-off Vendor setup', function () {
  461. productSetupPage.clickSetup('Vendor');
  462. });
  463.  
  464. it('should open edit page for first added product', function () {
  465. dashboardPage.openProductListPage();
  466. productListPage.editProduct(title);
  467. addProductPage.waitForSaveButton();
  468. });
  469.  
  470. it('should not see vendor field', function () {
  471. expect(addProductPage.selVendor.isPresent()).toBeFalsy();
  472. });
  473.  
  474. it('should open new product page', function () {
  475. dashboardPage.openProductListPage();
  476. productListPage.clickAddProduct();
  477. addProductPage.waitForPublishButton();
  478. });
  479.  
  480. it('should not see vendor field', function () {
  481. expect(addProductPage.selVendor.isPresent()).toBeFalsy();
  482. });
  483.  
  484. it('should fill second product form', function () {
  485. addProductPage.selectType(type);
  486. addProductPage.fillTitle(secondTitle);
  487. addProductPage.fillPrice(price);
  488. });
  489.  
  490. it('should publish product', function () {
  491. addProductPage.clickPublish();
  492. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  493. });
  494.  
  495. it('should open Product setup page', function () {
  496. dashboardPage.openProductSetupPage();
  497. });
  498.  
  499. it('should switch-on vendor setup', function () {
  500. productSetupPage.clickSetup('Vendor');
  501. });
  502.  
  503. it('should open edit page for first product', function () {
  504. dashboardPage.openProductListPage();
  505. productListPage.editProduct(title);
  506. addProductPage.waitForSaveButton();
  507. });
  508.  
  509. it('should show correct vendor', function () {
  510. expect(addProductPage.selVendor.isPresent()).toBeTruthy();
  511. expect(addProductPage.getVendor()).toEqual(vendor);
  512. });
  513.  
  514. it('should open edit page for second product', function () {
  515. dashboardPage.openProductListPage();
  516. productListPage.editProduct(secondTitle);
  517. addProductPage.waitForSaveButton();
  518. });
  519.  
  520. it('should see vendor field', function () {
  521. expect(addProductPage.selVendor.isPresent()).toBeTruthy();
  522. });
  523.  
  524. it('should add vendor', function () {
  525. commonHelper.waitUntilElementVisible(addProductPage.selVendor);
  526. addProductPage.selectVendor(vendor);
  527. });
  528.  
  529. it('should save product', function () {
  530. addProductPage.clickSave();
  531. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  532. });
  533. });
  534.  
  535. describe('Product page scenarios - checking for SKU', function () {
  536.  
  537. var title = commonHelper.uniqueProductName('sku1') + unique_value;
  538. var secondTitle = commonHelper.uniqueProductName('sku2') + unique_value;
  539.  
  540. beforeAll(function () {
  541. commonHelper.acceptAlert();
  542. });
  543.  
  544. afterAll(function () {
  545. commonHelper.clearAllData();
  546. });
  547.  
  548. it('should redirect on dashboard page after login', function () {
  549. browser.get(storeLink + '/admin');
  550. signInPage.login(username, password);
  551. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  552. });
  553.  
  554. it('should open new product page', function () {
  555. dashboardPage.openProductListPage();
  556. productListPage.clickAddProduct();
  557. addProductPage.waitForPublishButton();
  558. });
  559.  
  560. it('should fill first product form', function () {
  561. addProductPage.selectType(type);
  562. addProductPage.fillTitle(title);
  563. addProductPage.fillPrice(price);
  564. addProductPage.fillSku(sku);
  565. });
  566.  
  567. it('should publish product', function () {
  568. addProductPage.clickPublish();
  569. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  570. });
  571.  
  572. it('should open Product setup page', function () {
  573. dashboardPage.openProductSetupPage();
  574. });
  575.  
  576. it('should switch-off SKU setup', function () {
  577. productSetupPage.clickSetup('SKU');
  578. });
  579.  
  580. it('should open edit page for first added product', function () {
  581. dashboardPage.openProductListPage();
  582. productListPage.editProduct(title);
  583. addProductPage.waitForSaveButton();
  584. });
  585.  
  586. it('should not see sku field', function () {
  587. expect(addProductPage.txtSku.isPresent()).toBeFalsy();
  588. });
  589.  
  590. it('should open new product page', function () {
  591. dashboardPage.openProductListPage();
  592. productListPage.clickAddProduct();
  593. addProductPage.waitForPublishButton();
  594. });
  595.  
  596. it('should not see sku field', function () {
  597. expect(addProductPage.txtSku.isPresent()).toBeFalsy();
  598. });
  599.  
  600. it('should return to previous page', function () {
  601. browser.navigate().back();
  602. });
  603.  
  604. it('should open Product setup page', function () {
  605. dashboardPage.openProductSetupPage();
  606. });
  607.  
  608. it('should switch-on vendor weight setup', function () {
  609. productSetupPage.clickSetup('SKU');
  610. });
  611.  
  612. it('should open edit page for first product', function () {
  613. dashboardPage.openProductListPage();
  614. productListPage.editProduct(title);
  615. addProductPage.waitForSaveButton();
  616. });
  617.  
  618. it('should show sku field', function () {
  619. expect(addProductPage.txtSku.isPresent()).toBeTruthy();
  620. });
  621. });
  622.  
  623. describe('Product page scenarios - checking for tags', function () {
  624.  
  625. var title = commonHelper.uniqueProductName('tags1') + unique_value;
  626. var secondTitle = commonHelper.uniqueProductName('tags2') + unique_value;
  627.  
  628. beforeAll(function () {
  629. commonHelper.acceptAlert();
  630. });
  631.  
  632. afterAll(function () {
  633. commonHelper.clearAllData();
  634. });
  635.  
  636. it('should redirect on dashboard page after login', function () {
  637. browser.get(storeLink + '/admin');
  638. signInPage.login(username, password);
  639. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  640. });
  641.  
  642. it('should open new product page', function () {
  643. dashboardPage.openProductListPage();
  644. productListPage.clickAddProduct();
  645. addProductPage.waitForPublishButton();
  646. });
  647.  
  648. it('should fill first product form', function () {
  649. addProductPage.selectType(type);
  650. addProductPage.fillTitle(title);
  651. addProductPage.fillPrice(price);
  652. addProductPage.addTag(tag);
  653. });
  654.  
  655. it('should publish product', function () {
  656. addProductPage.clickPublish();
  657. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  658. });
  659.  
  660. it('should open Product setup page', function () {
  661. dashboardPage.openProductSetupPage();
  662. });
  663.  
  664. it('should switch-off tags setup', function () {
  665. productSetupPage.clickSetup('Tags');
  666. });
  667.  
  668. it('should open edit page for first added product', function () {
  669. dashboardPage.openProductListPage();
  670. productListPage.editProduct(title);
  671. addProductPage.waitForSaveButton();
  672. });
  673.  
  674. it('should not see tags field', function () {
  675. expect(addProductPage.txtTags.isPresent()).toBeFalsy();
  676. });
  677.  
  678. it('should open new product page', function () {
  679. dashboardPage.openProductListPage();
  680. productListPage.clickAddProduct();
  681. addProductPage.waitForPublishButton();
  682. });
  683.  
  684. it('should not see tags field', function () {
  685. expect(addProductPage.txtTags.isPresent()).toBeFalsy();
  686. });
  687.  
  688. it('should fill second product form', function () {
  689. addProductPage.selectType(type);
  690. addProductPage.fillTitle(secondTitle);
  691. addProductPage.fillPrice(price);
  692. });
  693.  
  694. it('should publish product', function () {
  695. addProductPage.clickPublish();
  696. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  697. });
  698.  
  699. it('should open Product setup page', function () {
  700. dashboardPage.openProductSetupPage();
  701. });
  702.  
  703. it('should switch-on tags setup', function () {
  704. productSetupPage.clickSetup('Tags');
  705. });
  706.  
  707. it('should open edit page for first product', function () {
  708. dashboardPage.openProductListPage();
  709. productListPage.editProduct(title);
  710. addProductPage.waitForSaveButton();
  711. });
  712.  
  713. it('should show correct tags', function () {
  714. expect(addProductPage.eleSelectedCollection(tag).isDisplayed()).toBeTruthy();
  715. });
  716.  
  717. it('should open edit page for second product', function () {
  718. dashboardPage.openProductListPage();
  719. productListPage.editProduct(secondTitle);
  720. addProductPage.waitForSaveButton();
  721. });
  722.  
  723. it('should see tags field', function () {
  724. expect(addProductPage.txtTags.isPresent()).toBeTruthy();
  725. });
  726. });
  727.  
  728. describe('Product page scenarios - checking for description', function () {
  729.  
  730. var title = commonHelper.uniqueProductName('description1') + unique_value;
  731. var secondTitle = commonHelper.uniqueProductName('description2') + unique_value;
  732.  
  733. beforeAll(function () {
  734. commonHelper.acceptAlert();
  735. });
  736.  
  737. afterAll(function () {
  738. commonHelper.clearAllData();
  739. });
  740.  
  741. it('should redirect on dashboard page after login', function () {
  742. browser.get(storeLink + '/admin');
  743. signInPage.login(username, password);
  744. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  745. });
  746.  
  747. it('should open new product page', function () {
  748. dashboardPage.openProductListPage();
  749. productListPage.clickAddProduct();
  750. addProductPage.waitForPublishButton();
  751. });
  752.  
  753. it('should fill first product form', function () {
  754. addProductPage.selectType(type);
  755. addProductPage.fillTitle(title);
  756. addProductPage.fillPrice(price);
  757. addProductPage.fillDescription('simple description')
  758. });
  759.  
  760. it('should publish first product', function () {
  761. addProductPage.clickPublish();
  762. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  763. });
  764.  
  765. it('should open Product setup page', function () {
  766. dashboardPage.openProductSetupPage();
  767. });
  768.  
  769. it('should switch-off Description Tabs setup', function () {
  770. productSetupPage.clickSetup('Description Tabs');
  771. });
  772.  
  773. it('should open new product page', function () {
  774. dashboardPage.openProductListPage();
  775. productListPage.clickAddProduct();
  776. addProductPage.waitForPublishButton();
  777. });
  778.  
  779. it('should not see Description Tabs field', function () {
  780. expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
  781. });
  782.  
  783. it('should not see description field', function () {
  784. expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
  785. });
  786.  
  787. it('should fill second product form', function () {
  788. addProductPage.selectType(type);
  789. addProductPage.fillTitle(secondTitle);
  790. addProductPage.fillPrice(price);
  791. });
  792.  
  793. it('should publish product', function () {
  794. addProductPage.clickPublish();
  795. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  796. });
  797.  
  798. it('should open edit page for first product', function () {
  799. productListPage.editProduct(title);
  800. addProductPage.waitForSaveButton();
  801. });
  802.  
  803. it('should not see description field', function () {
  804. expect(addProductPage.eleIframe.isPresent()).toBeFalsy();
  805. });
  806.  
  807. it('should save product', function () {
  808. addProductPage.clickSave();
  809. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  810. });
  811.  
  812. it('should show product page after click on first product link', function () {
  813. productListPage.clickProduct(title);
  814. });
  815.  
  816. it('should show add to cart button', function () {
  817. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  818. });
  819.  
  820. it('should not show description', function () {
  821. expect(productPage.txtDescription.isPresent()).toBeFalsy()
  822. });
  823.  
  824. it('should open previous page', function () {
  825. commonHelper.switchToPreviousTab();
  826. });
  827.  
  828. it('should open Product setup page', function () {
  829. dashboardPage.openProductSetupPage();
  830. });
  831.  
  832. it('should switch-on description setup', function () {
  833. productSetupPage.clickSetup('Description Tabs');
  834. });
  835.  
  836. it('should show product page after click on first product link', function () {
  837. dashboardPage.openProductListPage();
  838. productListPage.clickProduct(title);
  839. });
  840.  
  841. it('should show add to cart button', function () {
  842. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  843. });
  844.  
  845. it('should show description after switch on', function () {
  846. expect(productPage.txtDescription.isDisplayed()).toBeTruthy();
  847. expect(productPage.getDescriptionText()).toContain('simple description')
  848. });
  849.  
  850. it('should open previous page', function () {
  851. commonHelper.switchToPreviousTab();
  852. });
  853.  
  854. it('should open edit page for first product', function () {
  855. dashboardPage.openProductListPage();
  856. productListPage.editProduct(title);
  857. addProductPage.waitForSaveButton();
  858. });
  859.  
  860. it('should see description field with previous data', function () {
  861. commonHelper.waitUntilElementVisible(addProductPage.eleIframe);
  862. expect(addProductPage.getDescription()).toContain('simple description')
  863. });
  864. });
  865.  
  866. describe('Product page scenarios - checking for add description tab', function () {
  867.  
  868. var title = commonHelper.uniqueProductName('addDescriptionTab') + unique_value;
  869.  
  870. beforeAll(function () {
  871. commonHelper.acceptAlert();
  872. });
  873.  
  874. afterAll(function () {
  875. commonHelper.clearAllData();
  876. });
  877.  
  878. it('should redirect on dashboard page after login', function () {
  879. browser.get(storeLink + '/admin');
  880. signInPage.login(username, password);
  881. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  882. });
  883.  
  884. it('should open Product setup page', function () {
  885. dashboardPage.openProductSetupPage();
  886. });
  887.  
  888. it('should add new description tab', function () {
  889. productSetupPage.fillNewTab('test');
  890. });
  891.  
  892. it('should open new product page', function () {
  893. dashboardPage.openProductListPage();
  894. productListPage.clickAddProduct();
  895. addProductPage.waitForPublishButton();
  896. });
  897.  
  898. it('should see added description tab', function () {
  899. expect(addProductPage.getDescriptionTab()).toContain('test');
  900. });
  901.  
  902. it('should fill product form', function () {
  903. addProductPage.selectType(type);
  904. addProductPage.fillTitle(title);
  905. addProductPage.fillPrice(price);
  906. });
  907.  
  908. it('should publish product', function () {
  909. addProductPage.clickPublish();
  910. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  911. });
  912.  
  913. it('should show product page after click on first product link', function () {
  914. productListPage.clickProduct(title);
  915. });
  916.  
  917. it('should show add to cart button', function () {
  918. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  919. });
  920.  
  921. it('should show added description tab', function () {
  922. expect(productPage.getDescriptionText()).toContain('test');
  923. });
  924.  
  925. it('should open previous page', function () {
  926. commonHelper.switchToPreviousTab();
  927. });
  928.  
  929. it('should open Product setup page', function () {
  930. dashboardPage.openProductSetupPage();
  931. });
  932.  
  933. it('should delete description with data', function () {
  934. productSetupPage.clickDeleteTab('test');
  935. });
  936. });
  937.  
  938. describe('Product page scenarios - checking for delete description tab with move content to existing tab selected in pop-up', function () {
  939.  
  940. var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
  941.  
  942. beforeAll(function () {
  943. commonHelper.acceptAlert();
  944. });
  945.  
  946. afterAll(function () {
  947. commonHelper.clearAllData();
  948. });
  949.  
  950. it('should redirect on dashboard page after login', function () {
  951. browser.get(storeLink + '/admin');
  952. signInPage.login(username, password);
  953. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  954. });
  955.  
  956. it('should open Product setup page', function () {
  957. dashboardPage.openProductSetupPage();
  958. });
  959.  
  960. it('should add new description tab', function () {
  961. productSetupPage.fillNewTab('test1');
  962. dashboardPage.openProductSetupPage();
  963. productSetupPage.fillNewTab('test2');
  964. });
  965.  
  966. it('should open new product page', function () {
  967. dashboardPage.openProductListPage();
  968. productListPage.clickAddProduct();
  969. addProductPage.waitForPublishButton();
  970. });
  971.  
  972. it('should see added description tab', function () {
  973. expect(addProductPage.getDescriptionTab()).toContain('test1');
  974. expect(addProductPage.getDescriptionTab()).toContain('test2');
  975. });
  976.  
  977. it('should fill first product form', function () {
  978. addProductPage.selectType(type);
  979. addProductPage.fillTitle(title);
  980. addProductPage.fillPrice(price);
  981. });
  982.  
  983. it('should open added description', function () {
  984. addProductPage.clickDescriptionSection('test1');
  985. });
  986.  
  987. it('should add description', function () {
  988. addProductPage.fillDescription('first description');
  989. });
  990.  
  991. it('should publish product', function () {
  992. addProductPage.clickPublish();
  993. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  994. });
  995.  
  996. it('should show product page after click on first product link', function () {
  997. dashboardPage.openProductListPage();
  998. productListPage.clickProduct(title);
  999. });
  1000.  
  1001. it('should show add to cart button', function () {
  1002. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1003. });
  1004.  
  1005. it('should show added description tabs', function () {
  1006. expect(productPage.getDescriptionText()).toContain('test1');
  1007. expect(productPage.getDescriptionText()).toContain('test2');
  1008. });
  1009.  
  1010. it('should open previous page', function () {
  1011. commonHelper.switchToPreviousTab();
  1012. });
  1013.  
  1014. it('should open Product setup page', function () {
  1015. dashboardPage.openProductSetupPage();
  1016. });
  1017.  
  1018. it('should delete description with data', function () {
  1019. productSetupPage.clickDeleteTab('test1');
  1020. });
  1021.  
  1022. it('should see delete tab popup', function () {
  1023. commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
  1024. });
  1025.  
  1026. it('should move added content to another existing description', function () {
  1027. productSetupPage.selectTabToMoveData('test2');
  1028. productSetupPage.confirmMoveToExistingTab();
  1029. commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
  1030. });
  1031.  
  1032. it('should open edit page for added product', function () {
  1033. dashboardPage.openProductListPage();
  1034. productListPage.editProduct(title);
  1035. addProductPage.waitForSaveButton();
  1036. });
  1037.  
  1038. it('should see moved description', function () {
  1039. addProductPage.clickDescriptionSection('test2');
  1040. expect(addProductPage.getDescription()).toContain('first description');
  1041. browser.switchTo().defaultContent();
  1042. });
  1043.  
  1044. it('should save product', function () {
  1045. addProductPage.clickSave();
  1046. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1047. });
  1048.  
  1049. it('should show product page after click on product link', function () {
  1050. productListPage.clickProduct(title);
  1051. });
  1052.  
  1053. it('should show add to cart button', function () {
  1054. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1055. });
  1056.  
  1057. it('should not see deleted description tabs', function () {
  1058. expect(productPage.getDescriptionText()).not.toContain('test1');
  1059. expect(productPage.getDescriptionText()).toContain('test2');
  1060. });
  1061.  
  1062. it('should display description on correct tab', function () {
  1063. expect(productPage.getDescriptionContent()).not.toContain('first description');
  1064. productPage.clickDescriptionTab('test2');
  1065. expect(productPage.getDescriptionContent()).toContain('first description');
  1066. });
  1067.  
  1068. });
  1069.  
  1070. describe('Product page scenarios - checking for delete description tab with move content to newly created tab', function () {
  1071.  
  1072. var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
  1073.  
  1074. beforeAll(function () {
  1075. commonHelper.acceptAlert();
  1076. });
  1077.  
  1078. afterAll(function () {
  1079. commonHelper.clearAllData();
  1080. });
  1081.  
  1082. it('should redirect on dashboard page after login', function () {
  1083. browser.get(storeLink + '/admin');
  1084. signInPage.login(username, password);
  1085. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  1086. });
  1087.  
  1088. it('should open Product setup page', function () {
  1089. dashboardPage.openProductSetupPage();
  1090. });
  1091.  
  1092. it('should add new description tab', function () {
  1093. productSetupPage.fillNewTab('test1');
  1094. });
  1095.  
  1096. it('should open new product page', function () {
  1097. dashboardPage.openProductListPage();
  1098. productListPage.clickAddProduct();
  1099. addProductPage.waitForPublishButton();
  1100. });
  1101.  
  1102. it('should see added description tab', function () {
  1103. expect(addProductPage.getDescriptionTab()).toContain('test1');
  1104. });
  1105.  
  1106. it('should fill first product form', function () {
  1107. addProductPage.selectType(type);
  1108. addProductPage.fillTitle(title);
  1109. addProductPage.fillPrice(price);
  1110. });
  1111.  
  1112. it('should open added description', function () {
  1113. addProductPage.clickDescriptionSection('test1');
  1114. });
  1115.  
  1116. it('should add description', function () {
  1117. addProductPage.fillDescription('first description');
  1118. });
  1119.  
  1120. it('should publish product', function () {
  1121. addProductPage.clickPublish();
  1122. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1123. });
  1124.  
  1125. it('should show product page after click on first product link', function () {
  1126. dashboardPage.openProductListPage();
  1127. productListPage.clickProduct(title);
  1128. });
  1129.  
  1130. it('should show add to cart button', function () {
  1131. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1132. });
  1133.  
  1134. it('should show added description tab', function () {
  1135. expect(productPage.getDescriptionText()).toContain('test1');
  1136. });
  1137.  
  1138. it('should open previous page', function () {
  1139. commonHelper.switchToPreviousTab();
  1140. });
  1141.  
  1142. it('should open Product setup page', function () {
  1143. dashboardPage.openProductSetupPage();
  1144. });
  1145.  
  1146. it('should delete description with data', function () {
  1147. productSetupPage.clickDeleteTab('test1');
  1148. });
  1149.  
  1150. it('should see delete tab popup', function () {
  1151. commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
  1152. });
  1153.  
  1154. it('should move added content to newly created tab', function () {
  1155. productSetupPage.clickTabDeleteOption('Move content to new tab');
  1156. productSetupPage.createTabToMoveData('newtab');
  1157. productSetupPage.confirmMoveToNewTab();
  1158. commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
  1159. });
  1160.  
  1161. it('should open edit page for added product', function () {
  1162. dashboardPage.openProductListPage();
  1163. productListPage.editProduct(title);
  1164. addProductPage.waitForSaveButton();
  1165. });
  1166.  
  1167. it('should see moved description', function () {
  1168. addProductPage.clickDescriptionSection('newtab');
  1169. expect(addProductPage.getDescription()).toContain('first description');
  1170. browser.switchTo().defaultContent();
  1171. });
  1172.  
  1173. it('should save product', function () {
  1174. addProductPage.clickSave();
  1175. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1176. });
  1177.  
  1178. it('should show product page after click on product link', function () {
  1179. productListPage.clickProduct(title);
  1180. });
  1181.  
  1182. it('should show add to cart button', function () {
  1183. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1184. });
  1185.  
  1186. it('should not see deleted description tab', function () {
  1187. expect(productPage.getDescriptionText()).not.toContain('test1');
  1188. expect(productPage.getDescriptionText()).toContain('newtab');
  1189. });
  1190.  
  1191. it('should display description on correct tab', function () {
  1192. expect(productPage.getDescriptionContent()).not.toContain('first description');
  1193. productPage.clickDescriptionTab('newtab');
  1194. expect(productPage.getDescriptionContent()).toContain('first description');
  1195. });
  1196.  
  1197. });
  1198.  
  1199. describe('Product page scenarios - checking for delete description tab with removing all content', function () {
  1200.  
  1201. var title = commonHelper.uniqueProductName('deleteDescriptionTab') + unique_value;
  1202.  
  1203. beforeAll(function () {
  1204. commonHelper.acceptAlert();
  1205. });
  1206.  
  1207. afterAll(function () {
  1208. commonHelper.clearAllData();
  1209. });
  1210.  
  1211. it('should redirect on dashboard page after login', function () {
  1212. browser.get(storeLink + '/admin');
  1213. signInPage.login(username, password);
  1214. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  1215. });
  1216.  
  1217. it('should open Product setup page', function () {
  1218. dashboardPage.openProductSetupPage();
  1219. });
  1220.  
  1221. it('should add new description tab', function () {
  1222. productSetupPage.fillNewTab('test1');
  1223. });
  1224.  
  1225. it('should open new product page', function () {
  1226. dashboardPage.openProductListPage();
  1227. productListPage.clickAddProduct();
  1228. addProductPage.waitForPublishButton();
  1229. });
  1230.  
  1231. it('should see added description tab', function () {
  1232. expect(addProductPage.getDescriptionTab()).toContain('test1');
  1233. });
  1234.  
  1235. it('should fill first product form', function () {
  1236. addProductPage.selectType(type);
  1237. addProductPage.fillTitle(title);
  1238. addProductPage.fillPrice(price);
  1239. });
  1240.  
  1241. it('should open added description', function () {
  1242. addProductPage.clickDescriptionSection('test1');
  1243. });
  1244.  
  1245. it('should add description', function () {
  1246. addProductPage.fillDescription('test1 description');
  1247. });
  1248.  
  1249. it('should publish product', function () {
  1250. addProductPage.clickPublish();
  1251. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1252. });
  1253.  
  1254. it('should show product page after click on first product link', function () {
  1255. dashboardPage.openProductListPage();
  1256. productListPage.clickProduct(title);
  1257. });
  1258.  
  1259. it('should show add to cart button', function () {
  1260. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1261. });
  1262.  
  1263. it('should show added description tab', function () {
  1264. expect(productPage.getDescriptionText()).toContain('test1');
  1265. });
  1266.  
  1267. it('should display description on correct tab', function () {
  1268. expect(productPage.getDescriptionContent()).not.toContain('test1 description');
  1269. productPage.clickDescriptionTab('test1');
  1270. expect(productPage.getDescriptionContent()).toContain('test1 description');
  1271. });
  1272.  
  1273. it('should open previous page', function () {
  1274. commonHelper.switchToPreviousTab();
  1275. });
  1276.  
  1277. it('should open Product setup page', function () {
  1278. dashboardPage.openProductSetupPage();
  1279. });
  1280.  
  1281. it('should delete description with data', function () {
  1282. productSetupPage.clickDeleteTab('test1');
  1283. });
  1284.  
  1285. it('should see delete tab popup', function () {
  1286. commonHelper.waitUntilElementVisible(productSetupPage.btnMoveToExistingTab);
  1287. });
  1288.  
  1289. it('should delete tab with all content', function () {
  1290. productSetupPage.clickTabDeleteOption('Delete all tab content');
  1291. productSetupPage.confirmDeleteTab();
  1292. commonHelper.waitUntilElementVisible(dashboardPage.btnProducts);
  1293. });
  1294.  
  1295. it('should open edit page for added product', function () {
  1296. dashboardPage.openProductListPage();
  1297. productListPage.editProduct(title);
  1298. addProductPage.waitForSaveButton();
  1299. });
  1300.  
  1301. it('should not see deleted description tab', function () {
  1302. expect(addProductPage.getDescriptionTab()).not.toContain('test1');
  1303. });
  1304.  
  1305. it('should save product', function () {
  1306. addProductPage.clickSave();
  1307. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1308. });
  1309.  
  1310. it('should open new product page', function () {
  1311. productListPage.clickAddProduct();
  1312. addProductPage.waitForPublishButton();
  1313. });
  1314.  
  1315. it('should not see deleted description tab', function () {
  1316. expect(addProductPage.getDescriptionTab()).not.toContain('test1');
  1317. });
  1318.  
  1319. it('should show product page after click on product link', function () {
  1320. dashboardPage.openProductListPage();
  1321. productListPage.clickProduct(title);
  1322. });
  1323.  
  1324. it('should show add to cart button', function () {
  1325. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1326. });
  1327.  
  1328. it('should not see deleted description tab', function () {
  1329. expect(productPage.getDescriptionText()).not.toContain('test1');
  1330. });
  1331.  
  1332. it('should open previous page', function () {
  1333. commonHelper.switchToPreviousTab();
  1334. });
  1335.  
  1336. it('should open Product setup page', function () {
  1337. dashboardPage.openProductSetupPage();
  1338. });
  1339.  
  1340. it('should add new description tab', function () {
  1341. productSetupPage.fillNewTab('test1');
  1342. });
  1343.  
  1344. it('should open edit page for first added product', function () {
  1345. dashboardPage.openProductListPage();
  1346. productListPage.editProduct(title);
  1347. addProductPage.waitForSaveButton();
  1348. });
  1349.  
  1350. it('should not see description from deleted tab', function () {
  1351. addProductPage.clickDescriptionSection('test1');
  1352. expect(addProductPage.getDescription()).not.toContain('test1 description');
  1353. browser.switchTo().defaultContent();
  1354. });
  1355.  
  1356. it('should save product', function () {
  1357. addProductPage.clickSave();
  1358. commonHelper.waitUntilElementVisible(productListPage.productEntry(title));
  1359. });
  1360.  
  1361. it('should show product page after click on product link', function () {
  1362. productListPage.clickProduct(title);
  1363. });
  1364.  
  1365. it('should show add to cart button', function () {
  1366. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1367. });
  1368.  
  1369. it('should not display description from previously deleted tab', function () {
  1370. expect(productPage.txtDescriptionContent.isPresent()).toBeFalsy();
  1371. productPage.clickDescriptionTab('test1');
  1372. expect(productPage.txtDescriptionContent.isPresent()).toBeFalsy();
  1373. });
  1374.  
  1375. });
  1376.  
  1377. describe('Product page scenarios - checking the product URL path', function () {
  1378.  
  1379. var productTitle = commonHelper.uniqueProductName('urlpath') + unique_value;
  1380. var collectionTitle = 'collectionTitle' + unique_value;
  1381. var url = commonHelper.uniqueProductName('newurl') + unique_value;
  1382. var collectionDescription = collectionData.collection.description.first;
  1383.  
  1384. beforeAll(function () {
  1385. commonHelper.acceptAlert();
  1386. });
  1387.  
  1388. afterAll(function () {
  1389. commonHelper.clearAllData();
  1390. });
  1391.  
  1392. it('should redirect on dashboard page after login', function () {
  1393. browser.get(storeLink + '/admin');
  1394. signInPage.login(username, password);
  1395. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  1396. });
  1397.  
  1398. it('should open new product page', function () {
  1399. dashboardPage.openProductListPage();
  1400. productListPage.clickAddProduct();
  1401. addProductPage.waitForPublishButton();
  1402. });
  1403.  
  1404. it('should fill first product form', function () {
  1405. addProductPage.selectType(type);
  1406. addProductPage.fillTitle(productTitle);
  1407. addProductPage.fillPrice(price);
  1408. });
  1409.  
  1410. it('should publish product', function () {
  1411. addProductPage.clickPublish();
  1412. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  1413. });
  1414.  
  1415. it('should open edit page for added product', function () {
  1416. productListPage.editProduct(productTitle);
  1417. addProductPage.waitForSaveButton();
  1418. });
  1419.  
  1420. it('should edit url', function () {
  1421. addProductPage.fillUrl(url);
  1422. });
  1423.  
  1424. it('should save product', function () {
  1425. addProductPage.clickSave();
  1426. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  1427. });
  1428.  
  1429. it('should open new collection page', function () {
  1430. dashboardPage.openAddCollectionPage();
  1431. });
  1432.  
  1433. it('should fill title and description fields', function () {
  1434. addCollectionPage.fillTitle(collectionTitle);
  1435. addCollectionPage.fillDescription(collectionDescription);
  1436. });
  1437.  
  1438. it('should add manual product', function () {
  1439. addCollectionPage.clickAddProducts();
  1440. addCollectionPage.clickProduct(productTitle);
  1441. addCollectionPage.clickCloseProducts();
  1442. });
  1443.  
  1444. it('should add new collection', function () {
  1445. addCollectionPage.clickPublish();
  1446. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  1447. });
  1448.  
  1449. it('should open product page with correct link', function () {
  1450. dashboardPage.openProductListPage();
  1451. productListPage.clickProduct(productTitle);
  1452. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1453.  
  1454. expect(productPage.productTitle()).toEqual(productTitle);
  1455. expect(browser.getCurrentUrl()).toContain(url.toLowerCase());
  1456. expect(browser.getCurrentUrl()).not.toContain(productTitle);
  1457. });
  1458.  
  1459. it('should show add to cart button', function () {
  1460. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1461. });
  1462.  
  1463. it('should not be able to open product with previous link', function () {
  1464. browser.get(storeLink + '/product/' + productTitle);
  1465.  
  1466. expect(browser.getCurrentUrl()).not.toContain(url.toLowerCase());
  1467. expect(browser.getCurrentUrl()).toContain(productTitle);
  1468. expect(productPage.btnAddToCart.isPresent()).toBeFalsy();
  1469. commonHelper.switchToPreviousTab();
  1470. });
  1471.  
  1472. it('should open collection list page', function () {
  1473. dashboardPage.openCollectionListPage();
  1474. });
  1475.  
  1476. it('should show collection page after click on collection link', function () {
  1477. collectionListPage.clickCollection(collectionTitle);
  1478. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  1479.  
  1480. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  1481. });
  1482.  
  1483. it('should open product page from collection with correct link', function () {
  1484. collectionsPage.openProduct(productTitle);
  1485. commonHelper.waitUntilElementVisible(productPage.btnAddToCart);
  1486.  
  1487. expect(productPage.productTitle()).toEqual(productTitle);
  1488. expect(browser.getCurrentUrl()).toContain(url.toLowerCase());
  1489. expect(browser.getCurrentUrl()).not.toContain(productTitle);
  1490. });
  1491.  
  1492. });
  1493. });
Add Comment
Please, Sign In to add comment