Advertisement
Guest User

update

a guest
Dec 6th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.61 KB | None | 0 0
  1. contacts.po
  2.  
  3. 'use strict';
  4.  
  5. const pageObject = require('./../../services').container.PageObject;
  6. const signInPage = pageObject.getSignInPage();
  7. const dashboardPage = pageObject.getDashboardPage();
  8. const addContactsPage = pageObject.getAddContactPage();
  9. const contactsPage = pageObject.getContactsPage();
  10. const jobCodePage = pageObject.getJobCodePage();
  11. const signInData = require('./../../data/sign_in');
  12. const dashboardData = require('./../../data/dashboard');
  13. const commonHelper = require('./../../services/helpers/common.helper');
  14. var strftime = require('strftime');
  15.  
  16. describe('Contacts', () => {
  17.  
  18. var username = signInData.adminAccount.username;
  19. var password = signInData.adminAccount.password;
  20.  
  21. beforeAll(() => {
  22. browser.ignoreSynchronization = false;
  23. browser.driver.manage().window().setSize(1440, 900);
  24. });
  25.  
  26. afterAll(() => {
  27. commonHelper.clearAllData();
  28. });
  29.  
  30. describe('checking for add contacts from menu', () => {
  31.  
  32. var time = commonHelper.uniqueValue();
  33.  
  34. beforeAll(() => {
  35. browser.get(signInData.link);
  36. });
  37.  
  38. afterAll(() => {
  39. commonHelper.clearAllData();
  40. });
  41.  
  42. it('should redirect on dashboard page after login', () => {
  43. signInPage.login(username, password);
  44. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  45.  
  46. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  47. });
  48.  
  49. it('should click on contacts from menu', () => {
  50. dashboardPage.openMenu('Contacts');
  51.  
  52. expect(dashboardPage.pageTitle()).toEqual('Contacts');
  53. });
  54.  
  55. it('should click on add contacts', () => {
  56. contactsPage.clickAddContact();
  57. commonHelper.waitUntilElementVisible(addContactsPage.txtContactName);
  58. });
  59.  
  60. it('should add contacts', () => {
  61. addContactsPage.fillContactName('Gabe' + time);
  62. addContactsPage.fillContactLastName('Malcovich'+ time);
  63. addContactsPage.fillContactTitle('QA' + time);
  64. addContactsPage.selectContactCompany('Chevron');
  65. addContactsPage.selectContactOffices('Chevron Corporate Offices');
  66. addContactsPage.fillContactNumber(time);
  67. addContactsPage.fillContactEmail(time + '@mailinator.com');
  68. });
  69.  
  70. it('should save contacts', () => {
  71. addContactsPage.saveCompany();
  72. });
  73.  
  74. it('should search contacts', () => {
  75. contactsPage.fillSearchContact(time);
  76. contactsPage.waitForContact(time);
  77. });
  78.  
  79. it('should see contacts details',()=>{
  80. jobCodePage.clickDetails();
  81.  
  82. expect(contactsPage.getTable('QA' + time));
  83. expect(addContactsPage.getTable(time + '@mailinator.com'));
  84. expect(addContactsPage.getTable(time));
  85. expect(contactsPage.getTable('Gabe' + time + ' Malcovich' + time));
  86. });
  87. });
  88.  
  89. describe('checking for add office', () => {
  90.  
  91. var time = commonHelper.uniqueValue();
  92.  
  93. beforeAll(() => {
  94. browser.get(signInData.link);
  95. });
  96.  
  97. afterAll(() => {
  98. commonHelper.clearAllData();
  99. });
  100.  
  101. it('should redirect on dashboard page after login', () => {
  102. signInPage.login(username, password);
  103. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  104.  
  105. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  106. });
  107.  
  108. it('should click on contacts from menu', () => {
  109. dashboardPage.openMenu('Contacts');
  110.  
  111. expect(dashboardPage.pageTitle()).toEqual('Contacts');
  112. });
  113.  
  114. it('should click on companies tab', () => {
  115. contactsPage.clickCompaniesTab();
  116. commonHelper.waitUntilElementVisible(contactsPage.btnAddOffice);
  117. });
  118.  
  119. it('should click on add office', () => {
  120. contactsPage.clickAddOffice();
  121. commonHelper.waitUntilElementVisible(contactsPage.txtOfficeName);
  122. });
  123.  
  124. it('should add office', () => {
  125. contactsPage.selectContactOffices('Chevron');
  126. contactsPage.fillOfficeName('Batcave' + time);
  127. contactsPage.selectRegion('Roosevelt');
  128. contactsPage.fillOfficePhone(time);
  129. contactsPage.fillOfficeAttn('Inc.' + time);
  130. contactsPage.fillOfficeLine1(time);
  131. contactsPage.fillOfficeLine2(time);
  132. contactsPage.fillOfficeCity('Lyon' + time);
  133. contactsPage.fillOfficeState('Minnesota' + time);
  134. contactsPage.fillOfficeZip(time);
  135. contactsPage.fillOfficeCountry('Country' + time);
  136. contactsPage.clickSave();
  137. });
  138.  
  139. it('should search office', () => {
  140. contactsPage.fillSearchCompany('Chevron');
  141. contactsPage.waitForContact('Batcave' + time);
  142. });
  143. });
  144.  
  145. describe('checking for cancel adding contacts from menu', () => {
  146.  
  147. var time = commonHelper.uniqueValue();
  148.  
  149. beforeAll(() => {
  150. browser.get(signInData.link);
  151. });
  152.  
  153. afterAll(() => {
  154. commonHelper.clearAllData();
  155. });
  156.  
  157. it('should redirect on dashboard page after login', () => {
  158. signInPage.login(username, password);
  159. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  160.  
  161. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  162. });
  163.  
  164. it('should click on contacts from menu', () => {
  165. dashboardPage.openMenu('Contacts');
  166.  
  167. expect(dashboardPage.pageTitle()).toEqual('Contacts');
  168. });
  169.  
  170. it('should click on add contacts', () => {
  171. contactsPage.clickAddContact();
  172. commonHelper.waitUntilElementVisible(addContactsPage.txtContactName);
  173. });
  174.  
  175. it('should add contacts', () => {
  176. addContactsPage.fillContactName('Gabe' + time);
  177. addContactsPage.fillContactLastName('Malcovich'+ time);
  178. addContactsPage.fillContactTitle('QA' + time);
  179. addContactsPage.selectContactCompany('Chevron');
  180. addContactsPage.selectContactOffices('Chevron Corporate Offices');
  181. addContactsPage.fillContactNumber(time + time);
  182. addContactsPage.fillContactEmail(time + '@mailinator.com');
  183. });
  184.  
  185. it('should cancel contacts', () => {
  186. addContactsPage.cancelContacts();
  187. });
  188.  
  189. it('should search contacts', () => {
  190. contactsPage.fillSearchContact(time + time);
  191. expect(jobCodePage.searchCode(time + time).isPresent()).toBe(false);
  192. });
  193. });
  194.  
  195. describe('checking for cancel adding office', () => {
  196.  
  197. var time = commonHelper.uniqueValue();
  198.  
  199. beforeAll(() => {
  200. browser.get(signInData.link);
  201. });
  202.  
  203. afterAll(() => {
  204. commonHelper.clearAllData();
  205. });
  206.  
  207. it('should redirect on dashboard page after login', () => {
  208. signInPage.login(username, password);
  209. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  210.  
  211. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  212. });
  213.  
  214. it('should click on contacts from menu', () => {
  215. dashboardPage.openMenu('Contacts');
  216.  
  217. expect(dashboardPage.pageTitle()).toEqual('Contacts');
  218. });
  219.  
  220. it('should click on companies tab', () => {
  221. contactsPage.clickCompaniesTab();
  222. commonHelper.waitUntilElementVisible(contactsPage.btnAddOffice);
  223. });
  224.  
  225. it('should click on add office', () => {
  226. contactsPage.clickAddOffice();
  227. commonHelper.waitUntilElementVisible(contactsPage.txtOfficeName);
  228. });
  229.  
  230. it('should cancel adding office', () => {
  231. contactsPage.selectContactOffices('Chevron');
  232. contactsPage.fillOfficeName('Wave' + time);
  233. contactsPage.selectRegion('Roosevelt');
  234. contactsPage.fillOfficePhone(time);
  235. contactsPage.fillOfficeAttn('Inc.' + time);
  236. contactsPage.fillOfficeLine1(time);
  237. contactsPage.fillOfficeLine2(time);
  238. contactsPage.fillOfficeCity('Lyon' + time);
  239. contactsPage.fillOfficeState('Minnesota' + time);
  240. contactsPage.fillOfficeZip(time);
  241. contactsPage.fillOfficeCountry('Country' + time);
  242.  
  243. contactsPage.clickCancel();
  244. });
  245.  
  246. it('should search office', () => {
  247. contactsPage.fillSearchCompany('Chevron');
  248.  
  249. expect(jobCodePage.searchCode('Wave' + time).isPresent()).toBe(false);
  250. });
  251. });
  252. });
  253. --------------------------------------------
  254. job_code.po
  255.  
  256. changeStatus(status, changedStatus){
  257. element(by.xpath('//*[text()="Service Ticket: #' + status.trim() + '" ]/ancestor::div[@class="layout-margin-sm layout-fill md-whiteframe-1dp"]//md-select')).click();
  258. browser.sleep(500);
  259. element(by.xpath('//*[contains(@class, "md-active")]//div[contains(.,"' + changedStatus + '")]')).click();
  260. }
  261. ------------------------------------------------------------------
  262. manage_users.spec
  263.  
  264. 'use strict';
  265.  
  266. const pageObject = require('./../../services').container.PageObject;
  267. const signInPage = pageObject.getSignInPage();
  268. const dashboardPage = pageObject.getDashboardPage();
  269. const profilePage = pageObject.getProfilePage();
  270. const addUserPage = pageObject.getAddUserPage();
  271. const addCompanyPage = pageObject.getAddCompanyPage();
  272. const addContactsPage = pageObject.getAddContactPage();
  273. const jobCodePage = pageObject.getJobCodePage();
  274. const signInData = require('./../../data/sign_in');
  275. const dashboardData = require('./../../data/dashboard');
  276. const profileData = require('./../../data/profile');
  277. const commonHelper = require('./../../services/helpers/common.helper');
  278.  
  279. describe('Manage users', () => {
  280.  
  281. var username = signInData.adminAccount.username;
  282. var password = signInData.adminAccount.password;
  283. var dashboardTitle = dashboardData.title;
  284.  
  285. var firstName = profileData.profile.firstName;
  286. var lastName = profileData.profile.lastName;
  287. var title = profileData.profile.title;
  288. var email = profileData.profile.email;
  289. var phoneNumber = profileData.profile.phoneNumber;
  290. var usernameManager = profileData.profile.username;
  291. var passwordManager = profileData.profile.password;
  292.  
  293. var editFirstName = profileData.editProfile.firstName;
  294. var editLastName = profileData.editProfile.lastName;
  295. var editTitle = profileData.editProfile.title;
  296. var editEmail = profileData.editProfile.email;
  297. var editPhoneNumber = profileData.editProfile.phoneNumber;
  298. var editUsername = profileData.editProfile.username;
  299.  
  300. beforeAll(() => {
  301. browser.ignoreSynchronization = false;
  302. browser.driver.manage().window().setSize(1440, 900);
  303. });
  304.  
  305. afterAll(() => {
  306. commonHelper.clearAllData();
  307. });
  308. describe('checking add user', () => {
  309.  
  310. var time = commonHelper.uniqueValue();
  311.  
  312. beforeAll(() => {
  313. browser.get(signInData.link);
  314. });
  315.  
  316. afterAll(() => {
  317. commonHelper.clearAllData();
  318. });
  319.  
  320. it('should open login page', () => {
  321. expect(signInPage.btnLogin.isDisplayed()).toBe(true);
  322. });
  323.  
  324. it('should redirect on dashboard page after login', () => {
  325. signInPage.login(username, password);
  326. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  327.  
  328. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  329. });
  330.  
  331. it('should click on manage users', () => {
  332. dashboardPage.clickUser();
  333.  
  334. commonHelper.waitUntilElementVisible(dashboardPage.btnManageUser);
  335. dashboardPage.clickManageUsers();
  336.  
  337. expect(dashboardPage.pageTitle()).toEqual('Users');
  338. });
  339.  
  340. it('should click on add user', () => {
  341. profilePage.clickAddUser();
  342.  
  343. commonHelper.waitUntilElementVisible(addUserPage.txtFirstName);
  344. });
  345.  
  346. it('should add user', () => {
  347. addUserPage.fillFirstName(firstName + time);
  348. addUserPage.fillLastName(lastName + time);
  349. addUserPage.fillTitle(title + time);
  350. addUserPage.fillEmail(time + email);
  351. addUserPage.fillPhoneNumber(phoneNumber);
  352. addUserPage.fillUsername(usernameManager + time.trim());
  353. addUserPage.fillPassword(passwordManager);
  354. addUserPage.fillPasswordConfirm(passwordManager);
  355. });
  356.  
  357. it('should save user',() => {
  358. addCompanyPage.clickSave();
  359.  
  360. expect(dashboardPage.pageTitle()).toEqual('Users');
  361. });
  362.  
  363. it('should logout', () => {
  364. dashboardPage.clickUser();
  365. dashboardPage.clickLogout();
  366.  
  367. commonHelper.waitUntilElementVisible(signInPage.btnLogin);
  368. });
  369.  
  370. it('should login as new user', () => {
  371. signInPage.login(usernameManager + time.trim(), passwordManager);
  372. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  373.  
  374. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  375. });
  376.  
  377. it('should logout', () => {
  378. dashboardPage.clickUser();
  379. dashboardPage.clickLogout();
  380.  
  381. commonHelper.waitUntilElementVisible(signInPage.btnLogin);
  382. });
  383.  
  384. it('should redirect on dashboard page after login', () => {
  385. signInPage.login(username, password);
  386. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  387.  
  388. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  389. });
  390.  
  391. it('should click on manage users', () => {
  392. dashboardPage.clickUser();
  393.  
  394. commonHelper.waitUntilElementVisible(dashboardPage.btnManageUser);
  395. dashboardPage.clickManageUsers();
  396.  
  397. expect(dashboardPage.pageTitle()).toEqual('Users');
  398. });
  399.  
  400. it('should click edit user', () => {
  401. addContactsPage.fillSearchContacts(time);
  402. jobCodePage.clickDetails();
  403.  
  404. commonHelper.waitUntilElementVisible(addUserPage.txtFirstName);
  405. });
  406.  
  407. it('should edit user', () => {
  408. addUserPage.fillFirstName(editFirstName + time);
  409. addUserPage.fillLastName(editLastName + time);
  410. addUserPage.fillTitle(editTitle + time);
  411. addUserPage.fillEmail(time + editEmail);
  412. addUserPage.fillPhoneNumber(editPhoneNumber);
  413. addUserPage.fillUsername(editUsername + time.trim());
  414. addUserPage.fillPassword(password);
  415. addUserPage.fillPasswordConfirm(password);
  416. });
  417.  
  418. it('should save edited user',() => {
  419. addCompanyPage.clickSave();
  420.  
  421. expect(dashboardPage.pageTitle()).toEqual('Users');
  422. });
  423.  
  424. it('should logout', () => {
  425. dashboardPage.clickUser();
  426. dashboardPage.clickLogout();
  427.  
  428. commonHelper.waitUntilElementVisible(signInPage.btnLogin);
  429. });
  430.  
  431. it('should login as edited user', () => {
  432. signInPage.login(editUsername + time.trim(), password);
  433. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  434.  
  435. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  436. });
  437. });
  438. });
  439. --------------------------------------------------
  440. service_ticket.spec
  441.  
  442. 'use strict';
  443.  
  444. const pageObject = require('./../../../services/index').container.PageObject;
  445. const signInPage = pageObject.getSignInPage();
  446. const dashboardPage = pageObject.getDashboardPage();
  447. const editTicketPage = pageObject.getEditTicketPage();
  448. const ticketsPage = pageObject.getTicketsPage();
  449. const signInData = require('./../../../data/sign_in/index');
  450. const dashboardData = require('./../../../data/dashboard/index');
  451. const ticketsData = require('./../../../data/tickets/index');
  452. const commonHelper = require('./../../../services/helpers/common.helper.js');
  453. var strftime = require('strftime');
  454.  
  455. describe('Service Ticket', () => {
  456.  
  457. var loginLink = signInData.link;
  458. var username = signInData.adminAccount.username;
  459. var password = signInData.adminAccount.password;
  460. var afe = ticketsData.ticket.afe;
  461. var jobCode = ticketsData.ticket.jobCode;
  462.  
  463. beforeAll(() => {
  464. browser.ignoreSynchronization = false;
  465. browser.driver.manage().window().setSize(1440, 900);
  466. });
  467.  
  468. afterAll(() => {
  469. commonHelper.clearAllData();
  470. });
  471.  
  472. describe('checking for add hourly line item in ticket', () => {
  473.  
  474. var time = commonHelper.uniqueValue();
  475.  
  476. beforeAll(() => {
  477. browser.get(loginLink);
  478. });
  479.  
  480. afterAll(() => {
  481. commonHelper.clearAllData();
  482. });
  483.  
  484. it('should redirect on dashboard page after login', () => {
  485. signInPage.login(username, password);
  486. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  487.  
  488. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  489. });
  490.  
  491. it('should click on plus button and select service ticket', () => {
  492. dashboardPage.selectItem('Service Ticket');
  493.  
  494. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  495. });
  496.  
  497. it('should save ticket header', () => {
  498. editTicketPage.fillLocation('Location' + time);
  499. editTicketPage.fillAfe(afe);
  500. editTicketPage.fillJobCode(jobCode);
  501. editTicketPage.clickSave();
  502.  
  503. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  504. });
  505.  
  506. it('should add line item and see hourly form', () => {
  507. editTicketPage.clickNewLine();
  508. editTicketPage.selectCategory('Hourly');
  509. editTicketPage.selectSubCategory('All');
  510. editTicketPage.clickSaveClose();
  511.  
  512. expect(editTicketPage.tittle.getText()).toEqual('Hourly');
  513. });
  514.  
  515. it('should edit new line', () => {
  516. editTicketPage.clickEditLine();
  517. });
  518.  
  519. it('should set note', () => {
  520. editTicketPage.fillLineNote(time);
  521. });
  522.  
  523. it('should set rate and hours', () => {
  524. editTicketPage.fillRate('10');
  525. editTicketPage.fillHours('20');
  526. });
  527.  
  528. it('should see total updates', () => {
  529. expect(editTicketPage.getTotal()).toEqual('200.00');
  530. });
  531.  
  532. it('should set discount', () => {
  533. editTicketPage.fillDiscount('5');
  534. });
  535.  
  536. it('should see total updates', () => {
  537. expect(editTicketPage.getTotal()).toEqual('190.00');
  538. });
  539.  
  540. it('should see minimum', () => {
  541. editTicketPage.fillMinimum('100');
  542. editTicketPage.clickLineNote();
  543. });
  544.  
  545. it('should see total updates', () => {
  546. expect(editTicketPage.getTotal()).toEqual('190.00');
  547. });
  548.  
  549. it('should save line', () => {
  550. editTicketPage.clickSaveClose();
  551. });
  552.  
  553. it('should display saved line in Hourly table', () => {
  554. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
  555. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
  556. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
  557. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
  558. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note:' + time);
  559. });
  560.  
  561. /*it('should save ticket', () => {
  562. editTicketPage.clickSave();
  563. dashboardPage.openMenu('Tickets');
  564. });
  565.  
  566. it('should search ticket', ()=> {
  567. ticketsPage.selectSearchType('Location');
  568. ticketsPage.searchTicket('Location' + time);
  569. ticketsPage.clickDetails();
  570. });
  571.  
  572. it('should edit new line', () => {
  573. editTicketPage.clickEditLine();
  574. });
  575.  
  576. it('should edit note', () => {
  577. editTicketPage.fillLineNote(time + time);
  578. });
  579.  
  580. it('should edit rate and hours', () => {
  581. editTicketPage.fillRate('20');
  582. editTicketPage.fillHours('30');
  583. });
  584.  
  585. it('should see edited total updates', () => {
  586. expect(editTicketPage.getTotal()).toEqual('570.00');
  587. });
  588.  
  589. it('should edit discount', () => {
  590. editTicketPage.fillDiscount('6');
  591. });
  592.  
  593. it('should see edited total updates', () => {
  594. expect(editTicketPage.getTotal()).toEqual('564.00');
  595. });
  596.  
  597. it('should edit minimum', () => {
  598. editTicketPage.fillMinimum('150');
  599. editTicketPage.clickLineNote();
  600. });
  601.  
  602. it('should see edited total updates', () => {
  603. expect(editTicketPage.getTotal()).toEqual('564.00');
  604. });
  605.  
  606. it('should save line', () => {
  607. editTicketPage.clickSaveClose();
  608. });
  609.  
  610. it('should display edited line in Hourly table', () => {
  611. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$20.00/hr');
  612. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('30 Hours');
  613. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$150.00');
  614. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$564.00');
  615. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time + time);
  616. });*/
  617. });
  618.  
  619. describe('checking for add rental line item in ticket', () => {
  620.  
  621. var time = commonHelper.uniqueValue();
  622.  
  623. beforeAll(() => {
  624. browser.get(loginLink);
  625. });
  626.  
  627. afterAll(() => {
  628. commonHelper.clearAllData();
  629. });
  630.  
  631. it('should redirect on dashboard page after login', () => {
  632. signInPage.login(username, password);
  633. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  634.  
  635. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  636. });
  637.  
  638. it('should click on plus button and select service ticket', () => {
  639. dashboardPage.selectItem('Service Ticket');
  640.  
  641. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  642. });
  643.  
  644. it('should save ticket header', () => {
  645. editTicketPage.fillLocation('Location' + time);
  646. editTicketPage.fillAfe(afe);
  647. editTicketPage.fillJobCode(jobCode);
  648. editTicketPage.clickSave();
  649.  
  650. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  651. });
  652.  
  653. it('should add line item and see rental form', () => {
  654. editTicketPage.clickNewLine();
  655. editTicketPage.selectCategory('Rental');
  656. editTicketPage.selectSubCategory('All');
  657. editTicketPage.clickSaveClose();
  658.  
  659. expect(editTicketPage.tittle.getText()).toEqual('Rental');
  660. });
  661.  
  662. it('should edit new line', () => {
  663. editTicketPage.clickEditLine();
  664. });
  665.  
  666. it('should set note', () => {
  667. editTicketPage.fillLineNote(time);
  668. });
  669.  
  670. it('should set rate and hours', () => {
  671. editTicketPage.selectHour('Per day');
  672. editTicketPage.fillRate('10');
  673. editTicketPage.fillStandbyRate('10');
  674. editTicketPage.fillHours('20');
  675. editTicketPage.fillQuantity('30');
  676. editTicketPage.fillDaysStandby('40');
  677. });
  678.  
  679. it('should see total updates', () => {
  680. expect(editTicketPage.getTotal()).toEqual('700.00');
  681. });
  682.  
  683. it('should set discount', () => {
  684. editTicketPage.fillDiscount('5');
  685. });
  686.  
  687. it('should see total updates', () => {
  688. expect(editTicketPage.getTotal()).toEqual('665.00');
  689. });
  690.  
  691. it('should see minimum', () => {
  692. editTicketPage.fillMinimum('300');
  693. editTicketPage.clickLineNote();
  694. });
  695.  
  696. it('should see total updates', () => {
  697. expect(editTicketPage.getTotal()).toEqual('665.00');
  698. });
  699.  
  700. it('should save line', () => {
  701. editTicketPage.clickSaveClose();
  702. });
  703.  
  704. it('should display saved line in Rental table', () => {
  705. expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
  706. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
  707. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
  708. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
  709. expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
  710. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
  711. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note:' + time);
  712. });
  713.  
  714. /*it('should save ticket', () => {
  715. editTicketPage.clickSave();
  716. dashboardPage.openMenu('Tickets');
  717. });
  718.  
  719. it('should search ticket', () => {
  720. ticketsPage.selectSearchType('Location');
  721. ticketsPage.searchTicket('Location' + time);
  722. ticketsPage.clickDetails();
  723. });
  724.  
  725. it('should edit new line', () => {
  726. editTicketPage.clickEditLine();
  727. });
  728.  
  729. it('should set note', () => {
  730. editTicketPage.fillLineNote(time + time);
  731. });
  732.  
  733. it('should edit rate and hours', () => {
  734. editTicketPage.selectHour('Per day');
  735. editTicketPage.fillRate('20');
  736. editTicketPage.fillStandbyRate('20');
  737. editTicketPage.fillHours('30');
  738. editTicketPage.fillQuantity('40');
  739. editTicketPage.fillDaysStandby('50');
  740. });
  741.  
  742. it('should see edited total updates', () => {
  743. expect(editTicketPage.getTotal()).toEqual('1710.00');
  744. });
  745.  
  746. it('should edit discount', () => {
  747. editTicketPage.fillDiscount('6');
  748. });
  749.  
  750. it('should see edited total updates', () => {
  751. expect(editTicketPage.getTotal()).toEqual('1692.00');
  752. });
  753.  
  754. it('should edit minimum', () => {
  755. editTicketPage.fillMinimum('400');
  756. editTicketPage.clickLineNote();
  757. });
  758.  
  759. it('should see edited total updates', () => {
  760. expect(editTicketPage.getTotal()).toEqual('1692.00');
  761. });
  762.  
  763. it('should save line', () => {
  764. editTicketPage.clickSaveClose();
  765. });
  766.  
  767. it('should display saved line in Rental table', () => {
  768. expect(editTicketPage.getRate('Rental', '1')).toEqual('$20.00/day');
  769. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$20.00/day');
  770. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('50 Days');
  771. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('30 Days');
  772. expect(editTicketPage.getMin('Rental', '1')).toEqual('$400.00');
  773. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$1,692.00');
  774. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time + time);
  775. });*/
  776. });
  777.  
  778. describe('checking for add service line item in ticket', () => {
  779.  
  780. var time = commonHelper.uniqueValue();
  781.  
  782. var tomorrowDate = new Date();
  783. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  784.  
  785. beforeAll(() => {
  786. browser.get(loginLink);
  787. });
  788.  
  789. afterAll(() => {
  790. commonHelper.clearAllData();
  791. });
  792.  
  793. it('should redirect on dashboard page after login', () => {
  794. signInPage.login(username, password);
  795. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  796.  
  797. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  798. });
  799.  
  800. it('should click on plus button and select service ticket', () => {
  801. dashboardPage.selectItem('Service Ticket');
  802.  
  803. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  804. });
  805.  
  806. it('should save ticket header', () => {
  807. editTicketPage.fillLocation('Location' + time);
  808. editTicketPage.fillAfe(afe);
  809. editTicketPage.fillJobCode(jobCode);
  810. editTicketPage.clickSave();
  811.  
  812. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  813. });
  814.  
  815. it('should add line item and see service form', () => {
  816. editTicketPage.clickNewLine();
  817. editTicketPage.selectCategory('Service');
  818. editTicketPage.selectSubCategory('All');
  819. editTicketPage.clickSaveClose();
  820.  
  821. expect(editTicketPage.tittle.getText()).toEqual('Service');
  822. });
  823.  
  824. it('should edit new line', () => {
  825. editTicketPage.clickEditLine();
  826. });
  827.  
  828. it('should set note', () => {
  829. editTicketPage.fillLineNote(time);
  830. });
  831.  
  832. it('should select hour', () => {
  833. editTicketPage.selectHour('Each');
  834. });
  835.  
  836. it('should set start date',() => {
  837. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  838. editTicketPage.fillStartHour('10');
  839. editTicketPage.fillStartMinutes('15');
  840. });
  841.  
  842. it('should set end date',() => {
  843. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  844. editTicketPage.fillEndHour('10');
  845. editTicketPage.fillEndMinutes('30');
  846. });
  847.  
  848. it('should set rate and hours', () => {
  849. editTicketPage.fillQuantity('20');
  850. editTicketPage.fillRate('10');
  851. editTicketPage.fillHours('20');
  852. });
  853.  
  854. it('should see total updates', () => {
  855. expect(editTicketPage.getTotal()).toEqual('200.00');
  856. });
  857.  
  858. it('should set discount', () => {
  859. editTicketPage.fillDiscount('5');
  860. });
  861.  
  862. it('should see total updates', () => {
  863. expect(editTicketPage.getTotal()).toEqual('190.00');
  864. });
  865.  
  866. it('should see minimum', () => {
  867. editTicketPage.fillMinimum('100');
  868. editTicketPage.clickLineNote();
  869. });
  870.  
  871. it('should see total updates', () => {
  872. expect(editTicketPage.getTotal()).toEqual('190.00');
  873. });
  874.  
  875. it('should save line', () => {
  876. editTicketPage.clickSaveClose();
  877. });
  878.  
  879. it('should display saved line in service table', () => {
  880. expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
  881. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
  882. expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
  883. expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
  884. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
  885. expect(editTicketPage.getNote('Service', '1')).toEqual('Note:' + time);
  886. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b%e, %Y ', tomorrowDate) + '10:15:00 AM');
  887. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b%e, %Y ', tomorrowDate) + '10:30:00 AM');
  888. });
  889.  
  890. /*it('should save ticket', () => {
  891. editTicketPage.clickSave();
  892. dashboardPage.openMenu('Tickets');
  893. });
  894.  
  895. it('should search ticket', ()=> {
  896. ticketsPage.selectSearchType('Location');
  897. ticketsPage.searchTicket('Location' + time);
  898. ticketsPage.clickDetails();
  899. });
  900.  
  901. it('should edit new line', () => {
  902. editTicketPage.clickEditLine();
  903. });
  904.  
  905. it('should edit note', () => {
  906. editTicketPage.fillLineNote(time + time);
  907. });
  908.  
  909. it('should select hour', () => {
  910. editTicketPage.selectHour('Each');
  911. });
  912.  
  913. it('should edit start date',() => {
  914. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  915. editTicketPage.fillStartHour('15');
  916. editTicketPage.fillStartMinutes('30');
  917. });
  918.  
  919. it('should set end date',() => {
  920. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  921. editTicketPage.fillEndHour('15');
  922. editTicketPage.fillEndMinutes('45');
  923. });
  924.  
  925. it('should edit rate and hours', () => {
  926. editTicketPage.fillQuantity('30');
  927. editTicketPage.fillRate('20');
  928. editTicketPage.fillHours('30');
  929. });
  930.  
  931. it('should see edited total updates', () => {
  932. expect(editTicketPage.getTotal()).toEqual('570.00');
  933. });
  934.  
  935. it('should edit discount', () => {
  936. editTicketPage.fillDiscount('7');
  937. });
  938.  
  939. it('should see edited total updates', () => {
  940. expect(editTicketPage.getTotal()).toEqual('558.00');
  941. });
  942.  
  943. it('should edit minimum', () => {
  944. editTicketPage.fillMinimum('200');
  945. editTicketPage.clickLineNote();
  946. });
  947.  
  948. it('should see edited total updates', () => {
  949. expect(editTicketPage.getTotal()).toEqual('558.00');
  950. });
  951.  
  952. it('should save line', () => {
  953. editTicketPage.clickSaveClose();
  954. });
  955.  
  956. it('should display saved line in service table', () => {
  957. expect(editTicketPage.getRate('Service', '1')).toEqual('$20.00/ea');
  958. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('30 Units');
  959. expect(editTicketPage.getMin('Service', '1')).toEqual('$200.00');
  960. expect(editTicketPage.getAmount('Service', '1')).toEqual('$558.00');
  961. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('30 Units');
  962. expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time + time);
  963. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:30:00 PM');
  964. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:45:00 PM');
  965. });*/
  966. });
  967.  
  968. describe('checking for add miscellaneous line item in ticket', () => {
  969.  
  970. var time = commonHelper.uniqueValue();
  971.  
  972. beforeAll(() => {
  973. browser.get(loginLink);
  974. });
  975.  
  976. afterAll(() => {
  977. commonHelper.clearAllData();
  978. });
  979.  
  980. it('should redirect on dashboard page after login', () => {
  981. signInPage.login(username, password);
  982. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  983.  
  984. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  985. });
  986.  
  987. it('should click on plus button and select service ticket', () => {
  988. dashboardPage.selectItem('Service Ticket');
  989.  
  990. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  991. });
  992.  
  993. it('should save ticket header', () => {
  994. editTicketPage.fillLocation('Location' + time);
  995. editTicketPage.fillAfe(afe);
  996. editTicketPage.fillJobCode(jobCode);
  997. editTicketPage.clickSave();
  998.  
  999. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1000. });
  1001.  
  1002. it('should add line item and see Miscellaneous form', () => {
  1003. editTicketPage.clickNewLine();
  1004. editTicketPage.selectCategory('Miscellaneous');
  1005. });
  1006.  
  1007. it('should set note', () => {
  1008. editTicketPage.fillLineNote(time);
  1009. });
  1010.  
  1011. it('should set rate and hours', () => {
  1012. editTicketPage.selectHour('week');
  1013. editTicketPage.fillStandbyRate('10');
  1014. editTicketPage.fillRate('10');
  1015. editTicketPage.fillDaysStandby('40');
  1016. editTicketPage.fillHours('20');
  1017. editTicketPage.fillQuantity('30');
  1018. });
  1019.  
  1020. it('should see total updates', () => {
  1021. expect(editTicketPage.getTotal()).toEqual('700.00');
  1022. });
  1023.  
  1024. it('should set discount', () => {
  1025. editTicketPage.fillDiscount('5');
  1026. });
  1027.  
  1028. it('should see total updates', () => {
  1029. expect(editTicketPage.getTotal()).toEqual('665.00');
  1030. });
  1031.  
  1032. it('should see minimum', () => {
  1033. editTicketPage.fillMinimum('100');
  1034. editTicketPage.clickLineNote();
  1035. });
  1036.  
  1037. it('should see total updates', () => {
  1038. expect(editTicketPage.getTotal()).toEqual('665.00');
  1039. });
  1040.  
  1041. it('should save line', () => {
  1042. editTicketPage.clickSaveClose();
  1043. });
  1044.  
  1045. it('should display saved line in other table', () => {
  1046. expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
  1047. expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
  1048. expect(editTicketPage.getNote('Other', '1')).toEqual('Note:' + time);
  1049. });
  1050. });
  1051.  
  1052. describe('checking for add new signature', () => {
  1053.  
  1054. var time = commonHelper.uniqueValue();
  1055.  
  1056. beforeAll(() => {
  1057. browser.get(loginLink);
  1058. });
  1059.  
  1060. afterAll(() => {
  1061. commonHelper.clearAllData();
  1062. });
  1063.  
  1064. it('should redirect on dashboard page after login', () => {
  1065. signInPage.login(username, password);
  1066. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1067.  
  1068. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1069. });
  1070.  
  1071. it('should click on plus button and select service ticket', () => {
  1072. dashboardPage.selectItem('Service Ticket');
  1073.  
  1074. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1075. });
  1076.  
  1077. it('should save ticket header', () => {
  1078. editTicketPage.fillLocation('Location' + time);
  1079. editTicketPage.fillAfe(afe);
  1080. editTicketPage.fillJobCode(jobCode);
  1081. editTicketPage.clickSave();
  1082.  
  1083. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1084. });
  1085.  
  1086. it('should click on add signature button', () => {
  1087. editTicketPage.clickAddSignature();
  1088. expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
  1089. });
  1090.  
  1091. it('should add signature ', () => {
  1092. editTicketPage.fillSignatureName(username);
  1093. editTicketPage.selectSignatureStyle();
  1094. editTicketPage.fillSignatureEmail(password);
  1095. editTicketPage.selectSignatureCertify();
  1096. });
  1097.  
  1098. it('should rate signature and feedback', () => {
  1099. editTicketPage.ratePunctuality();
  1100. editTicketPage.rateCompetence();
  1101. editTicketPage.rateProfessionalism();
  1102. editTicketPage.fillFeedback(time)
  1103. });
  1104.  
  1105. it('should click on checkbox signature', () => {
  1106. editTicketPage.btnCheckboxSignature.click();
  1107. expect(editTicketPage.chkSignature().isPresent()).toBe(true);
  1108. });
  1109.  
  1110. it('should save signature', () => {
  1111. editTicketPage.clickSaveSignature();
  1112. expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
  1113. });
  1114. });
  1115.  
  1116. describe('checking for add note', () => {
  1117.  
  1118. var time = commonHelper.uniqueValue();
  1119. var note = commonHelper.randomString(36, 10);
  1120.  
  1121. beforeAll(() => {
  1122. browser.get(loginLink);
  1123. });
  1124.  
  1125. afterAll(() => {
  1126. commonHelper.clearAllData();
  1127. });
  1128.  
  1129. it('should redirect on dashboard page after login', () => {
  1130. signInPage.login(username, password);
  1131. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1132.  
  1133. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1134. });
  1135.  
  1136. it('should click on plus button and select service ticket', () => {
  1137. dashboardPage.selectItem('Service Ticket');
  1138.  
  1139. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1140. });
  1141.  
  1142. it('should save ticket header', () => {
  1143. editTicketPage.fillLocation('Location' + time);
  1144. editTicketPage.fillAfe(afe);
  1145. editTicketPage.fillJobCode(jobCode);
  1146. editTicketPage.clickSave();
  1147.  
  1148. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1149. });
  1150.  
  1151. it('should click on add note',() => {
  1152. editTicketPage.clickAddNotes();
  1153. expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
  1154. });
  1155.  
  1156. it('should add notes', () => {
  1157. editTicketPage.fillNote(note);
  1158. editTicketPage.clickSaveNote();
  1159. });
  1160.  
  1161. it('should see note', () => {
  1162. commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
  1163. expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
  1164. });
  1165. });
  1166.  
  1167. describe('checking for add new member', () => {
  1168.  
  1169. var time = commonHelper.uniqueValue();
  1170. var user = 'Admin Selenium';
  1171.  
  1172. beforeAll(() => {
  1173. browser.get(loginLink);
  1174. });
  1175.  
  1176. afterAll(() => {
  1177. commonHelper.clearAllData();
  1178. });
  1179.  
  1180. it('should redirect on dashboard page after login', () => {
  1181. signInPage.login(username, password);
  1182. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1183.  
  1184. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1185. });
  1186.  
  1187. it('should click on plus button and select service ticket', () => {
  1188. dashboardPage.selectItem('Service Ticket');
  1189.  
  1190. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1191. });
  1192.  
  1193. it('should save ticket header', () => {
  1194. editTicketPage.fillLocation('Location' + time);
  1195. editTicketPage.fillAfe(afe);
  1196. editTicketPage.fillJobCode(jobCode);
  1197. editTicketPage.clickSave();
  1198.  
  1199. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1200. });
  1201.  
  1202. it('should click add member',() => {
  1203. editTicketPage.clickAddMember();
  1204. expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
  1205. });
  1206.  
  1207. it('should add member',() => {
  1208. editTicketPage.memberCheckbox(user).click();
  1209. expect(editTicketPage.chkMember().isPresent()).toBe(true);
  1210. editTicketPage.clickMemberSaved();
  1211. });
  1212.  
  1213. it('should see new member', () => {
  1214. expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
  1215. });
  1216. });
  1217.  
  1218. describe('checking for add new attachment', () => {
  1219.  
  1220. beforeAll(() => {
  1221. browser.get(loginLink);
  1222. });
  1223.  
  1224. afterAll(() => {
  1225. commonHelper.clearAllData();
  1226. });
  1227.  
  1228. it('should redirect on dashboard page after login', () => {
  1229. signInPage.login(username, password);
  1230. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1231.  
  1232. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1233. });
  1234.  
  1235. it('should click on plus button and select service ticket', () => {
  1236. dashboardPage.selectItem('Service Ticket');
  1237.  
  1238. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1239. });
  1240.  
  1241. it('should save ticket header', () => {
  1242. editTicketPage.fillLocation('Location' + commonHelper.uniqueValue());
  1243. editTicketPage.fillAfe(afe);
  1244. editTicketPage.fillJobCode(jobCode);
  1245. editTicketPage.clickSave();
  1246.  
  1247. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1248. });
  1249.  
  1250. it('should click add attachment',() => {
  1251. editTicketPage.clickAddAttachment();
  1252.  
  1253. expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
  1254. });
  1255.  
  1256. it('should add new attachment',() => {
  1257. editTicketPage.uploadAttachment('index.jpg');
  1258. editTicketPage.clickSaveAttachment();
  1259.  
  1260. expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
  1261. });
  1262. });
  1263. });
  1264. --------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement