Guest User

tag/vendor/weight

a guest
Feb 6th, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.25 KB | None | 0 0
  1. by_tag.spec.js
  2.  
  3. var pageObject = require('./../../../../../../services/pages').container.PageObject;
  4. var signInPage = pageObject.getSignInPage();
  5. var dashboardPage = pageObject.getDashboardPage();
  6. var addCollectionPage = pageObject.getAddCollectionPage();
  7. var collectionListPage = pageObject.getCollectionListPage();
  8. var collectionsPage = pageObject.getCollectionsPage();
  9. var addProductPage = pageObject.getAddProductPage();
  10. var productListPage = pageObject.getProductListPage();
  11. var signInData = require('./../../../../../../data/admin/sign_in/index');
  12. var collectionData = require('./../../../../../../data/admin/collection/index');
  13. var productData = require('./../../../../../../data/admin/product/index');
  14. var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
  15.  
  16. describe('Add Collection - Auto Adding - By Tag', function () {
  17.  
  18. var username = signInData.adminAccount.username;
  19. var password = signInData.adminAccount.password;
  20. var firstCollectionTitle = commonHelper.uniqueProductName('tag1');
  21. var firstCollectionDescription = collectionData.collection.description.first;
  22.  
  23. var product = {
  24. firstTitle: commonHelper.uniqueProductName('tag2'),
  25. type: productData.product.type,
  26. tag: productData.product.tag,
  27. price: productData.product.price
  28. };
  29.  
  30. describe('auto-add product by product tag does not contain', function () {
  31.  
  32. var unique_value = commonHelper.uniqueValue();
  33. var collectionTitle = firstCollectionTitle + unique_value;
  34. var productTitle = product.firstTitle + unique_value;
  35. var productTag = 'mouse' + unique_value;
  36.  
  37. beforeAll(function () {
  38. commonHelper.acceptAlert();
  39. browser.get(signInData.link);
  40. });
  41.  
  42. afterAll(function () {
  43. commonHelper.clearAllData();
  44. });
  45.  
  46. it('should redirect on dashboard page after login', function () {
  47. signInPage.login(username, password);
  48. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  49. });
  50.  
  51. it('should open products list page', function () {
  52. dashboardPage.openProductListPage();
  53. });
  54.  
  55. it('should open new product page', function () {
  56. productListPage.clickAddProduct();
  57. addProductPage.waitForPublishButton();
  58. });
  59.  
  60. it('should add new product', function () {
  61. addProductPage.selectType(product.type);
  62. addProductPage.selectFirstCollection();
  63. addProductPage.fillTitle(productTitle);
  64. addProductPage.fillPrice(product.price);
  65. addProductPage.selectVendor(productTag);
  66. addProductPage.clickPublish();
  67. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  68. });
  69.  
  70. it('should open new collection page', function () {
  71. dashboardPage.openAddCollectionPage();
  72. });
  73.  
  74. it('should fill title and description fields', function () {
  75. addCollectionPage.fillTitle(collectionTitle);
  76. addCollectionPage.fillDescription(firstCollectionDescription);
  77. });
  78.  
  79. it('should click auto add product radio button', function () {
  80. addCollectionPage.clickAddAuto();
  81. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  82. });
  83.  
  84. it('should add condition', function () {
  85. addCollectionPage.selectConditionVariant(0, 'Product tag');
  86. addCollectionPage.selectConditionRule(0, 'does not contain');
  87. addCollectionPage.fillConditionValue(0, product.tag);
  88. });
  89.  
  90. it('should add new collection', function () {
  91. addCollectionPage.clickPublish();
  92. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  93. });
  94.  
  95. it('should show collection page after click on collection link', function () {
  96. collectionListPage.clickCollection(collectionTitle);
  97. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  98.  
  99. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  100. commonHelper.switchToPreviousTab();
  101. });
  102. });
  103.  
  104.  
  105. describe('auto-add product by product tag is exactly', function () {
  106.  
  107. var unique_value = commonHelper.uniqueValue();
  108. var collectionTitle = firstCollectionTitle + unique_value;
  109. var productTitle = product.firstTitle + unique_value;
  110. var productTag = product.tag + unique_value;
  111.  
  112. beforeAll(function () {
  113. commonHelper.acceptAlert();
  114. browser.get(signInData.link);
  115. });
  116.  
  117. afterAll(function () {
  118. commonHelper.clearAllData();
  119. });
  120.  
  121. it('should redirect on dashboard page after login', function () {
  122. signInPage.login(username, password);
  123. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  124. });
  125.  
  126. it('should open products list page', function () {
  127. dashboardPage.openProductListPage();
  128. });
  129.  
  130. it('should open new product page', function () {
  131. productListPage.clickAddProduct();
  132. addProductPage.waitForPublishButton();
  133. });
  134.  
  135. it('should add new product', function () {
  136. addProductPage.selectType(product.type);
  137. addProductPage.selectFirstCollection();
  138. addProductPage.addTag(productTag);
  139. addProductPage.fillTitle(productTitle);
  140. addProductPage.fillPrice(product.price);
  141. addProductPage.clickPublish();
  142. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  143. });
  144.  
  145. it('should open new collection page', function () {
  146. dashboardPage.openAddCollectionPage();
  147. });
  148.  
  149. it('should fill title and description fields', function () {
  150. addCollectionPage.fillTitle(collectionTitle);
  151. addCollectionPage.fillDescription(firstCollectionDescription);
  152. });
  153.  
  154. it('should click auto add product radio button', function () {
  155. addCollectionPage.clickAddAuto();
  156. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  157. });
  158.  
  159. it('should add condition', function () {
  160. addCollectionPage.selectConditionVariant(0, 'Product tag');
  161. addCollectionPage.selectConditionRule(0, 'is exactly');
  162. addCollectionPage.fillConditionValue(0, productTag);
  163. });
  164.  
  165. it('should add new collection', function () {
  166. addCollectionPage.clickPublish();
  167. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  168. });
  169.  
  170. it('should show collection page after click on collection link', function () {
  171. collectionListPage.clickCollection(collectionTitle);
  172. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  173.  
  174. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  175. commonHelper.switchToPreviousTab();
  176. });
  177. });
  178.  
  179.  
  180. describe('auto-add product by product tag starts with', function () {
  181.  
  182. var unique_value = commonHelper.uniqueValue();
  183. var collectionTitle = firstCollectionTitle + unique_value;
  184. var productTitle = product.firstTitle + unique_value;
  185. var productTag = firstCollectionTitle + product.tag;
  186.  
  187. beforeAll(function () {
  188. commonHelper.acceptAlert();
  189. browser.get(signInData.link);
  190. });
  191.  
  192. afterAll(function () {
  193. commonHelper.clearAllData();
  194. });
  195.  
  196. it('should redirect on dashboard page after login', function () {
  197. signInPage.login(username, password);
  198. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  199. });
  200.  
  201. it('should open products list page', function () {
  202. dashboardPage.openProductListPage();
  203. });
  204.  
  205. it('should open new product page', function () {
  206. productListPage.clickAddProduct();
  207. addProductPage.waitForPublishButton();
  208. });
  209.  
  210. it('should add new product', function () {
  211. addProductPage.selectType(product.type);
  212. addProductPage.selectFirstCollection();
  213. addProductPage.addTag(productTag);
  214. addProductPage.fillTitle(productTitle);
  215. addProductPage.fillPrice(product.price);
  216. addProductPage.clickPublish();
  217. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  218. });
  219.  
  220. it('should open new collection page', function () {
  221. dashboardPage.openAddCollectionPage();
  222. });
  223.  
  224. it('should fill title and description fields', function () {
  225. addCollectionPage.fillTitle(collectionTitle);
  226. addCollectionPage.fillDescription(firstCollectionDescription);
  227. });
  228.  
  229. it('should click auto add product radio button', function () {
  230. addCollectionPage.clickAddAuto();
  231. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  232. });
  233.  
  234. it('should add condition', function () {
  235. addCollectionPage.selectConditionVariant(0, 'Product tag');
  236. addCollectionPage.selectConditionRule(0, 'starts with');
  237. addCollectionPage.fillConditionValue(0, firstCollectionTitle);
  238. });
  239.  
  240. it('should add new collection', function () {
  241. addCollectionPage.clickPublish();
  242. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  243. });
  244.  
  245. it('should show collection page after click on collection link', function () {
  246. collectionListPage.clickCollection(collectionTitle);
  247. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  248.  
  249. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  250. commonHelper.switchToPreviousTab();
  251. });
  252. });
  253.  
  254.  
  255. describe('auto-add product by product tag ends with', function () {
  256.  
  257. var unique_value = commonHelper.uniqueValue();
  258. var collectionTitle = firstCollectionTitle + unique_value;
  259. var productTitle = product.firstTitle + unique_value;
  260. var productTag = product.tag + unique_value;
  261.  
  262. beforeAll(function () {
  263. commonHelper.acceptAlert();
  264. browser.get(signInData.link);
  265. });
  266.  
  267. afterAll(function () {
  268. commonHelper.clearAllData();
  269. });
  270.  
  271. it('should redirect on dashboard page after login', function () {
  272. signInPage.login(username, password);
  273. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  274. });
  275.  
  276. it('should open products list page', function () {
  277. dashboardPage.openProductListPage();
  278. });
  279.  
  280. it('should open new product page', function () {
  281. productListPage.clickAddProduct();
  282. addProductPage.waitForPublishButton();
  283. });
  284.  
  285. it('should add new product', function () {
  286. addProductPage.selectType(product.type);
  287. addProductPage.selectFirstCollection();
  288. addProductPage.fillTitle(productTitle);
  289. addProductPage.fillPrice(product.price);
  290. addProductPage.addTag(productTag);
  291. addProductPage.clickPublish();
  292. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  293. });
  294.  
  295. it('should open new collection page', function () {
  296. dashboardPage.openAddCollectionPage();
  297. });
  298.  
  299. it('should fill title and description fields', function () {
  300. addCollectionPage.fillTitle(collectionTitle);
  301. addCollectionPage.fillDescription(firstCollectionDescription);
  302. });
  303.  
  304. it('should click auto add product radio button', function () {
  305. addCollectionPage.clickAddAuto();
  306. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  307. });
  308.  
  309. it('should add condition', function () {
  310. addCollectionPage.selectConditionVariant(0, 'Product tag');
  311. addCollectionPage.selectConditionRule(0, 'ends with');
  312. addCollectionPage.fillConditionValue(0, unique_value);
  313. });
  314.  
  315. it('should add new collection', function () {
  316. addCollectionPage.clickPublish();
  317. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  318. });
  319.  
  320. it('should show collection page after click on collection link', function () {
  321. collectionListPage.clickCollection(collectionTitle);
  322. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  323.  
  324. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  325. commonHelper.switchToPreviousTab();
  326. });
  327. });
  328.  
  329. describe('auto-add product by product vendor contains', function () {
  330.  
  331. var unique_value = commonHelper.uniqueValue();
  332. var collectionTitle = firstCollectionTitle + unique_value;
  333. var productTitle = product.firstTitle + unique_value;
  334. var productTag = product.type + unique_value + 'contains';
  335.  
  336. beforeAll(function () {
  337. commonHelper.acceptAlert();
  338. browser.get(signInData.link);
  339. });
  340.  
  341. afterAll(function () {
  342. commonHelper.clearAllData();
  343. });
  344.  
  345. it('should redirect on dashboard page after login', function () {
  346. signInPage.login(username, password);
  347. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  348. });
  349.  
  350. it('should open products list page', function () {
  351. dashboardPage.openProductListPage();
  352. });
  353.  
  354. it('should open new product page', function () {
  355. productListPage.clickAddProduct();
  356. addProductPage.waitForPublishButton();
  357. });
  358.  
  359. it('should add new product', function () {
  360. addProductPage.selectType(product.type);
  361. addProductPage.selectFirstCollection();
  362. addProductPage.fillTitle(productTitle);
  363. addProductPage.fillPrice(product.price);
  364. addProductPage.addTag(productTag);
  365. addProductPage.clickPublish();
  366. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  367. });
  368.  
  369. it('should open new collection page', function () {
  370. dashboardPage.openAddCollectionPage();
  371. });
  372.  
  373. it('should fill title and description fields', function () {
  374. addCollectionPage.fillTitle(collectionTitle);
  375. addCollectionPage.fillDescription(firstCollectionDescription);
  376. });
  377.  
  378. it('should click auto add product radio button', function () {
  379. addCollectionPage.clickAddAuto();
  380. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  381. });
  382.  
  383. it('should add condition', function () {
  384. addCollectionPage.selectConditionVariant(0, 'Product tag');
  385. addCollectionPage.selectConditionRule(0, 'contains');
  386. addCollectionPage.fillConditionValue(0, unique_value);
  387. });
  388.  
  389. it('should add new collection', function () {
  390. addCollectionPage.clickPublish();
  391. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  392. });
  393.  
  394. it('should show collection page after click on collection link', function () {
  395. collectionListPage.clickCollection(collectionTitle);
  396. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  397.  
  398. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  399. commonHelper.switchToPreviousTab();
  400. });
  401. });
  402.  
  403. });
  404.  
  405. ____________________________________________________________________________________________
  406. by_vendor.spec.js
  407.  
  408. var pageObject = require('./../../../../../../services/pages').container.PageObject;
  409. var signInPage = pageObject.getSignInPage();
  410. var dashboardPage = pageObject.getDashboardPage();
  411. var addCollectionPage = pageObject.getAddCollectionPage();
  412. var collectionListPage = pageObject.getCollectionListPage();
  413. var collectionsPage = pageObject.getCollectionsPage();
  414. var addProductPage = pageObject.getAddProductPage();
  415. var productListPage = pageObject.getProductListPage();
  416. var signInData = require('./../../../../../../data/admin/sign_in/index');
  417. var collectionData = require('./../../../../../../data/admin/collection/index');
  418. var productData = require('./../../../../../../data/admin/product/index');
  419. var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
  420.  
  421. describe('Add Collection - Auto Adding - By Price', function () {
  422.  
  423. var username = signInData.adminAccount.username;
  424. var password = signInData.adminAccount.password;
  425. var firstCollectionTitle = commonHelper.uniqueProductName('weight1');
  426. var firstCollectionDescription = collectionData.collection.description.first;
  427.  
  428. var product = {
  429. firstTitle: commonHelper.uniqueProductName('weight2'),
  430. type: productData.product.type,
  431. firstWeight: productData.product.weight,
  432. secondWeight: '3',
  433. thirdWeight: '4',
  434. fourthWeight: '5',
  435. firstPrice: productData.product.price
  436. };
  437.  
  438. describe('auto-add product by product weight is equal', function () {
  439.  
  440. var unique_value = commonHelper.uniqueValue();
  441. var collectionTitle = firstCollectionTitle + unique_value;
  442. var productTitle = product.firstTitle + unique_value;
  443.  
  444. beforeAll(function () {
  445. commonHelper.acceptAlert();
  446. browser.get(signInData.link);
  447. });
  448.  
  449. afterAll(function () {
  450. commonHelper.clearAllData();
  451. });
  452.  
  453. it('should redirect on dashboard page after login', function () {
  454. signInPage.login(username, password);
  455. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  456. });
  457.  
  458. it('should open products list page', function () {
  459. dashboardPage.openProductListPage();
  460. });
  461.  
  462. it('should open new product page', function () {
  463. productListPage.clickAddProduct();
  464. addProductPage.waitForPublishButton();
  465. });
  466.  
  467. it('should add new product', function () {
  468. addProductPage.selectType(product.type);
  469. addProductPage.selectFirstCollection();
  470. addProductPage.fillTitle(productTitle);
  471. addProductPage.fillPrice(product.firstPrice);
  472. addProductPage.fillShippingWeight(product.firstWeight);
  473. addProductPage.clickPublish();
  474. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  475. });
  476.  
  477. it('should open new collection page', function () {
  478. dashboardPage.openAddCollectionPage();
  479. });
  480.  
  481. it('should fill title and description fields', function () {
  482. addCollectionPage.fillTitle(collectionTitle);
  483. addCollectionPage.fillDescription(firstCollectionDescription);
  484. });
  485.  
  486. it('should click auto add product radio button', function () {
  487. addCollectionPage.clickAddAuto();
  488. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  489. });
  490.  
  491. it('should add condition', function () {
  492. addCollectionPage.selectConditionVariant(0, 'Weight');
  493. addCollectionPage.selectConditionRule(0, 'is equal to');
  494. addCollectionPage.fillConditionValue(0, '2.00');
  495. });
  496.  
  497. it('should add new collection', function () {
  498. addCollectionPage.clickPublish();
  499. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  500. });
  501.  
  502. it('should show collection page after click on collection link', function () {
  503. collectionListPage.clickCollection(collectionTitle);
  504. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  505.  
  506. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  507. commonHelper.switchToPreviousTab();
  508. });
  509. });
  510.  
  511.  
  512. describe('auto-add product by product weight is not equal', function () {
  513.  
  514. var unique_value = commonHelper.uniqueValue();
  515. var collectionTitle = firstCollectionTitle + unique_value;
  516. var productTitle = product.firstTitle + unique_value;
  517.  
  518. beforeAll(function () {
  519. commonHelper.acceptAlert();
  520. browser.get(signInData.link);
  521. });
  522.  
  523. afterAll(function () {
  524. commonHelper.clearAllData();
  525. });
  526.  
  527. it('should redirect on dashboard page after login', function () {
  528. signInPage.login(username, password);
  529. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  530. });
  531.  
  532. it('should open products list page', function () {
  533. dashboardPage.openProductListPage();
  534. });
  535.  
  536. it('should open new product page', function () {
  537. productListPage.clickAddProduct();
  538. addProductPage.waitForPublishButton();
  539. });
  540.  
  541. it('should add new product', function () {
  542. addProductPage.selectType(product.type);
  543. addProductPage.selectFirstCollection();
  544. addProductPage.fillTitle(productTitle);
  545. addProductPage.fillPrice(product.firstPrice);
  546. addProductPage.fillShippingWeight(product.secondWeight);
  547. addProductPage.clickPublish();
  548. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  549. });
  550.  
  551. it('should open new collection page', function () {
  552. dashboardPage.openAddCollectionPage();
  553. });
  554.  
  555. it('should fill title and description fields', function () {
  556. addCollectionPage.fillTitle(collectionTitle);
  557. addCollectionPage.fillDescription(firstCollectionDescription);
  558. });
  559.  
  560. it('should click auto add product radio button', function () {
  561. addCollectionPage.clickAddAuto();
  562. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  563. });
  564.  
  565. it('should add condition', function () {
  566. addCollectionPage.selectConditionVariant(0, 'Weight');
  567. addCollectionPage.selectConditionRule(0, 'is not equal to');
  568. addCollectionPage.fillConditionValue(0, '4.00');
  569. });
  570.  
  571. it('should add new collection', function () {
  572. addCollectionPage.clickPublish();
  573. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  574. });
  575.  
  576. it('should show collection page after click on collection link', function () {
  577. collectionListPage.clickCollection(collectionTitle);
  578. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  579.  
  580. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  581. commonHelper.switchToPreviousTab();
  582. });
  583. });
  584.  
  585.  
  586. describe('auto-add product by product weight is greater then', function () {
  587.  
  588. var unique_value = commonHelper.uniqueValue();
  589. var collectionTitle = firstCollectionTitle + unique_value;
  590. var productTitle = product.firstTitle + unique_value;
  591.  
  592. beforeAll(function () {
  593. commonHelper.acceptAlert();
  594. browser.get(signInData.link);
  595. });
  596.  
  597. afterAll(function () {
  598. commonHelper.clearAllData();
  599. });
  600.  
  601. it('should redirect on dashboard page after login', function () {
  602. signInPage.login(username, password);
  603. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  604. });
  605.  
  606. it('should open products list page', function () {
  607. dashboardPage.openProductListPage();
  608. });
  609.  
  610. it('should open new product page', function () {
  611. productListPage.clickAddProduct();
  612. addProductPage.waitForPublishButton();
  613. });
  614.  
  615. it('should add new product', function () {
  616. addProductPage.selectType(product.type);
  617. addProductPage.selectFirstCollection();
  618. addProductPage.fillTitle(productTitle);
  619. addProductPage.fillPrice(product.firstPrice);
  620. addProductPage.fillShippingWeight(product.thirdWeight);
  621. addProductPage.clickPublish();
  622. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  623. });
  624.  
  625. it('should open new collection page', function () {
  626. dashboardPage.openAddCollectionPage();
  627. });
  628.  
  629. it('should fill title and description fields', function () {
  630. addCollectionPage.fillTitle(collectionTitle);
  631. addCollectionPage.fillDescription(firstCollectionDescription);
  632. });
  633.  
  634. it('should click auto add product radio button', function () {
  635. addCollectionPage.clickAddAuto();
  636. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  637. });
  638.  
  639. it('should add condition', function () {
  640. addCollectionPage.selectConditionVariant(0, 'Weight');
  641. addCollectionPage.selectConditionRule(0, 'is greater then');
  642. addCollectionPage.fillConditionValue(0, '3.00');
  643. });
  644.  
  645. it('should add new collection', function () {
  646. addCollectionPage.clickPublish();
  647. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  648. });
  649.  
  650. it('should show collection page after click on collection link', function () {
  651. collectionListPage.clickCollection(collectionTitle);
  652. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  653.  
  654. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  655. commonHelper.switchToPreviousTab();
  656. });
  657. });
  658.  
  659. describe('auto-add product by product weight is less then', function () {
  660.  
  661. var unique_value = commonHelper.uniqueValue();
  662. var collectionTitle = firstCollectionTitle + unique_value;
  663. var productTitle = product.firstTitle + unique_value;
  664.  
  665. beforeAll(function () {
  666. commonHelper.acceptAlert();
  667. browser.get(signInData.link);
  668. });
  669.  
  670. afterAll(function () {
  671. commonHelper.clearAllData();
  672. });
  673.  
  674. it('should redirect on dashboard page after login', function () {
  675. signInPage.login(username, password);
  676. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  677. });
  678.  
  679. it('should open products list page', function () {
  680. dashboardPage.openProductListPage();
  681. });
  682.  
  683. it('should open new product page', function () {
  684. productListPage.clickAddProduct();
  685. addProductPage.waitForPublishButton();
  686. });
  687.  
  688. it('should add new product', function () {
  689. addProductPage.selectType(product.type);
  690. addProductPage.selectFirstCollection();
  691. addProductPage.fillTitle(productTitle);
  692. addProductPage.fillPrice(product.firstPrice);
  693. addProductPage.fillShippingWeight(product.fourthWeight);
  694. addProductPage.clickPublish();
  695. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  696. });
  697.  
  698. it('should open new collection page', function () {
  699. dashboardPage.openAddCollectionPage();
  700. });
  701.  
  702. it('should fill title and description fields', function () {
  703. addCollectionPage.fillTitle(collectionTitle);
  704. addCollectionPage.fillDescription(firstCollectionDescription);
  705. });
  706.  
  707. it('should click auto add product radio button', function () {
  708. addCollectionPage.clickAddAuto();
  709. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  710. });
  711.  
  712. it('should add condition', function () {
  713. addCollectionPage.selectConditionVariant(0, 'Weight');
  714. addCollectionPage.selectConditionRule(0, 'is less then');
  715. addCollectionPage.fillConditionValue(0, '6.00');
  716. });
  717.  
  718. it('should add new collection', function () {
  719. addCollectionPage.clickPublish();
  720. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  721. });
  722.  
  723. it('should show collection page after click on collection link', function () {
  724. collectionListPage.clickCollection(collectionTitle);
  725. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  726.  
  727. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  728. commonHelper.switchToPreviousTab();
  729. });
  730. });
  731. });
  732. _______________________________________________________________
  733. by_weight.spec.js
  734.  
  735. var pageObject = require('./../../../../../../services/pages').container.PageObject;
  736. var signInPage = pageObject.getSignInPage();
  737. var dashboardPage = pageObject.getDashboardPage();
  738. var addCollectionPage = pageObject.getAddCollectionPage();
  739. var collectionListPage = pageObject.getCollectionListPage();
  740. var collectionsPage = pageObject.getCollectionsPage();
  741. var addProductPage = pageObject.getAddProductPage();
  742. var productListPage = pageObject.getProductListPage();
  743. var signInData = require('./../../../../../../data/admin/sign_in/index');
  744. var collectionData = require('./../../../../../../data/admin/collection/index');
  745. var productData = require('./../../../../../../data/admin/product/index');
  746. var commonHelper = require('./../../../../../../services/helpers/common.helper.js');
  747.  
  748. describe('Add Collection - Auto Adding - By Price', function () {
  749.  
  750. var username = signInData.adminAccount.username;
  751. var password = signInData.adminAccount.password;
  752. var firstCollectionTitle = commonHelper.uniqueProductName('weight1');
  753. var firstCollectionDescription = collectionData.collection.description.first;
  754.  
  755. var product = {
  756. firstTitle: commonHelper.uniqueProductName('weight2'),
  757. type: productData.product.type,
  758. firstWeight: productData.product.weight,
  759. secondWeight: '3',
  760. thirdWeight: '4',
  761. fourthWeight: '5',
  762. firstPrice: productData.product.price
  763. };
  764.  
  765. describe('auto-add product by product weight is equal', function () {
  766.  
  767. var unique_value = commonHelper.uniqueValue();
  768. var collectionTitle = firstCollectionTitle + unique_value;
  769. var productTitle = product.firstTitle + unique_value;
  770.  
  771. beforeAll(function () {
  772. commonHelper.acceptAlert();
  773. browser.get(signInData.link);
  774. });
  775.  
  776. afterAll(function () {
  777. commonHelper.clearAllData();
  778. });
  779.  
  780. it('should redirect on dashboard page after login', function () {
  781. signInPage.login(username, password);
  782. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  783. });
  784.  
  785. it('should open products list page', function () {
  786. dashboardPage.openProductListPage();
  787. });
  788.  
  789. it('should open new product page', function () {
  790. productListPage.clickAddProduct();
  791. addProductPage.waitForPublishButton();
  792. });
  793.  
  794. it('should add new product', function () {
  795. addProductPage.selectType(product.type);
  796. addProductPage.selectFirstCollection();
  797. addProductPage.fillTitle(productTitle);
  798. addProductPage.fillPrice(product.firstPrice);
  799. addProductPage.fillShippingWeight(product.firstWeight);
  800. addProductPage.clickPublish();
  801. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  802. });
  803.  
  804. it('should open new collection page', function () {
  805. dashboardPage.openAddCollectionPage();
  806. });
  807.  
  808. it('should fill title and description fields', function () {
  809. addCollectionPage.fillTitle(collectionTitle);
  810. addCollectionPage.fillDescription(firstCollectionDescription);
  811. });
  812.  
  813. it('should click auto add product radio button', function () {
  814. addCollectionPage.clickAddAuto();
  815. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  816. });
  817.  
  818. it('should add condition', function () {
  819. addCollectionPage.selectConditionVariant(0, 'Weight');
  820. addCollectionPage.selectConditionRule(0, 'is equal to');
  821. addCollectionPage.fillConditionValue(0, '2.00');
  822. });
  823.  
  824. it('should add new collection', function () {
  825. addCollectionPage.clickPublish();
  826. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  827. });
  828.  
  829. it('should show collection page after click on collection link', function () {
  830. collectionListPage.clickCollection(collectionTitle);
  831. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  832.  
  833. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  834. commonHelper.switchToPreviousTab();
  835. });
  836. });
  837.  
  838.  
  839. describe('auto-add product by product weight is not equal', function () {
  840.  
  841. var unique_value = commonHelper.uniqueValue();
  842. var collectionTitle = firstCollectionTitle + unique_value;
  843. var productTitle = product.firstTitle + unique_value;
  844.  
  845. beforeAll(function () {
  846. commonHelper.acceptAlert();
  847. browser.get(signInData.link);
  848. });
  849.  
  850. afterAll(function () {
  851. commonHelper.clearAllData();
  852. });
  853.  
  854. it('should redirect on dashboard page after login', function () {
  855. signInPage.login(username, password);
  856. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  857. });
  858.  
  859. it('should open products list page', function () {
  860. dashboardPage.openProductListPage();
  861. });
  862.  
  863. it('should open new product page', function () {
  864. productListPage.clickAddProduct();
  865. addProductPage.waitForPublishButton();
  866. });
  867.  
  868. it('should add new product', function () {
  869. addProductPage.selectType(product.type);
  870. addProductPage.selectFirstCollection();
  871. addProductPage.fillTitle(productTitle);
  872. addProductPage.fillPrice(product.firstPrice);
  873. addProductPage.fillShippingWeight(product.secondWeight);
  874. addProductPage.clickPublish();
  875. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  876. });
  877.  
  878. it('should open new collection page', function () {
  879. dashboardPage.openAddCollectionPage();
  880. });
  881.  
  882. it('should fill title and description fields', function () {
  883. addCollectionPage.fillTitle(collectionTitle);
  884. addCollectionPage.fillDescription(firstCollectionDescription);
  885. });
  886.  
  887. it('should click auto add product radio button', function () {
  888. addCollectionPage.clickAddAuto();
  889. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  890. });
  891.  
  892. it('should add condition', function () {
  893. addCollectionPage.selectConditionVariant(0, 'Weight');
  894. addCollectionPage.selectConditionRule(0, 'is not equal to');
  895. addCollectionPage.fillConditionValue(0, '4.00');
  896. });
  897.  
  898. it('should add new collection', function () {
  899. addCollectionPage.clickPublish();
  900. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  901. });
  902.  
  903. it('should show collection page after click on collection link', function () {
  904. collectionListPage.clickCollection(collectionTitle);
  905. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  906.  
  907. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  908. commonHelper.switchToPreviousTab();
  909. });
  910. });
  911.  
  912.  
  913. describe('auto-add product by product weight is greater then', function () {
  914.  
  915. var unique_value = commonHelper.uniqueValue();
  916. var collectionTitle = firstCollectionTitle + unique_value;
  917. var productTitle = product.firstTitle + unique_value;
  918.  
  919. beforeAll(function () {
  920. commonHelper.acceptAlert();
  921. browser.get(signInData.link);
  922. });
  923.  
  924. afterAll(function () {
  925. commonHelper.clearAllData();
  926. });
  927.  
  928. it('should redirect on dashboard page after login', function () {
  929. signInPage.login(username, password);
  930. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  931. });
  932.  
  933. it('should open products list page', function () {
  934. dashboardPage.openProductListPage();
  935. });
  936.  
  937. it('should open new product page', function () {
  938. productListPage.clickAddProduct();
  939. addProductPage.waitForPublishButton();
  940. });
  941.  
  942. it('should add new product', function () {
  943. addProductPage.selectType(product.type);
  944. addProductPage.selectFirstCollection();
  945. addProductPage.fillTitle(productTitle);
  946. addProductPage.fillPrice(product.firstPrice);
  947. addProductPage.fillShippingWeight(product.thirdWeight);
  948. addProductPage.clickPublish();
  949. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  950. });
  951.  
  952. it('should open new collection page', function () {
  953. dashboardPage.openAddCollectionPage();
  954. });
  955.  
  956. it('should fill title and description fields', function () {
  957. addCollectionPage.fillTitle(collectionTitle);
  958. addCollectionPage.fillDescription(firstCollectionDescription);
  959. });
  960.  
  961. it('should click auto add product radio button', function () {
  962. addCollectionPage.clickAddAuto();
  963. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  964. });
  965.  
  966. it('should add condition', function () {
  967. addCollectionPage.selectConditionVariant(0, 'Weight');
  968. addCollectionPage.selectConditionRule(0, 'is greater then');
  969. addCollectionPage.fillConditionValue(0, '3.00');
  970. });
  971.  
  972. it('should add new collection', function () {
  973. addCollectionPage.clickPublish();
  974. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  975. });
  976.  
  977. it('should show collection page after click on collection link', function () {
  978. collectionListPage.clickCollection(collectionTitle);
  979. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  980.  
  981. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  982. commonHelper.switchToPreviousTab();
  983. });
  984. });
  985.  
  986. describe('auto-add product by product weight is less then', function () {
  987.  
  988. var unique_value = commonHelper.uniqueValue();
  989. var collectionTitle = firstCollectionTitle + unique_value;
  990. var productTitle = product.firstTitle + unique_value;
  991.  
  992. beforeAll(function () {
  993. commonHelper.acceptAlert();
  994. browser.get(signInData.link);
  995. });
  996.  
  997. afterAll(function () {
  998. commonHelper.clearAllData();
  999. });
  1000.  
  1001. it('should redirect on dashboard page after login', function () {
  1002. signInPage.login(username, password);
  1003. commonHelper.waitUntilElementPresent(dashboardPage.txtSearch);
  1004. });
  1005.  
  1006. it('should open products list page', function () {
  1007. dashboardPage.openProductListPage();
  1008. });
  1009.  
  1010. it('should open new product page', function () {
  1011. productListPage.clickAddProduct();
  1012. addProductPage.waitForPublishButton();
  1013. });
  1014.  
  1015. it('should add new product', function () {
  1016. addProductPage.selectType(product.type);
  1017. addProductPage.selectFirstCollection();
  1018. addProductPage.fillTitle(productTitle);
  1019. addProductPage.fillPrice(product.firstPrice);
  1020. addProductPage.fillShippingWeight(product.fourthWeight);
  1021. addProductPage.clickPublish();
  1022. commonHelper.waitUntilElementVisible(productListPage.productEntry(productTitle));
  1023. });
  1024.  
  1025. it('should open new collection page', function () {
  1026. dashboardPage.openAddCollectionPage();
  1027. });
  1028.  
  1029. it('should fill title and description fields', function () {
  1030. addCollectionPage.fillTitle(collectionTitle);
  1031. addCollectionPage.fillDescription(firstCollectionDescription);
  1032. });
  1033.  
  1034. it('should click auto add product radio button', function () {
  1035. addCollectionPage.clickAddAuto();
  1036. commonHelper.waitUntilElementVisible(addCollectionPage.sel2Type);
  1037. });
  1038.  
  1039. it('should add condition', function () {
  1040. addCollectionPage.selectConditionVariant(0, 'Weight');
  1041. addCollectionPage.selectConditionRule(0, 'is less then');
  1042. addCollectionPage.fillConditionValue(0, '6.00');
  1043. });
  1044.  
  1045. it('should add new collection', function () {
  1046. addCollectionPage.clickPublish();
  1047. commonHelper.waitUntilElementVisible(collectionListPage.collectionEntry(collectionTitle));
  1048. });
  1049.  
  1050. it('should show collection page after click on collection link', function () {
  1051. collectionListPage.clickCollection(collectionTitle);
  1052. commonHelper.waitUntilElementVisible(collectionsPage.txtTitle);
  1053.  
  1054. expect(collectionsPage.productTitle(productTitle).isDisplayed()).toBeTruthy();
  1055. commonHelper.switchToPreviousTab();
  1056. });
  1057. });
  1058. });
Add Comment
Please, Sign In to add comment