Advertisement
Guest User

oil

a guest
Dec 15th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 144.88 KB | None | 0 0
  1. add_asset.po
  2.  
  3. 'use strict';
  4.  
  5. const commonHelper = require('./../../helpers/common.helper.js');
  6.  
  7. class AddAssetsPage {
  8.  
  9. //--------------------------------------------------------------------------
  10. // Elements
  11. //--------------------------------------------------------------------------
  12.  
  13. constructor() {
  14.  
  15. this.txtAssetsCompany = element(by.model('asset.company'));
  16.  
  17. this.txtLease = $('[aria-label="Lease"]');
  18.  
  19. this.txtAssetName = element(by.model('asset.name'));
  20.  
  21. this.txtAssetBarrel = element(by.model('asset.max_barrels'));
  22.  
  23. this.txtAssetsDescription = element(by.model('asset.tank_description'));
  24.  
  25. this.btnAddIncrement = $('[aria-label="Add Increment"]');
  26.  
  27. this.btnShowPanel = $('[ng-click="showPanel()"]');
  28.  
  29. this.txtFeet = element(by.model('feet'));
  30.  
  31. this.txtWhole = element(by.model('whole'));
  32.  
  33. this.txtQuarters = element(by.model('quarters'));
  34.  
  35. this.btnOk = $('[aria-label="OK"]');
  36.  
  37. this.txtIncrements = element(by.model('strappingIncrement.increments'));
  38.  
  39. this.btnEdit = $('[aria-label="edit"]');
  40.  
  41. this.btnSaveIncrement = $('[ng-click="save(strappingIncrementForm)"]');
  42.  
  43. this.btnSaveAndClose = $('[aria-label="Save & Close"]');
  44.  
  45. this.txtTankSize = element(by.model('asset.tank_size'));
  46.  
  47. this.txtLeaseNumber = element(by.model('asset.virtual_fields[\'lease_number\']'));
  48.  
  49. this.txtField = element(by.model('asset.virtual_fields[\'field\']'));
  50.  
  51. this.txtFieldOperator = element(by.model('asset.virtual_fields[\'field_operator\']'));
  52.  
  53. this.txtLegalLocation = element(by.model('asset.virtual_fields[\'legal_location\']'));
  54.  
  55. this.txtCountry = element(by.model('asset.virtual_fields[\'country\']'));
  56.  
  57. this.txtState = element(by.model('asset.virtual_fields[\'state\']'));
  58.  
  59. this.txtFederal = element(by.model('asset.virtual_fields[\'federal_indian_lsc_number\']'));
  60.  
  61.  
  62. }
  63.  
  64. //--------------------------------------------------------------------------
  65. // Functions
  66. //--------------------------------------------------------------------------
  67. fillFederal(value) {
  68. this.txtFederal.clear();
  69. this.txtFederal.sendKeys(value);
  70. }
  71.  
  72. fillLeaseNumber(value) {
  73. this.txtLeaseNumber.clear();
  74. this.txtLeaseNumber.sendKeys(value);
  75. }
  76.  
  77. fillField(value) {
  78. this.txtField.clear();
  79. this.txtField.sendKeys(value);
  80. }
  81.  
  82. fillFieldOperator(value) {
  83. this.txtFieldOperator.clear();
  84. this.txtFieldOperator.sendKeys(value);
  85. }
  86.  
  87. fillLegalLocation(value) {
  88. this.txtLegalLocation.clear();
  89. this.txtLegalLocation.sendKeys(value);
  90. }
  91.  
  92. fillCountry(value) {
  93. this.txtCountry.clear();
  94. this.txtCountry.sendKeys(value);
  95. }
  96.  
  97. fillState(value) {
  98. this.txtState.clear();
  99. this.txtState.sendKeys(value);
  100. }
  101.  
  102. fillTankSize(value) {
  103. this.txtTankSize.clear();
  104. this.txtTankSize.sendKeys(value);
  105. }
  106.  
  107. clickSaveAndClose(){
  108. this.btnSaveAndClose.click();
  109. }
  110.  
  111. clickSaveIncrement(){
  112. this.btnSaveIncrement.click();
  113. }
  114.  
  115. fillIncrements(value){
  116. this.txtIncrements.clear();
  117. this.txtIncrements.sendKeys(value);
  118. }
  119.  
  120. clickOk(){
  121. this.btnOk.click();
  122. }
  123.  
  124. fillWhole(value){
  125. this.txtWhole.clear();
  126. this.txtWhole.sendKeys(value);
  127. }
  128.  
  129. fillQuarters(value){
  130. this.txtQuarters.clear();
  131. this.txtQuarters.sendKeys(value);
  132. }
  133.  
  134. fillFeet(value){
  135. this.txtFeet.clear();
  136. this.txtFeet.sendKeys(value);
  137. }
  138. clickShowPanel(){
  139. this.btnShowPanel.click();
  140. }
  141.  
  142. clickAddIncrement(){
  143. this.btnAddIncrement.click();
  144. }
  145.  
  146. fillAssetsDescription(value){
  147. this.txtAssetsDescription.clear();
  148. this.txtAssetsDescription.sendKeys(value);
  149. }
  150.  
  151. fillAssetBarrel(value){
  152. this.txtAssetBarrel.clear();
  153. this.txtAssetBarrel.sendKeys(value);
  154. }
  155.  
  156. fillAssetName(value){
  157. this.txtAssetName.clear();
  158. this.txtAssetName.sendKeys(value);
  159. }
  160.  
  161. fillLease(value){
  162. this.txtLease.clear();
  163. this.txtLease.sendKeys(value);
  164. }
  165.  
  166. selectCompanyAssets(type){
  167. browser.waitForAngular();
  168. commonHelper.waitUntilElementVisible(this.txtAssetsCompany);
  169. browser.sleep(1000);
  170. this.txtAssetsCompany.click();
  171. browser.sleep(2000);
  172. element(by.xpath('//div[contains(@class, "md-active")]//div[contains(.,"'+ type +'")]')).click();
  173. }
  174. }
  175. module.exports = AddAssetsPage;
  176. --------------------------------------------------------------------
  177. assets.po
  178.  
  179. this.btnAddAssets = $('[aria-label="Add Asset"]');
  180. ---------------------------------------------------------------------
  181. assets.spec
  182.  
  183. 'use strict';
  184.  
  185. const pageObject = require('./../../services').container.PageObject;
  186. const signInPage = pageObject.getSignInPage();
  187. const dashboardPage = pageObject.getDashboardPage();
  188. const assetsPage = pageObject.getAssetsPage();
  189. const addAssetsPage = pageObject.getAddAssetsPage();
  190. const jobCodePage = pageObject.getJobCodePage();
  191. const skuPage = pageObject.getSkuPage();
  192. const signInData = require('./../../data/sign_in');
  193. const dashboardData = require('./../../data/dashboard');
  194. const commonHelper = require('./../../services/helpers/common.helper');
  195. var strftime = require('strftime');
  196.  
  197. describe('Assets', () => {
  198.  
  199. var username = signInData.testAccount.username;
  200. var password = signInData.testAccount.password;
  201.  
  202. beforeAll(() => {
  203. browser.ignoreSynchronization = false;
  204. browser.driver.manage().window().setSize(1440, 900);
  205. });
  206.  
  207. afterAll(() => {
  208. commonHelper.clearAllData();
  209. });
  210.  
  211. describe('checking for adding new assets and edit', () => {
  212.  
  213. var time = commonHelper.uniqueValue();
  214.  
  215. beforeAll(() => {
  216. browser.get(signInData.link);
  217. });
  218.  
  219. afterAll(() => {
  220. commonHelper.clearAllData();
  221. });
  222.  
  223. it('should redirect on dashboard page after login', () => {
  224. signInPage.login(username, password);
  225. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  226.  
  227. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  228. });
  229.  
  230. it('should click on assets in menu', () => {
  231. dashboardPage.openMenu('Oil Field');
  232. dashboardPage.clickAssets();
  233.  
  234. expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
  235. });
  236.  
  237. it('should click on add assets', () => {
  238. assetsPage.clickAddAssets();
  239.  
  240. expect(jobCodePage.btnSave.isDisplayed()).toBe(true);
  241. });
  242.  
  243. it('should add assets', () => {
  244. addAssetsPage.selectCompanyAssets('Testware Associates home office');
  245. addAssetsPage.fillLease('qwe');
  246. addAssetsPage.fillAssetName('name' + time);
  247. addAssetsPage.fillTankSize('100');
  248. addAssetsPage.fillState('Texas');
  249. addAssetsPage.fillCountry('USA');
  250. addAssetsPage.fillLegalLocation('Legal');
  251. addAssetsPage.fillFieldOperator('QA');
  252. addAssetsPage.fillField('Test');
  253. addAssetsPage.fillLeaseNumber('123456');
  254. addAssetsPage.fillFederal('Federal');
  255.  
  256. jobCodePage.clickSave();
  257. });
  258.  
  259. it('should see assets title', () => {
  260. expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
  261. });
  262.  
  263. it('should search assets', () => {
  264. assetsPage.fillSearch('name' + time);
  265.  
  266. commonHelper.waitUntilElementVisible(jobCodePage.searchCode(time));
  267. });
  268.  
  269. it('should edit assets', () => {
  270. skuPage.clickDetails();
  271.  
  272. addAssetsPage.selectCompanyAssets('Testware Associates home office');
  273. addAssetsPage.fillLease('qwe');
  274. addAssetsPage.fillAssetName('name' + time);
  275. addAssetsPage.fillTankSize('200');
  276. addAssetsPage.fillState('Idaho');
  277. addAssetsPage.fillCountry('Canada');
  278. addAssetsPage.fillLegalLocation('Location');
  279. addAssetsPage.fillFieldOperator('Auto');
  280. addAssetsPage.fillField('Qa');
  281. addAssetsPage.fillLeaseNumber('654321');
  282. addAssetsPage.fillFederal('Test');
  283. });
  284.  
  285. it('should click add increment', () => {
  286. addAssetsPage.clickAddIncrement();
  287.  
  288. commonHelper.waitUntilElementVisible(addAssetsPage.btnShowPanel)
  289. });
  290.  
  291. it('should add increment', () => {
  292. addAssetsPage.clickShowPanel();
  293.  
  294. addAssetsPage.fillWhole('1');
  295. addAssetsPage.fillFeet('1');
  296. addAssetsPage.fillQuarters('1');
  297. addAssetsPage.clickOk();
  298. addAssetsPage.fillIncrements('10');
  299.  
  300. addAssetsPage.clickSaveIncrement();
  301. });
  302.  
  303. it('should see increment', () => {
  304. expect(addAssetsPage.btnAddIncrement.isPresent()).toBe(true);
  305. });
  306.  
  307. it('should save changes', () => {
  308. addAssetsPage.clickSaveAndClose();
  309.  
  310. commonHelper.waitUntilElementVisible(assetsPage.btnAddAssets);
  311. });
  312. });
  313.  
  314. describe('checking for cancel adding new assets', () => {
  315.  
  316. var time = commonHelper.uniqueValue();
  317.  
  318. beforeAll(() => {
  319. browser.get(signInData.link);
  320. });
  321.  
  322. afterAll(() => {
  323. commonHelper.clearAllData();
  324. });
  325.  
  326. it('should redirect on dashboard page after login', () => {
  327. signInPage.login(username, password);
  328. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  329.  
  330. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  331. });
  332.  
  333. it('should click on assets in menu', () => {
  334. dashboardPage.openMenu('Oil Field');
  335. dashboardPage.clickAssets();
  336.  
  337. expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
  338. });
  339.  
  340. it('should click on add assets', () => {
  341. assetsPage.clickAddAssets();
  342.  
  343. expect(jobCodePage.btnSave.isDisplayed()).toBe(true);
  344. });
  345.  
  346. it('should add assets', () => {
  347. addAssetsPage.selectCompanyAssets('Testware Associates home office');
  348. addAssetsPage.fillLease('qwe');
  349. addAssetsPage.fillAssetName('Bob' + time);
  350. addAssetsPage.fillTankSize('200');
  351. addAssetsPage.fillState('Idaho');
  352. addAssetsPage.fillCountry('Canada');
  353. addAssetsPage.fillLegalLocation('Location');
  354. addAssetsPage.fillFieldOperator('Auto');
  355. addAssetsPage.fillField('Qa');
  356. addAssetsPage.fillLeaseNumber('654321');
  357. addAssetsPage.fillFederal('Test');
  358.  
  359. dashboardPage.clickCancel();
  360. });
  361.  
  362. it('should see assets title', () => {
  363. expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
  364. });
  365.  
  366. it('should search assets', () => {
  367. assetsPage.fillSearch('Bob' + time);
  368.  
  369. expect(skuPage.searchOnOilFieldPage('Bob' + time).isPresent()).toBe(false);
  370. });
  371. });
  372. });
  373. ------------------------------------------------------------------
  374. dashboard.spec (задизейблил поиск)
  375.  
  376. 'use strict';
  377.  
  378. const pageObject = require('./../../services').container.PageObject;
  379. const signInPage = pageObject.getSignInPage();
  380. const dashboardPage = pageObject.getDashboardPage();
  381. const editTicketPage = pageObject.getEditTicketPage();
  382. const addCompanyPage = pageObject.getAddCompanyPage();
  383. const addContactsPage = pageObject.getAddContactPage();
  384. const signInData = require('./../../data/sign_in');
  385. const dashboardData = require('./../../data/dashboard');
  386. const commonHelper = require('./../../services/helpers/common.helper');
  387. var strftime = require('strftime');
  388.  
  389. describe('Dashboard', () => {
  390.  
  391. var username = signInData.adminAccount.username;
  392. var password = signInData.adminAccount.password;
  393. var name = dashboardData.companies.name;
  394. var site = dashboardData.companies.site;
  395. var type = dashboardData.companies.type;
  396. var editName = dashboardData.editCompanies.name;
  397. var editSite = dashboardData.editCompanies.site;
  398. var editType = dashboardData.editCompanies.type;
  399. var contactsName = dashboardData.contacts.name;
  400. var contactsLastName = dashboardData.contacts.lastName;
  401. var contactsTittle = dashboardData.contacts.tittle;
  402. var contactsCompany = dashboardData.contacts.company;
  403. var contactsOffice = dashboardData.contacts.office;
  404. var contactsEmail = dashboardData.contacts.email;
  405. var contactsEditName = dashboardData.editContacts.name;
  406. var contactsEditLastName = dashboardData.editContacts.lastName;
  407. var contactsEditTittle = dashboardData.editContacts.tittle;
  408. var contactsEditCompany = dashboardData.editContacts.company;
  409. var contactsEditOffice = dashboardData.editContacts.office;
  410. var contactsEditEmail = dashboardData.editContacts.email;
  411. var loginLink = signInData.link;
  412. var dashboardTitle = dashboardData.title;
  413.  
  414. beforeAll(() => {
  415. browser.ignoreSynchronization = false;
  416. browser.driver.manage().window().setSize(1440, 900);
  417. });
  418.  
  419. afterAll(() => {
  420. commonHelper.clearAllData();
  421. });
  422.  
  423. describe('checking for add and edit company', () => {
  424.  
  425. var time = commonHelper.uniqueValue();
  426.  
  427. beforeAll(() => {
  428. browser.get(loginLink);
  429. });
  430.  
  431. afterAll(() => {
  432. commonHelper.clearAllData();
  433. });
  434.  
  435. it('should redirect on dashboard page after login', () => {
  436. signInPage.login(username, password);
  437. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  438.  
  439. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  440. });
  441.  
  442. it('should click on add company', () => {
  443. dashboardPage.clickAddCompany();
  444.  
  445. expect(addCompanyPage.companyTitle.getText()).toEqual('Add Company');
  446. });
  447.  
  448. it('should add company', () => {
  449. addCompanyPage.fillCompanyName(name + time);
  450. addCompanyPage.fillCompanySite(site);
  451. addCompanyPage.selectCompanyType(type);
  452. addCompanyPage.fillCompanyNote(time);
  453. });
  454.  
  455. it('should add icon for company',() => {
  456. editTicketPage.uploadAttachment('index.jpg');
  457. addCompanyPage.clickSave();
  458.  
  459. expect(addCompanyPage.imageCompany.isDisplayed()).toBe(true);
  460. });
  461.  
  462. it('should redirect to dashboard',() => {
  463. dashboardPage.openMenu('Dashboard');
  464.  
  465. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  466. });
  467.  
  468. it('should search company',() => {
  469. addCompanyPage.txtSeachCompany.sendKeys(name + time);
  470. commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(name + time));
  471. });
  472.  
  473. it('should click on edit button',() => {
  474. dashboardPage.clickEdit();
  475.  
  476. expect(addCompanyPage.companyTitle.getText()).toEqual('Edit Company');
  477. });
  478.  
  479. it('should edit company', () => {
  480. addCompanyPage.fillCompanyName(editName + time);
  481. addCompanyPage.fillCompanySite(editSite);
  482. addCompanyPage.selectCompanyType(editType);
  483. addCompanyPage.fillCompanyNote(time);
  484. });
  485.  
  486. it('should edit icon for company',() => {
  487. editTicketPage.uploadAttachment('index.jpg');
  488. addCompanyPage.clickSave();
  489.  
  490. expect(addCompanyPage.imageCompany.isDisplayed()).toBe(true);
  491. });
  492.  
  493. it('should redirect to dashboard',() => {
  494. dashboardPage.openMenu('Dashboard');
  495.  
  496. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  497. });
  498.  
  499. it('should search company',() => {
  500. addCompanyPage.fillSearchCompany(editName + time);
  501. commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(editName + time));
  502. });
  503.  
  504. it('should see changes in company details',() => {
  505. dashboardPage.clickDetails();
  506.  
  507. expect(dashboardPage.pageTitle()).toEqual('PineApple' + time);
  508. });
  509. });
  510.  
  511. describe('checking for add and edit contact', () => {
  512.  
  513. var time = commonHelper.uniqueValue();
  514.  
  515. beforeAll(() => {
  516. browser.get(loginLink);
  517. });
  518.  
  519. afterAll(() => {
  520. commonHelper.clearAllData();
  521. });
  522.  
  523. it('should redirect on dashboard page after login', () => {
  524. signInPage.login(username, password);
  525. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  526.  
  527. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  528. });
  529.  
  530. it('should click on add contacts', () => {
  531. dashboardPage.clickAddContacts();
  532. });
  533.  
  534. it('should add contacts', () => {
  535. addContactsPage.fillContactName(contactsName + time);
  536. addContactsPage.fillContactLastName(contactsLastName);
  537. addContactsPage.fillContactTitle(contactsTittle);
  538. addContactsPage.selectContactCompany(contactsCompany);
  539. addContactsPage.selectContactOffices(contactsOffice);
  540. addContactsPage.fillContactNumber(time);
  541. addContactsPage.fillContactEmail(contactsEmail);
  542. });
  543.  
  544. it('should save contacts', () => {
  545. addContactsPage.saveCompany();
  546. });
  547.  
  548. it('should redirect to dashboard',() => {
  549. dashboardPage.openMenu('Dashboard');
  550.  
  551. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  552. });
  553.  
  554. /* it('should search contacts',() => {
  555. addContactsPage.fillSearchContacts(contactsName + time);
  556. commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(contactsName + time));
  557. });
  558.  
  559. it('should see contacts details',() => {
  560. addContactsPage.clickBtnDetailsContact();
  561.  
  562. expect(dashboardPage.pageTitle()).toEqual(contactsTittle);
  563. expect(addContactsPage.getTable(contactsEmail));
  564. expect(addContactsPage.getTable(time));
  565. });
  566.  
  567. it('should click on edit contacts', () => {
  568. addContactsPage.clickEditContact();
  569.  
  570. commonHelper.waitUntilElementVisible(addContactsPage.tittleEdit);
  571. });
  572.  
  573. it('should edit contacts', () => {
  574. addContactsPage.fillContactName(contactsEditName + time);
  575. addContactsPage.fillContactLastName(contactsEditLastName);
  576. addContactsPage.fillContactTitle(contactsEditTittle);
  577. addContactsPage.selectContactCompany(contactsEditCompany);
  578. addContactsPage.selectContactOffices(contactsEditOffice);
  579. addContactsPage.fillContactNumber(time + '00');
  580. addContactsPage.fillContactEmail(contactsEditEmail);
  581. });
  582.  
  583. it('should save contacts', () => {
  584. addContactsPage.saveCompany();
  585. });
  586.  
  587. it('should redirect to dashboard',() => {
  588. dashboardPage.openMenu('Dashboard');
  589.  
  590. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  591. });
  592.  
  593. it('should search contacts',() => {
  594. addContactsPage.fillSearchContacts(contactsEditName + time);
  595. commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(contactsEditName + time));
  596. });
  597.  
  598. it('should see contacts details',() => {
  599. addContactsPage.clickBtnDetailsContact();
  600.  
  601. expect(dashboardPage.pageTitle()).toEqual(contactsEditTittle);
  602. expect(addContactsPage.getTable(contactsEditEmail));
  603. expect(addContactsPage.getTable(time + '00'));
  604. });*/
  605. });
  606.  
  607. describe('checking cancel adding company', () => {
  608.  
  609. var time = commonHelper.uniqueValue();
  610.  
  611. beforeAll(() => {
  612. browser.get(loginLink);
  613. });
  614.  
  615. afterAll(() => {
  616. commonHelper.clearAllData();
  617. });
  618.  
  619. it('should redirect on dashboard page after login', () => {
  620. signInPage.login(username, password);
  621. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  622.  
  623. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  624. });
  625.  
  626. it('should click on add company', () => {
  627. dashboardPage.clickAddCompany();
  628.  
  629. expect(addCompanyPage.companyTitle.getText()).toEqual('Add Company');
  630. });
  631.  
  632. it('should add company', () => {
  633. addCompanyPage.fillCompanyName(name + time);
  634. addCompanyPage.fillCompanySite(site);
  635. addCompanyPage.selectCompanyType(type);
  636. addCompanyPage.fillCompanyNote(time);
  637. });
  638.  
  639. it('should add icon for company and cancel adding',() => {
  640. editTicketPage.uploadAttachment('index.jpg');
  641. dashboardPage.clickCancel();
  642. });
  643.  
  644. it('should redirect to dashboard',() => {
  645. dashboardPage.openMenu('Dashboard');
  646.  
  647. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  648. });
  649.  
  650. /* it('should search company',() => {
  651. addCompanyPage.txtSeachCompany.sendKeys(name + time);
  652.  
  653. expect(addCompanyPage.searchCompany(name + time).isPresent()).toBe(false);
  654. });*/
  655. });
  656.  
  657. describe('checking for cancel adding contact', () => {
  658.  
  659. var time = commonHelper.uniqueValue();
  660.  
  661. beforeAll(() => {
  662. browser.get(loginLink);
  663. });
  664.  
  665. afterAll(() => {
  666. commonHelper.clearAllData();
  667. });
  668.  
  669. it('should redirect on dashboard page after login', () => {
  670. signInPage.login(username, password);
  671. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  672.  
  673. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  674. });
  675.  
  676. it('should click on add contacts', () => {
  677. dashboardPage.clickAddContacts();
  678. });
  679.  
  680. it('should add contacts', () => {
  681. addContactsPage.fillContactName(contactsName + time);
  682. addContactsPage.fillContactLastName(contactsLastName);
  683. addContactsPage.fillContactTitle(contactsTittle);
  684. addContactsPage.selectContactCompany(contactsCompany);
  685. addContactsPage.selectContactOffices(contactsOffice);
  686. addContactsPage.fillContactNumber(time);
  687. addContactsPage.fillContactEmail(contactsEmail);
  688. });
  689.  
  690. it('should cancel contacts', () => {
  691. addContactsPage.cancelContacts();
  692. });
  693.  
  694. it('should redirect to dashboard', () => {
  695. dashboardPage.openMenu('Dashboard');
  696.  
  697. expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
  698. });/*
  699.  
  700. it('should search contacts', () => {
  701. addContactsPage.fillSearchContacts(contactsName + time);
  702. expect(addCompanyPage.searchCompany(contactsName + time).isPresent()).toBe(false);
  703. });*/
  704. });
  705. });
  706. ---------------------------------------------------------------------
  707. pipeline_ticket.spec
  708.  
  709. 'use strict';
  710.  
  711. const pageObject = require('./../../../services/index').container.PageObject;
  712. const signInPage = pageObject.getSignInPage();
  713. const dashboardPage = pageObject.getDashboardPage();
  714. const editTicketPage = pageObject.getEditTicketPage();
  715. const pipelineTicketPage = pageObject.getPipelineTicketPage();
  716. const signInData = require('./../../../data/sign_in/index');
  717. const dashboardData = require('./../../../data/dashboard/index');
  718. const ticketsData = require('./../../../data/tickets/index');
  719. const commonHelper = require('./../../../services/helpers/common.helper.js');
  720. var strftime = require('strftime');
  721.  
  722. describe('Pipeline tickets', () => {
  723.  
  724. var loginLink = signInData.link;
  725. var username = signInData.adminAccount.username;
  726. var password = signInData.adminAccount.password;
  727. var afe = ticketsData.ticket.afe;
  728. var jobCode = ticketsData.ticket.jobCode;
  729. var linePressure = ticketsData.pipeline.note.linePressure;
  730. var jobDescription = ticketsData.pipeline.note.jobDescription;
  731. var locationDirection = ticketsData.pipeline.note.locationDirection;
  732. var contacts = ticketsData.pipeline.note.contacts;
  733. var lead = ticketsData.pipeline.note.lead;
  734. var assistant = ticketsData.pipeline.note.assistant;
  735. var injectionPoint = ticketsData.pipeline.note.injectionPoint;
  736. var errorMessage = ticketsData.errorMessage;
  737.  
  738. beforeAll(() => {
  739. browser.ignoreSynchronization = false;
  740. browser.driver.manage().window().setSize(1440, 900);
  741. });
  742.  
  743. afterAll(() => {
  744. commonHelper.clearAllData();
  745. });
  746.  
  747. describe('checking for add hourly line item in pipeline ticket', () => {
  748.  
  749. var time = commonHelper.uniqueValue();
  750.  
  751. beforeAll(() => {
  752. browser.get(loginLink);
  753. });
  754.  
  755. afterAll(() => {
  756. commonHelper.clearAllData();
  757. });
  758.  
  759. it('should redirect on dashboard page after login', () => {
  760. signInPage.login(username, password);
  761. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  762.  
  763. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  764. });
  765.  
  766. it('should click on plus button and select pipeline ticket', () => {
  767. dashboardPage.selectItem('Pipeline Service Ticket');
  768.  
  769. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  770. });
  771.  
  772. it('should save ticket header', () => {
  773. editTicketPage.fillLocation('Location' + time);
  774. editTicketPage.fillAfe(afe);
  775. editTicketPage.fillJobCode(jobCode);
  776. });
  777.  
  778. it('should add notes', () => {
  779. pipelineTicketPage.fillLinePressure(linePressure);
  780. pipelineTicketPage.fillLocationDirection(locationDirection);
  781. pipelineTicketPage.fillContacts(contacts);
  782. pipelineTicketPage.fillLead(lead);
  783. pipelineTicketPage.fillAssistant(assistant);
  784. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  785. pipelineTicketPage.fillJobDescription(jobDescription);
  786.  
  787. editTicketPage.clickSave();
  788.  
  789. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  790. });
  791.  
  792. it('should add line item and see hourly form', () => {
  793. editTicketPage.clickNewLine();
  794. editTicketPage.selectCategory('Hourly');
  795. editTicketPage.selectSubCategory('All');
  796. editTicketPage.clickSaveClose();
  797. });
  798.  
  799. it('should edit new line', () => {
  800. editTicketPage.clickEditLineItem('Hourly');
  801. });
  802.  
  803. it('should set note', () => {
  804. editTicketPage.fillLineNote(time);
  805. });
  806.  
  807. it('should set rate and hours', () => {
  808. editTicketPage.fillRate('10');
  809. editTicketPage.fillHours('20');
  810. });
  811.  
  812. it('should see total updates', () => {
  813. expect(editTicketPage.getTotal()).toEqual('200.00');
  814. });
  815.  
  816. it('should set discount', () => {
  817. editTicketPage.fillDiscount('5');
  818. });
  819.  
  820. it('should see total updates', () => {
  821. expect(editTicketPage.getTotal()).toEqual('190.00');
  822. });
  823.  
  824. it('should see minimum', () => {
  825. editTicketPage.fillMinimum('100');
  826. editTicketPage.clickLineNote();
  827. });
  828.  
  829. it('should see total updates', () => {
  830. expect(editTicketPage.getTotal()).toEqual('190.00');
  831. });
  832.  
  833. it('should save line', () => {
  834. editTicketPage.clickSaveClose();
  835. });
  836.  
  837. it('should display saved line in Hourly table', () => {
  838. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
  839. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
  840. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
  841. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
  842. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
  843. });
  844. });
  845.  
  846. describe('checking for add rental line item in pipeline ticket', () => {
  847.  
  848. var time = commonHelper.uniqueValue();
  849.  
  850. beforeAll(() => {
  851. browser.get(loginLink);
  852. });
  853.  
  854. afterAll(() => {
  855. commonHelper.clearAllData();
  856. });
  857.  
  858. it('should redirect on dashboard page after login', () => {
  859. signInPage.login(username, password);
  860. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  861.  
  862. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  863. });
  864.  
  865. it('should click on plus button and select pipeline ticket', () => {
  866. dashboardPage.selectItem('Pipeline Service Ticket');
  867.  
  868. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  869. });
  870.  
  871. it('should save ticket header', () => {
  872. editTicketPage.fillLocation('Location' + time);
  873. editTicketPage.fillAfe(afe);
  874. editTicketPage.fillJobCode(jobCode);
  875. });
  876.  
  877. it('should add notes', () => {
  878. pipelineTicketPage.fillLinePressure(linePressure);
  879. pipelineTicketPage.fillLocationDirection(locationDirection);
  880. pipelineTicketPage.fillContacts(contacts);
  881. pipelineTicketPage.fillLead(lead);
  882. pipelineTicketPage.fillAssistant(assistant);
  883. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  884. pipelineTicketPage.fillJobDescription(jobDescription);
  885.  
  886. editTicketPage.clickSave();
  887.  
  888. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  889. });
  890.  
  891. it('should add line item and see rental form', () => {
  892. editTicketPage.clickNewLine();
  893. editTicketPage.selectCategory('Rental');
  894. editTicketPage.selectSubCategory('All');
  895. editTicketPage.clickSaveClose();
  896. });
  897.  
  898. it('should edit new line', () => {
  899. editTicketPage.clickEditLineItem('Rental');
  900. });
  901.  
  902. it('should set note', () => {
  903. editTicketPage.fillLineNote(time);
  904. });
  905.  
  906. it('should set rate and hours', () => {
  907. editTicketPage.selectHour('Per day');
  908. editTicketPage.fillRate('10');
  909. editTicketPage.fillStandbyRate('10');
  910. editTicketPage.fillHours('20');
  911. editTicketPage.fillQuantity('30');
  912. editTicketPage.fillDaysStandby('40');
  913. });
  914.  
  915. it('should see total updates', () => {
  916. expect(editTicketPage.getTotal()).toEqual('700.00');
  917. });
  918.  
  919. it('should set discount', () => {
  920. editTicketPage.fillDiscount('5');
  921. });
  922.  
  923. it('should see total updates', () => {
  924. expect(editTicketPage.getTotal()).toEqual('665.00');
  925. });
  926.  
  927. it('should see minimum', () => {
  928. editTicketPage.fillMinimum('300');
  929. editTicketPage.clickLineNote();
  930. });
  931.  
  932. it('should see total updates', () => {
  933. expect(editTicketPage.getTotal()).toEqual('665.00');
  934. });
  935.  
  936. it('should save line', () => {
  937. editTicketPage.clickSaveClose();
  938. });
  939.  
  940. it('should display saved line in Rental table', () => {
  941. expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
  942. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
  943. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
  944. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
  945. expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
  946. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
  947. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
  948. });
  949. });
  950.  
  951. describe('checking for add service line item in pipeline ticket', () => {
  952.  
  953. var time = commonHelper.uniqueValue();
  954.  
  955. var tomorrowDate = new Date();
  956. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  957.  
  958. beforeAll(() => {
  959. browser.get(loginLink);
  960. });
  961.  
  962. afterAll(() => {
  963. commonHelper.clearAllData();
  964. });
  965.  
  966. it('should redirect on dashboard page after login', () => {
  967. signInPage.login(username, password);
  968. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  969.  
  970. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  971. });
  972.  
  973. it('should click on plus button and select pipeline ticket', () => {
  974. dashboardPage.selectItem('Pipeline Service Ticket');
  975.  
  976. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  977. });
  978.  
  979. it('should save ticket header', () => {
  980. editTicketPage.fillLocation('Location' + time);
  981. editTicketPage.fillAfe(afe);
  982. editTicketPage.fillJobCode(jobCode);
  983. });
  984.  
  985. it('should add notes', () => {
  986. pipelineTicketPage.fillLinePressure(linePressure);
  987. pipelineTicketPage.fillLocationDirection(locationDirection);
  988. pipelineTicketPage.fillContacts(contacts);
  989. pipelineTicketPage.fillLead(lead);
  990. pipelineTicketPage.fillAssistant(assistant);
  991. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  992. pipelineTicketPage.fillJobDescription(jobDescription);
  993.  
  994. editTicketPage.clickSave();
  995.  
  996. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  997. });
  998.  
  999. it('should add line item and see service form', () => {
  1000. editTicketPage.clickNewLine();
  1001. editTicketPage.selectCategory('Service');
  1002. editTicketPage.selectSubCategory('All');
  1003. editTicketPage.clickSaveClose();
  1004. });
  1005.  
  1006. it('should edit new line', () => {
  1007. editTicketPage.clickEditLineItem('Service');
  1008. });
  1009.  
  1010. it('should set note', () => {
  1011. editTicketPage.fillLineNote(time);
  1012. });
  1013.  
  1014. it('should select hour', () => {
  1015. editTicketPage.selectHour('Each');
  1016. });
  1017.  
  1018. it('should set start date',() => {
  1019. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  1020. editTicketPage.fillStartHour('10');
  1021. editTicketPage.fillStartMinutes('15');
  1022. });
  1023.  
  1024. it('should set end date',() => {
  1025. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  1026. editTicketPage.fillEndHour('10');
  1027. editTicketPage.fillEndMinutes('30');
  1028. });
  1029.  
  1030. it('should set rate and hours', () => {
  1031. editTicketPage.fillQuantity('20');
  1032. editTicketPage.fillRate('10');
  1033. editTicketPage.fillHours('20');
  1034. });
  1035.  
  1036. it('should see total updates', () => {
  1037. expect(editTicketPage.getTotal()).toEqual('200.00');
  1038. });
  1039.  
  1040. it('should set discount', () => {
  1041. editTicketPage.fillDiscount('5');
  1042. });
  1043.  
  1044. it('should see total updates', () => {
  1045. expect(editTicketPage.getTotal()).toEqual('190.00');
  1046. });
  1047.  
  1048. it('should see minimum', () => {
  1049. editTicketPage.fillMinimum('100');
  1050. editTicketPage.clickLineNote();
  1051. });
  1052.  
  1053. it('should see total updates', () => {
  1054. expect(editTicketPage.getTotal()).toEqual('190.00');
  1055. });
  1056.  
  1057. it('should save line', () => {
  1058. editTicketPage.clickSaveClose();
  1059. });
  1060.  
  1061. it('should display saved line in service table', () => {
  1062. expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
  1063. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
  1064. expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
  1065. expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
  1066. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
  1067. expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
  1068. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
  1069. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
  1070. });
  1071. });
  1072.  
  1073. describe('checking for add miscellaneous line item in pipeline ticket', () => {
  1074.  
  1075. var time = commonHelper.uniqueValue();
  1076.  
  1077. beforeAll(() => {
  1078. browser.get(loginLink);
  1079. });
  1080.  
  1081. afterAll(() => {
  1082. commonHelper.clearAllData();
  1083. });
  1084.  
  1085. it('should redirect on dashboard page after login', () => {
  1086. signInPage.login(username, password);
  1087. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1088.  
  1089. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1090. });
  1091.  
  1092. it('should click on plus button and select pipeline ticket', () => {
  1093. dashboardPage.selectItem('Pipeline Service Ticket');
  1094.  
  1095. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1096. });
  1097.  
  1098. it('should save ticket header', () => {
  1099. editTicketPage.fillLocation('Location' + time);
  1100. editTicketPage.fillAfe(afe);
  1101. editTicketPage.fillJobCode(jobCode);
  1102. });
  1103.  
  1104. it('should add notes', () => {
  1105. pipelineTicketPage.fillLinePressure(linePressure);
  1106. pipelineTicketPage.fillLocationDirection(locationDirection);
  1107. pipelineTicketPage.fillContacts(contacts);
  1108. pipelineTicketPage.fillLead(lead);
  1109. pipelineTicketPage.fillAssistant(assistant);
  1110. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1111. pipelineTicketPage.fillJobDescription(jobDescription);
  1112.  
  1113. editTicketPage.clickSave();
  1114.  
  1115. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1116. });
  1117.  
  1118. it('should add line item and see Miscellaneous form', () => {
  1119. editTicketPage.clickNewLine();
  1120. editTicketPage.selectCategory('Miscellaneous');
  1121. });
  1122.  
  1123. it('should set note', () => {
  1124. editTicketPage.fillLineNote(time);
  1125. });
  1126.  
  1127. it('should set rate and hours', () => {
  1128. editTicketPage.selectHour('week');
  1129. editTicketPage.fillStandbyRate('10');
  1130. editTicketPage.fillRate('10');
  1131. editTicketPage.fillDaysStandby('40');
  1132. editTicketPage.fillHours('20');
  1133. editTicketPage.fillQuantity('30');
  1134. });
  1135.  
  1136. it('should see total updates', () => {
  1137. expect(editTicketPage.getTotal()).toEqual('700.00');
  1138. });
  1139.  
  1140. it('should set discount', () => {
  1141. editTicketPage.fillDiscount('5');
  1142. });
  1143.  
  1144. it('should see total updates', () => {
  1145. expect(editTicketPage.getTotal()).toEqual('665.00');
  1146. });
  1147.  
  1148. it('should see minimum', () => {
  1149. editTicketPage.fillMinimum('100');
  1150. editTicketPage.clickLineNote();
  1151. });
  1152.  
  1153. it('should see total updates', () => {
  1154. expect(editTicketPage.getTotal()).toEqual('665.00');
  1155. });
  1156.  
  1157. it('should save line', () => {
  1158. editTicketPage.clickSaveClose();
  1159. });
  1160.  
  1161. it('should display saved line in other table', () => {
  1162. expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
  1163. expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
  1164. expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
  1165. });
  1166. });
  1167.  
  1168. describe('checking for add new signature', () => {
  1169.  
  1170. var time = commonHelper.uniqueValue();
  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 pipeline ticket', () => {
  1188. dashboardPage.selectItem('Pipeline 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. });
  1198.  
  1199. it('should add notes', () => {
  1200. pipelineTicketPage.fillLinePressure(linePressure);
  1201. pipelineTicketPage.fillLocationDirection(locationDirection);
  1202. pipelineTicketPage.fillContacts(contacts);
  1203. pipelineTicketPage.fillLead(lead);
  1204. pipelineTicketPage.fillAssistant(assistant);
  1205. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1206. pipelineTicketPage.fillJobDescription(jobDescription);
  1207.  
  1208. editTicketPage.clickSave();
  1209.  
  1210. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1211. });
  1212.  
  1213. it('should click on add signature button', () => {
  1214. editTicketPage.clickAddSignature();
  1215. expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
  1216. });
  1217.  
  1218. it('should add signature ', () => {
  1219. editTicketPage.fillSignatureName(username);
  1220. editTicketPage.selectSignatureStyle();
  1221. editTicketPage.fillSignatureEmail(password);
  1222. editTicketPage.selectSignatureCertify();
  1223. });
  1224.  
  1225. it('should rate signature and feedback', () => {
  1226. editTicketPage.ratePunctuality();
  1227. editTicketPage.rateCompetence();
  1228. editTicketPage.rateProfessionalism();
  1229. editTicketPage.fillFeedback(time)
  1230. });
  1231.  
  1232. it('should click on checkbox signature', () => {
  1233. editTicketPage.btnCheckboxSignature.click();
  1234. expect(editTicketPage.chkSignature().isPresent()).toBe(true);
  1235. });
  1236.  
  1237. it('should save signature', () => {
  1238. editTicketPage.clickSaveSignature();
  1239. expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
  1240. });
  1241. });
  1242.  
  1243. describe('checking for add note', () => {
  1244.  
  1245. var time = commonHelper.uniqueValue();
  1246. var note = commonHelper.randomString(36, 10);
  1247.  
  1248. beforeAll(() => {
  1249. browser.get(loginLink);
  1250. });
  1251.  
  1252. afterAll(() => {
  1253. commonHelper.clearAllData();
  1254. });
  1255.  
  1256. it('should redirect on dashboard page after login', () => {
  1257. signInPage.login(username, password);
  1258. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1259.  
  1260. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1261. });
  1262.  
  1263. it('should click on plus button and select pipeline ticket', () => {
  1264. dashboardPage.selectItem('Pipeline Service Ticket');
  1265.  
  1266. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1267. });
  1268.  
  1269. it('should save ticket header', () => {
  1270. editTicketPage.fillLocation('Location' + time);
  1271. editTicketPage.fillAfe(afe);
  1272. editTicketPage.fillJobCode(jobCode);
  1273. });
  1274.  
  1275. it('should add notes', () => {
  1276. pipelineTicketPage.fillLinePressure(linePressure);
  1277. pipelineTicketPage.fillLocationDirection(locationDirection);
  1278. pipelineTicketPage.fillContacts(contacts);
  1279. pipelineTicketPage.fillLead(lead);
  1280. pipelineTicketPage.fillAssistant(assistant);
  1281. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1282. pipelineTicketPage.fillJobDescription(jobDescription);
  1283.  
  1284. editTicketPage.clickSave();
  1285.  
  1286. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1287. });
  1288. it('should click on add note',() => {
  1289. editTicketPage.clickAddNotes();
  1290. expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
  1291. });
  1292.  
  1293. it('should add notes', () => {
  1294. editTicketPage.fillNote(note);
  1295. editTicketPage.clickSaveNote();
  1296. });
  1297.  
  1298. it('should see note', () => {
  1299. commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
  1300. expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
  1301. });
  1302. });
  1303.  
  1304. describe('checking for add new member', () => {
  1305.  
  1306. var time = commonHelper.uniqueValue();
  1307. var user = 'Admin Selenium';
  1308.  
  1309. beforeAll(() => {
  1310. browser.get(loginLink);
  1311. });
  1312.  
  1313. afterAll(() => {
  1314. commonHelper.clearAllData();
  1315. });
  1316.  
  1317. it('should redirect on dashboard page after login', () => {
  1318. signInPage.login(username, password);
  1319. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1320.  
  1321. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1322. });
  1323.  
  1324. it('should click on plus button and select pipeline ticket', () => {
  1325. dashboardPage.selectItem('Pipeline Service Ticket');
  1326.  
  1327. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1328. });
  1329.  
  1330. it('should save ticket header', () => {
  1331. editTicketPage.fillLocation('Location' + time);
  1332. editTicketPage.fillAfe(afe);
  1333. editTicketPage.fillJobCode(jobCode);
  1334. });
  1335.  
  1336. it('should add notes', () => {
  1337. pipelineTicketPage.fillLinePressure(linePressure);
  1338. pipelineTicketPage.fillLocationDirection(locationDirection);
  1339. pipelineTicketPage.fillContacts(contacts);
  1340. pipelineTicketPage.fillLead(lead);
  1341. pipelineTicketPage.fillAssistant(assistant);
  1342. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1343. pipelineTicketPage.fillJobDescription(jobDescription);
  1344.  
  1345. editTicketPage.clickSave();
  1346.  
  1347. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1348. });
  1349.  
  1350. it('should click add member',() => {
  1351. editTicketPage.clickAddMember();
  1352. expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
  1353. });
  1354.  
  1355. it('should add member',() => {
  1356. editTicketPage.memberCheckbox(user).click();
  1357. expect(editTicketPage.chkMember().isPresent()).toBe(true);
  1358. editTicketPage.clickMemberSaved();
  1359. });
  1360.  
  1361. it('should see new member', () => {
  1362. expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
  1363. });
  1364. });
  1365.  
  1366. describe('checking for add new attachment', () => {
  1367.  
  1368. var time = commonHelper.uniqueValue();
  1369.  
  1370. beforeAll(() => {
  1371. browser.get(loginLink);
  1372. });
  1373.  
  1374. afterAll(() => {
  1375. commonHelper.clearAllData();
  1376. });
  1377.  
  1378. it('should redirect on dashboard page after login', () => {
  1379. signInPage.login(username, password);
  1380. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1381.  
  1382. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1383. });
  1384.  
  1385. it('should click on plus button and select pipeline ticket', () => {
  1386. dashboardPage.selectItem('Pipeline Service Ticket');
  1387.  
  1388. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1389. });
  1390.  
  1391. it('should save ticket header', () => {
  1392. editTicketPage.fillLocation('Location' + time);
  1393. editTicketPage.fillAfe(afe);
  1394. editTicketPage.fillJobCode(jobCode);
  1395. });
  1396.  
  1397. it('should add notes', () => {
  1398. pipelineTicketPage.fillLinePressure(linePressure);
  1399. pipelineTicketPage.fillLocationDirection(locationDirection);
  1400. pipelineTicketPage.fillContacts(contacts);
  1401. pipelineTicketPage.fillLead(lead);
  1402. pipelineTicketPage.fillAssistant(assistant);
  1403. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1404. pipelineTicketPage.fillJobDescription(jobDescription);
  1405.  
  1406. editTicketPage.clickSave();
  1407.  
  1408. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1409. });
  1410.  
  1411. it('should click add attachment',() => {
  1412. editTicketPage.clickAddAttachment();
  1413.  
  1414. expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
  1415. });
  1416.  
  1417. it('should add new attachment',() => {
  1418. editTicketPage.uploadAttachment('index.jpg');
  1419. editTicketPage.clickSaveAttachment();
  1420.  
  1421. expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
  1422. });
  1423. });
  1424.  
  1425. describe('checking for add hourly line item with errors', () => {
  1426.  
  1427. var time = commonHelper.uniqueValue();
  1428.  
  1429. beforeAll(() => {
  1430. browser.get(loginLink);
  1431. });
  1432.  
  1433. afterAll(() => {
  1434. commonHelper.clearAllData();
  1435. });
  1436.  
  1437. it('should redirect on dashboard page after login', () => {
  1438. signInPage.login(username, password);
  1439. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1440.  
  1441. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1442. });
  1443.  
  1444. it('should click on plus button and pipeline service ticket', () => {
  1445. dashboardPage.selectItem('Pipeline Service Ticket');
  1446.  
  1447. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1448. });
  1449.  
  1450. it('should save ticket header', () => {
  1451. editTicketPage.fillLocation('Location' + time);
  1452. editTicketPage.fillAfe(afe);
  1453. editTicketPage.fillJobCode(jobCode);
  1454. editTicketPage.clickSave();
  1455.  
  1456. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1457. });
  1458.  
  1459. it('should add line item and see hourly form', () => {
  1460. editTicketPage.clickNewLine();
  1461. editTicketPage.selectCategory('Hourly');
  1462. editTicketPage.selectSubCategory('All');
  1463. editTicketPage.clickSaveClose();
  1464. });
  1465.  
  1466. it('should edit new line', () => {
  1467. editTicketPage.clickEditLine();
  1468. });
  1469.  
  1470. it('should set note', () => {
  1471. editTicketPage.fillLineNote(time);
  1472. });
  1473.  
  1474. it('should set rate and hours', () => {
  1475. editTicketPage.fillRate('qwe');
  1476. editTicketPage.fillHours('qwe');
  1477. });
  1478.  
  1479. it('should see total updates', () => {
  1480. expect(editTicketPage.getTotal()).toEqual('0.00');
  1481. });
  1482.  
  1483. it('should set discount', () => {
  1484. editTicketPage.fillDiscount('qwe');
  1485. });
  1486.  
  1487. it('should see total updates', () => {
  1488. expect(editTicketPage.getTotal()).toEqual('0.00');
  1489. });
  1490.  
  1491. it('should see minimum', () => {
  1492. editTicketPage.fillMinimum('qwe');
  1493. editTicketPage.clickLineNote();
  1494. });
  1495.  
  1496. it('should see total updates', () => {
  1497. expect(editTicketPage.getTotal()).toEqual('0.00');
  1498. });
  1499.  
  1500. it('should save line and see errors', () => {
  1501. editTicketPage.clickSaveClose();
  1502. browser.sleep(2000);
  1503. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  1504. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  1505. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  1506. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  1507. });
  1508. });
  1509.  
  1510. describe('checking for add rental line item in ticket with errors', () => {
  1511.  
  1512. var time = commonHelper.uniqueValue();
  1513.  
  1514. beforeAll(() => {
  1515. browser.get(loginLink);
  1516. });
  1517.  
  1518. afterAll(() => {
  1519. commonHelper.clearAllData();
  1520. });
  1521.  
  1522. it('should redirect on dashboard page after login', () => {
  1523. signInPage.login(username, password);
  1524. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1525.  
  1526. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1527. });
  1528.  
  1529. it('should click on plus button and select pipeline ticket', () => {
  1530. dashboardPage.selectItem('Pipeline Service Ticket');
  1531.  
  1532. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1533. });
  1534.  
  1535. it('should save ticket header', () => {
  1536. editTicketPage.fillLocation('Location' + time);
  1537. editTicketPage.fillAfe(afe);
  1538. editTicketPage.fillJobCode(jobCode);
  1539. });
  1540.  
  1541. it('should add notes', () => {
  1542. pipelineTicketPage.fillLinePressure(linePressure);
  1543. pipelineTicketPage.fillLocationDirection(locationDirection);
  1544. pipelineTicketPage.fillContacts(contacts);
  1545. pipelineTicketPage.fillLead(lead);
  1546. pipelineTicketPage.fillAssistant(assistant);
  1547. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1548. pipelineTicketPage.fillJobDescription(jobDescription);
  1549.  
  1550. editTicketPage.clickSave();
  1551.  
  1552. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1553. });
  1554.  
  1555. it('should add line item and see rental form', () => {
  1556. editTicketPage.clickNewLine();
  1557. editTicketPage.selectCategory('Rental');
  1558. editTicketPage.selectSubCategory('All');
  1559. editTicketPage.clickSaveClose();
  1560. });
  1561.  
  1562. it('should edit new line', () => {
  1563. editTicketPage.clickEditLineItem('Rental');
  1564. });
  1565.  
  1566. it('should set note', () => {
  1567. editTicketPage.fillLineNote(time);
  1568. });
  1569.  
  1570. it('should set rate and hours', () => {
  1571. editTicketPage.selectHour('Per day');
  1572. editTicketPage.fillRate('qwe');
  1573. editTicketPage.fillStandbyRate('qwe');
  1574. editTicketPage.fillHours('qwe');
  1575. editTicketPage.fillQuantity('qe');
  1576. editTicketPage.fillDaysStandby('qwe');
  1577. });
  1578.  
  1579. it('should see total updates', () => {
  1580. expect(editTicketPage.getTotal()).toEqual('0.00');
  1581. });
  1582.  
  1583. it('should set discount', () => {
  1584. editTicketPage.fillDiscount('qwe');
  1585. });
  1586.  
  1587. it('should see total updates', () => {
  1588. expect(editTicketPage.getTotal()).toEqual('0.00');
  1589. });
  1590.  
  1591. it('should see minimum', () => {
  1592. editTicketPage.fillMinimum('qwe');
  1593. editTicketPage.clickLineNote();
  1594. });
  1595.  
  1596. it('should see total updates', () => {
  1597. expect(editTicketPage.getTotal()).toEqual('0.00');
  1598. });
  1599.  
  1600. it('should save line and see errors', () => {
  1601. editTicketPage.clickSaveClose();
  1602. browser.sleep(2000);
  1603. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  1604. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  1605. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  1606. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  1607. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  1608. });
  1609. });
  1610.  
  1611. describe('checking for add service line item in ticket with errors', () => {
  1612.  
  1613. var time = commonHelper.uniqueValue();
  1614.  
  1615. var tomorrowDate = new Date();
  1616. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  1617.  
  1618. beforeAll(() => {
  1619. browser.get(loginLink);
  1620. });
  1621.  
  1622. afterAll(() => {
  1623. commonHelper.clearAllData();
  1624. });
  1625.  
  1626. it('should redirect on dashboard page after login', () => {
  1627. signInPage.login(username, password);
  1628. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1629.  
  1630. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1631. });
  1632.  
  1633. it('should click on plus button and select pipeline ticket', () => {
  1634. dashboardPage.selectItem('Pipeline Service Ticket');
  1635.  
  1636. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1637. });
  1638.  
  1639. it('should save ticket header', () => {
  1640. editTicketPage.fillLocation('Location' + time);
  1641. editTicketPage.fillAfe(afe);
  1642. editTicketPage.fillJobCode(jobCode);
  1643. });
  1644.  
  1645. it('should add notes', () => {
  1646. pipelineTicketPage.fillLinePressure(linePressure);
  1647. pipelineTicketPage.fillLocationDirection(locationDirection);
  1648. pipelineTicketPage.fillContacts(contacts);
  1649. pipelineTicketPage.fillLead(lead);
  1650. pipelineTicketPage.fillAssistant(assistant);
  1651. pipelineTicketPage.fillInjectionPoint(injectionPoint);
  1652. pipelineTicketPage.fillJobDescription(jobDescription);
  1653.  
  1654. editTicketPage.clickSave();
  1655.  
  1656. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1657. });
  1658.  
  1659. it('should add line item and see service form', () => {
  1660. editTicketPage.clickNewLine();
  1661. editTicketPage.selectCategory('Service');
  1662. editTicketPage.selectSubCategory('All');
  1663. editTicketPage.clickSaveClose();
  1664. });
  1665.  
  1666. it('should edit new line', () => {
  1667. editTicketPage.clickEditLineItem('Service');
  1668. });
  1669.  
  1670. it('should set note', () => {
  1671. editTicketPage.fillLineNote(time);
  1672. });
  1673.  
  1674. it('should select hour', () => {
  1675. editTicketPage.selectHour('Each');
  1676. });
  1677.  
  1678. it('should set start date',() => {
  1679. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  1680. editTicketPage.fillStartHour('qwe');
  1681. editTicketPage.fillStartMinutes('qwe');
  1682. });
  1683.  
  1684. it('should set end date',() => {
  1685. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  1686. editTicketPage.fillEndHour('qwe');
  1687. editTicketPage.fillEndMinutes('qwe');
  1688. });
  1689.  
  1690. it('should set rate and hours', () => {
  1691. editTicketPage.fillQuantity('qwe');
  1692. editTicketPage.fillRate('qwe');
  1693. editTicketPage.fillHours('qwe');
  1694. });
  1695.  
  1696. it('should see total updates', () => {
  1697. expect(editTicketPage.getTotal()).toEqual('0.00');
  1698. });
  1699.  
  1700. it('should set discount', () => {
  1701. editTicketPage.fillDiscount('qwe');
  1702. });
  1703.  
  1704. it('should see total updates', () => {
  1705. expect(editTicketPage.getTotal()).toEqual('0.00');
  1706. });
  1707.  
  1708. it('should see minimum', () => {
  1709. editTicketPage.fillMinimum('qwe');
  1710. editTicketPage.clickLineNote();
  1711. });
  1712.  
  1713. it('should see total updates', () => {
  1714. expect(editTicketPage.getTotal()).toEqual('0.00');
  1715. });
  1716.  
  1717. it('should save line', () => {
  1718. editTicketPage.clickSaveClose();
  1719. });
  1720.  
  1721. it('should save line and see errors', () => {
  1722. editTicketPage.clickSaveClose();
  1723. browser.sleep(2000);
  1724. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  1725. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  1726. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  1727. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  1728. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  1729. });
  1730. });
  1731.  
  1732. describe('checking for add miscellaneous line item in ticket with errors', () => {
  1733.  
  1734. var time = commonHelper.uniqueValue();
  1735.  
  1736. beforeAll(() => {
  1737. browser.get(loginLink);
  1738. });
  1739.  
  1740. afterAll(() => {
  1741. commonHelper.clearAllData();
  1742. });
  1743.  
  1744. it('should redirect on dashboard page after login', () => {
  1745. signInPage.login(username, password);
  1746. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1747.  
  1748. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1749. });
  1750.  
  1751. it('should click on plus button and pipeline service ticket', () => {
  1752. dashboardPage.selectItem('Pipeline Service Ticket');
  1753.  
  1754. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1755. });
  1756.  
  1757. it('should save ticket header', () => {
  1758. editTicketPage.fillLocation('Location' + time);
  1759. editTicketPage.fillAfe(afe);
  1760. editTicketPage.fillJobCode(jobCode);
  1761. editTicketPage.clickSave();
  1762.  
  1763. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1764. });
  1765.  
  1766. it('should add line item and see Miscellaneous form', () => {
  1767. editTicketPage.clickNewLine();
  1768. editTicketPage.selectCategory('Miscellaneous');
  1769. });
  1770.  
  1771. it('should set note', () => {
  1772. editTicketPage.fillLineNote(time);
  1773. });
  1774.  
  1775. it('should set rate and hours', () => {
  1776. editTicketPage.selectHour('week');
  1777. editTicketPage.fillStandbyRate('qwe');
  1778. editTicketPage.fillRate('qwe');
  1779. editTicketPage.fillDaysStandby('qwe');
  1780. editTicketPage.fillHours('qwe');
  1781. editTicketPage.fillQuantity('qwe');
  1782. });
  1783.  
  1784. it('should see total updates', () => {
  1785. expect(editTicketPage.getTotal()).toEqual('0.00');
  1786. });
  1787.  
  1788. it('should set discount', () => {
  1789. editTicketPage.fillDiscount('qwe');
  1790. });
  1791.  
  1792. it('should see total updates', () => {
  1793. expect(editTicketPage.getTotal()).toEqual('0.00');
  1794. });
  1795.  
  1796. it('should see minimum', () => {
  1797. editTicketPage.fillMinimum('qwe');
  1798. editTicketPage.clickLineNote();
  1799. });
  1800.  
  1801. it('should see total updates', () => {
  1802. expect(editTicketPage.getTotal()).toEqual('0.00');
  1803. });
  1804.  
  1805. it('should save line and see errors', () => {
  1806. editTicketPage.clickSaveClose();
  1807. browser.sleep(2000);
  1808. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  1809. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  1810. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  1811. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  1812. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  1813. });
  1814. });
  1815. });
  1816. ---------------------------------------------------------------------
  1817. service_ticket.spec
  1818.  
  1819. 'use strict';
  1820.  
  1821. const pageObject = require('./../../../services/index').container.PageObject;
  1822. const signInPage = pageObject.getSignInPage();
  1823. const dashboardPage = pageObject.getDashboardPage();
  1824. const editTicketPage = pageObject.getEditTicketPage();
  1825. const ticketsPage = pageObject.getTicketsPage();
  1826. const signInData = require('./../../../data/sign_in/index');
  1827. const dashboardData = require('./../../../data/dashboard/index');
  1828. const ticketsData = require('./../../../data/tickets/index');
  1829. const commonHelper = require('./../../../services/helpers/common.helper.js');
  1830. var strftime = require('strftime');
  1831.  
  1832. describe('Service Ticket', () => {
  1833.  
  1834. var loginLink = signInData.link;
  1835. var username = signInData.adminAccount.username;
  1836. var password = signInData.adminAccount.password;
  1837. var afe = ticketsData.ticket.afe;
  1838. var jobCode = ticketsData.ticket.jobCode;
  1839. var errorMessage = ticketsData.errorMessage;
  1840.  
  1841. beforeAll(() => {
  1842. browser.ignoreSynchronization = false;
  1843. browser.driver.manage().window().setSize(1440, 900);
  1844. });
  1845.  
  1846. afterAll(() => {
  1847. commonHelper.clearAllData();
  1848. });
  1849.  
  1850. describe('checking for add hourly line item in ticket', () => {
  1851.  
  1852. var time = commonHelper.uniqueValue();
  1853.  
  1854. beforeAll(() => {
  1855. browser.get(loginLink);
  1856. });
  1857.  
  1858. afterAll(() => {
  1859. commonHelper.clearAllData();
  1860. });
  1861.  
  1862. it('should redirect on dashboard page after login', () => {
  1863. signInPage.login(username, password);
  1864. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  1865.  
  1866. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  1867. });
  1868.  
  1869. it('should click on plus button and select service ticket', () => {
  1870. dashboardPage.selectItem('Service Ticket');
  1871.  
  1872. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  1873. });
  1874.  
  1875. it('should save ticket header', () => {
  1876. editTicketPage.fillLocation('Location' + time);
  1877. editTicketPage.fillAfe(afe);
  1878. editTicketPage.fillJobCode(jobCode);
  1879. editTicketPage.clickSave();
  1880.  
  1881. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  1882. });
  1883.  
  1884. it('should add line item and see hourly form', () => {
  1885. editTicketPage.clickNewLine();
  1886. editTicketPage.selectCategory('Hourly');
  1887. editTicketPage.selectSubCategory('All');
  1888. editTicketPage.clickSaveClose();
  1889.  
  1890. expect(editTicketPage.tittle.getText()).toEqual('Hourly');
  1891. });
  1892.  
  1893. it('should edit new line', () => {
  1894. editTicketPage.clickEditLine();
  1895. });
  1896.  
  1897. it('should set note', () => {
  1898. editTicketPage.fillLineNote(time);
  1899. });
  1900.  
  1901. it('should set rate and hours', () => {
  1902. editTicketPage.fillRate('10');
  1903. editTicketPage.fillHours('20');
  1904. });
  1905.  
  1906. it('should see total updates', () => {
  1907. expect(editTicketPage.getTotal()).toEqual('200.00');
  1908. });
  1909.  
  1910. it('should set discount', () => {
  1911. editTicketPage.fillDiscount('5');
  1912. });
  1913.  
  1914. it('should see total updates', () => {
  1915. expect(editTicketPage.getTotal()).toEqual('190.00');
  1916. });
  1917.  
  1918. it('should see minimum', () => {
  1919. editTicketPage.fillMinimum('100');
  1920. editTicketPage.clickLineNote();
  1921. });
  1922.  
  1923. it('should see total updates', () => {
  1924. expect(editTicketPage.getTotal()).toEqual('190.00');
  1925. });
  1926.  
  1927. it('should save line', () => {
  1928. editTicketPage.clickSaveClose();
  1929. });
  1930.  
  1931. it('should display saved line in Hourly table', () => {
  1932. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
  1933. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
  1934. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
  1935. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
  1936. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
  1937. });
  1938.  
  1939. /*it('should save ticket', () => {
  1940. editTicketPage.clickSave();
  1941. dashboardPage.openMenu('Tickets');
  1942. });
  1943.  
  1944. it('should search ticket', ()=> {
  1945. ticketsPage.selectSearchType('Location');
  1946. ticketsPage.searchTicket('Location' + time);
  1947. ticketsPage.clickDetails();
  1948. });
  1949.  
  1950. it('should edit new line', () => {
  1951. editTicketPage.clickEditLine();
  1952. });
  1953.  
  1954. it('should edit note', () => {
  1955. editTicketPage.fillLineNote(time + time);
  1956. });
  1957.  
  1958. it('should edit rate and hours', () => {
  1959. editTicketPage.fillRate('20');
  1960. editTicketPage.fillHours('30');
  1961. });
  1962.  
  1963. it('should see edited total updates', () => {
  1964. expect(editTicketPage.getTotal()).toEqual('570.00');
  1965. });
  1966.  
  1967. it('should edit discount', () => {
  1968. editTicketPage.fillDiscount('6');
  1969. });
  1970.  
  1971. it('should see edited total updates', () => {
  1972. expect(editTicketPage.getTotal()).toEqual('564.00');
  1973. });
  1974.  
  1975. it('should edit minimum', () => {
  1976. editTicketPage.fillMinimum('150');
  1977. editTicketPage.clickLineNote();
  1978. });
  1979.  
  1980. it('should see edited total updates', () => {
  1981. expect(editTicketPage.getTotal()).toEqual('564.00');
  1982. });
  1983.  
  1984. it('should save line', () => {
  1985. editTicketPage.clickSaveClose();
  1986. });
  1987.  
  1988. it('should display edited line in Hourly table', () => {
  1989. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$20.00/hr');
  1990. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('30 Hours');
  1991. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$150.00');
  1992. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$564.00');
  1993. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time + time);
  1994. });*/
  1995. });
  1996.  
  1997. describe('checking for add rental line item in ticket', () => {
  1998.  
  1999. var time = commonHelper.uniqueValue();
  2000.  
  2001. beforeAll(() => {
  2002. browser.get(loginLink);
  2003. });
  2004.  
  2005. afterAll(() => {
  2006. commonHelper.clearAllData();
  2007. });
  2008.  
  2009. it('should redirect on dashboard page after login', () => {
  2010. signInPage.login(username, password);
  2011. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2012.  
  2013. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2014. });
  2015.  
  2016. it('should click on plus button and select service ticket', () => {
  2017. dashboardPage.selectItem('Service Ticket');
  2018.  
  2019. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2020. });
  2021.  
  2022. it('should save ticket header', () => {
  2023. editTicketPage.fillLocation('Location' + time);
  2024. editTicketPage.fillAfe(afe);
  2025. editTicketPage.fillJobCode(jobCode);
  2026. editTicketPage.clickSave();
  2027.  
  2028. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2029. });
  2030.  
  2031. it('should add line item and see rental form', () => {
  2032. editTicketPage.clickNewLine();
  2033. editTicketPage.selectCategory('Rental');
  2034. editTicketPage.selectSubCategory('All');
  2035. editTicketPage.clickSaveClose();
  2036.  
  2037. expect(editTicketPage.tittle.getText()).toEqual('Rental');
  2038. });
  2039.  
  2040. it('should edit new line', () => {
  2041. editTicketPage.clickEditLine();
  2042. });
  2043.  
  2044. it('should set note', () => {
  2045. editTicketPage.fillLineNote(time);
  2046. });
  2047.  
  2048. it('should set rate and hours', () => {
  2049. editTicketPage.selectHour('Per day');
  2050. editTicketPage.fillRate('10');
  2051. editTicketPage.fillStandbyRate('10');
  2052. editTicketPage.fillHours('20');
  2053. editTicketPage.fillQuantity('30');
  2054. editTicketPage.fillDaysStandby('40');
  2055. });
  2056.  
  2057. it('should see total updates', () => {
  2058. expect(editTicketPage.getTotal()).toEqual('700.00');
  2059. });
  2060.  
  2061. it('should set discount', () => {
  2062. editTicketPage.fillDiscount('5');
  2063. });
  2064.  
  2065. it('should see total updates', () => {
  2066. expect(editTicketPage.getTotal()).toEqual('665.00');
  2067. });
  2068.  
  2069. it('should see minimum', () => {
  2070. editTicketPage.fillMinimum('300');
  2071. editTicketPage.clickLineNote();
  2072. });
  2073.  
  2074. it('should see total updates', () => {
  2075. expect(editTicketPage.getTotal()).toEqual('665.00');
  2076. });
  2077.  
  2078. it('should save line', () => {
  2079. editTicketPage.clickSaveClose();
  2080. });
  2081.  
  2082. it('should display saved line in Rental table', () => {
  2083. expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
  2084. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
  2085. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
  2086. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
  2087. expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
  2088. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
  2089. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
  2090. });
  2091.  
  2092. /*it('should save ticket', () => {
  2093. editTicketPage.clickSave();
  2094. dashboardPage.openMenu('Tickets');
  2095. });
  2096.  
  2097. it('should search ticket', () => {
  2098. ticketsPage.selectSearchType('Location');
  2099. ticketsPage.searchTicket('Location' + time);
  2100. ticketsPage.clickDetails();
  2101. });
  2102.  
  2103. it('should edit new line', () => {
  2104. editTicketPage.clickEditLine();
  2105. });
  2106.  
  2107. it('should set note', () => {
  2108. editTicketPage.fillLineNote(time + time);
  2109. });
  2110.  
  2111. it('should edit rate and hours', () => {
  2112. editTicketPage.selectHour('Per day');
  2113. editTicketPage.fillRate('20');
  2114. editTicketPage.fillStandbyRate('20');
  2115. editTicketPage.fillHours('30');
  2116. editTicketPage.fillQuantity('40');
  2117. editTicketPage.fillDaysStandby('50');
  2118. });
  2119.  
  2120. it('should see edited total updates', () => {
  2121. expect(editTicketPage.getTotal()).toEqual('1710.00');
  2122. });
  2123.  
  2124. it('should edit discount', () => {
  2125. editTicketPage.fillDiscount('6');
  2126. });
  2127.  
  2128. it('should see edited total updates', () => {
  2129. expect(editTicketPage.getTotal()).toEqual('1692.00');
  2130. });
  2131.  
  2132. it('should edit minimum', () => {
  2133. editTicketPage.fillMinimum('400');
  2134. editTicketPage.clickLineNote();
  2135. });
  2136.  
  2137. it('should see edited total updates', () => {
  2138. expect(editTicketPage.getTotal()).toEqual('1692.00');
  2139. });
  2140.  
  2141. it('should save line', () => {
  2142. editTicketPage.clickSaveClose();
  2143. });
  2144.  
  2145. it('should display saved line in Rental table', () => {
  2146. expect(editTicketPage.getRate('Rental', '1')).toEqual('$20.00/day');
  2147. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$20.00/day');
  2148. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('50 Days');
  2149. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('30 Days');
  2150. expect(editTicketPage.getMin('Rental', '1')).toEqual('$400.00');
  2151. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$1,692.00');
  2152. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time + time);
  2153. });*/
  2154. });
  2155.  
  2156. describe('checking for add service line item in ticket', () => {
  2157.  
  2158. var time = commonHelper.uniqueValue();
  2159.  
  2160. var tomorrowDate = new Date();
  2161. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  2162.  
  2163. beforeAll(() => {
  2164. browser.get(loginLink);
  2165. });
  2166.  
  2167. afterAll(() => {
  2168. commonHelper.clearAllData();
  2169. });
  2170.  
  2171. it('should redirect on dashboard page after login', () => {
  2172. signInPage.login(username, password);
  2173. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2174.  
  2175. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2176. });
  2177.  
  2178. it('should click on plus button and select service ticket', () => {
  2179. dashboardPage.selectItem('Service Ticket');
  2180.  
  2181. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2182. });
  2183.  
  2184. it('should save ticket header', () => {
  2185. editTicketPage.fillLocation('Location' + time);
  2186. editTicketPage.fillAfe(afe);
  2187. editTicketPage.fillJobCode(jobCode);
  2188. editTicketPage.clickSave();
  2189.  
  2190. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2191. });
  2192.  
  2193. it('should add line item and see service form', () => {
  2194. editTicketPage.clickNewLine();
  2195. editTicketPage.selectCategory('Service');
  2196. editTicketPage.selectSubCategory('All');
  2197. editTicketPage.clickSaveClose();
  2198.  
  2199. expect(editTicketPage.tittle.getText()).toEqual('Service');
  2200. });
  2201.  
  2202. it('should edit new line', () => {
  2203. editTicketPage.clickEditLine();
  2204. });
  2205.  
  2206. it('should set note', () => {
  2207. editTicketPage.fillLineNote(time);
  2208. });
  2209.  
  2210. it('should select hour', () => {
  2211. editTicketPage.selectHour('Each');
  2212. });
  2213.  
  2214. it('should set start date',() => {
  2215. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  2216. editTicketPage.fillStartHour('10');
  2217. editTicketPage.fillStartMinutes('15');
  2218. });
  2219.  
  2220. it('should set end date',() => {
  2221. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  2222. editTicketPage.fillEndHour('10');
  2223. editTicketPage.fillEndMinutes('30');
  2224. });
  2225.  
  2226. it('should set rate and hours', () => {
  2227. editTicketPage.fillQuantity('20');
  2228. editTicketPage.fillRate('10');
  2229. editTicketPage.fillHours('20');
  2230. });
  2231.  
  2232. it('should see total updates', () => {
  2233. expect(editTicketPage.getTotal()).toEqual('200.00');
  2234. });
  2235.  
  2236. it('should set discount', () => {
  2237. editTicketPage.fillDiscount('5');
  2238. });
  2239.  
  2240. it('should see total updates', () => {
  2241. expect(editTicketPage.getTotal()).toEqual('190.00');
  2242. });
  2243.  
  2244. it('should see minimum', () => {
  2245. editTicketPage.fillMinimum('100');
  2246. editTicketPage.clickLineNote();
  2247. });
  2248.  
  2249. it('should see total updates', () => {
  2250. expect(editTicketPage.getTotal()).toEqual('190.00');
  2251. });
  2252.  
  2253. it('should save line', () => {
  2254. editTicketPage.clickSaveClose();
  2255. });
  2256.  
  2257. it('should display saved line in service table', () => {
  2258. expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
  2259. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
  2260. expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
  2261. expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
  2262. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
  2263. expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
  2264. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
  2265. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
  2266. });
  2267.  
  2268. /*it('should save ticket', () => {
  2269. editTicketPage.clickSave();
  2270. dashboardPage.openMenu('Tickets');
  2271. });
  2272.  
  2273. it('should search ticket', ()=> {
  2274. ticketsPage.selectSearchType('Location');
  2275. ticketsPage.searchTicket('Location' + time);
  2276. ticketsPage.clickDetails();
  2277. });
  2278.  
  2279. it('should edit new line', () => {
  2280. editTicketPage.clickEditLine();
  2281. });
  2282.  
  2283. it('should edit note', () => {
  2284. editTicketPage.fillLineNote(time + time);
  2285. });
  2286.  
  2287. it('should select hour', () => {
  2288. editTicketPage.selectHour('Each');
  2289. });
  2290.  
  2291. it('should edit start date',() => {
  2292. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  2293. editTicketPage.fillStartHour('15');
  2294. editTicketPage.fillStartMinutes('30');
  2295. });
  2296.  
  2297. it('should set end date',() => {
  2298. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  2299. editTicketPage.fillEndHour('15');
  2300. editTicketPage.fillEndMinutes('45');
  2301. });
  2302.  
  2303. it('should edit rate and hours', () => {
  2304. editTicketPage.fillQuantity('30');
  2305. editTicketPage.fillRate('20');
  2306. editTicketPage.fillHours('30');
  2307. });
  2308.  
  2309. it('should see edited total updates', () => {
  2310. expect(editTicketPage.getTotal()).toEqual('570.00');
  2311. });
  2312.  
  2313. it('should edit discount', () => {
  2314. editTicketPage.fillDiscount('7');
  2315. });
  2316.  
  2317. it('should see edited total updates', () => {
  2318. expect(editTicketPage.getTotal()).toEqual('558.00');
  2319. });
  2320.  
  2321. it('should edit minimum', () => {
  2322. editTicketPage.fillMinimum('200');
  2323. editTicketPage.clickLineNote();
  2324. });
  2325.  
  2326. it('should see edited total updates', () => {
  2327. expect(editTicketPage.getTotal()).toEqual('558.00');
  2328. });
  2329.  
  2330. it('should save line', () => {
  2331. editTicketPage.clickSaveClose();
  2332. });
  2333.  
  2334. it('should display saved line in service table', () => {
  2335. expect(editTicketPage.getRate('Service', '1')).toEqual('$20.00/ea');
  2336. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('30 Units');
  2337. expect(editTicketPage.getMin('Service', '1')).toEqual('$200.00');
  2338. expect(editTicketPage.getAmount('Service', '1')).toEqual('$558.00');
  2339. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('30 Units');
  2340. expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time + time);
  2341. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:30:00 PM');
  2342. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:45:00 PM');
  2343. });*/
  2344. });
  2345.  
  2346. describe('checking for add miscellaneous line item in ticket', () => {
  2347.  
  2348. var time = commonHelper.uniqueValue();
  2349.  
  2350. beforeAll(() => {
  2351. browser.get(loginLink);
  2352. });
  2353.  
  2354. afterAll(() => {
  2355. commonHelper.clearAllData();
  2356. });
  2357.  
  2358. it('should redirect on dashboard page after login', () => {
  2359. signInPage.login(username, password);
  2360. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2361.  
  2362. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2363. });
  2364.  
  2365. it('should click on plus button and select service ticket', () => {
  2366. dashboardPage.selectItem('Service Ticket');
  2367.  
  2368. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2369. });
  2370.  
  2371. it('should save ticket header', () => {
  2372. editTicketPage.fillLocation('Location' + time);
  2373. editTicketPage.fillAfe(afe);
  2374. editTicketPage.fillJobCode(jobCode);
  2375. editTicketPage.clickSave();
  2376.  
  2377. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2378. });
  2379.  
  2380. it('should add line item and see Miscellaneous form', () => {
  2381. editTicketPage.clickNewLine();
  2382. editTicketPage.selectCategory('Miscellaneous');
  2383. });
  2384.  
  2385. it('should set note', () => {
  2386. editTicketPage.fillLineNote(time);
  2387. });
  2388.  
  2389. it('should set rate and hours', () => {
  2390. editTicketPage.selectHour('week');
  2391. editTicketPage.fillStandbyRate('10');
  2392. editTicketPage.fillRate('10');
  2393. editTicketPage.fillDaysStandby('40');
  2394. editTicketPage.fillHours('20');
  2395. editTicketPage.fillQuantity('30');
  2396. });
  2397.  
  2398. it('should see total updates', () => {
  2399. expect(editTicketPage.getTotal()).toEqual('700.00');
  2400. });
  2401.  
  2402. it('should set discount', () => {
  2403. editTicketPage.fillDiscount('5');
  2404. });
  2405.  
  2406. it('should see total updates', () => {
  2407. expect(editTicketPage.getTotal()).toEqual('665.00');
  2408. });
  2409.  
  2410. it('should see minimum', () => {
  2411. editTicketPage.fillMinimum('100');
  2412. editTicketPage.clickLineNote();
  2413. });
  2414.  
  2415. it('should see total updates', () => {
  2416. expect(editTicketPage.getTotal()).toEqual('665.00');
  2417. });
  2418.  
  2419. it('should save line', () => {
  2420. editTicketPage.clickSaveClose();
  2421. });
  2422.  
  2423. it('should display saved line in other table', () => {
  2424. expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
  2425. expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
  2426. expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
  2427. });
  2428. });
  2429.  
  2430. describe('checking for add new signature', () => {
  2431.  
  2432. var time = commonHelper.uniqueValue();
  2433.  
  2434. beforeAll(() => {
  2435. browser.get(loginLink);
  2436. });
  2437.  
  2438. afterAll(() => {
  2439. commonHelper.clearAllData();
  2440. });
  2441.  
  2442. it('should redirect on dashboard page after login', () => {
  2443. signInPage.login(username, password);
  2444. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2445.  
  2446. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2447. });
  2448.  
  2449. it('should click on plus button and select service ticket', () => {
  2450. dashboardPage.selectItem('Service Ticket');
  2451.  
  2452. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2453. });
  2454.  
  2455. it('should save ticket header', () => {
  2456. editTicketPage.fillLocation('Location' + time);
  2457. editTicketPage.fillAfe(afe);
  2458. editTicketPage.fillJobCode(jobCode);
  2459. editTicketPage.clickSave();
  2460.  
  2461. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2462. });
  2463.  
  2464. it('should click on add signature button', () => {
  2465. editTicketPage.clickAddSignature();
  2466. expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
  2467. });
  2468.  
  2469. it('should add signature ', () => {
  2470. editTicketPage.fillSignatureName(username);
  2471. editTicketPage.selectSignatureStyle();
  2472. editTicketPage.fillSignatureEmail(password);
  2473. editTicketPage.selectSignatureCertify();
  2474. });
  2475.  
  2476. it('should rate signature and feedback', () => {
  2477. editTicketPage.ratePunctuality();
  2478. editTicketPage.rateCompetence();
  2479. editTicketPage.rateProfessionalism();
  2480. editTicketPage.fillFeedback(time)
  2481. });
  2482.  
  2483. it('should click on checkbox signature', () => {
  2484. editTicketPage.btnCheckboxSignature.click();
  2485. expect(editTicketPage.chkSignature().isPresent()).toBe(true);
  2486. });
  2487.  
  2488. it('should save signature', () => {
  2489. editTicketPage.clickSaveSignature();
  2490. expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
  2491. });
  2492. });
  2493.  
  2494. describe('checking for add note', () => {
  2495.  
  2496. var time = commonHelper.uniqueValue();
  2497. var note = commonHelper.randomString(36, 10);
  2498.  
  2499. beforeAll(() => {
  2500. browser.get(loginLink);
  2501. });
  2502.  
  2503. afterAll(() => {
  2504. commonHelper.clearAllData();
  2505. });
  2506.  
  2507. it('should redirect on dashboard page after login', () => {
  2508. signInPage.login(username, password);
  2509. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2510.  
  2511. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2512. });
  2513.  
  2514. it('should click on plus button and select service ticket', () => {
  2515. dashboardPage.selectItem('Service Ticket');
  2516.  
  2517. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2518. });
  2519.  
  2520. it('should save ticket header', () => {
  2521. editTicketPage.fillLocation('Location' + time);
  2522. editTicketPage.fillAfe(afe);
  2523. editTicketPage.fillJobCode(jobCode);
  2524. editTicketPage.clickSave();
  2525.  
  2526. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2527. });
  2528.  
  2529. it('should click on add note',() => {
  2530. editTicketPage.clickAddNotes();
  2531. expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
  2532. });
  2533.  
  2534. it('should add notes', () => {
  2535. editTicketPage.fillNote(note);
  2536. editTicketPage.clickSaveNote();
  2537. });
  2538.  
  2539. it('should see note', () => {
  2540. commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
  2541. expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
  2542. });
  2543. });
  2544.  
  2545. describe('checking for add new member', () => {
  2546.  
  2547. var time = commonHelper.uniqueValue();
  2548. var user = 'Admin Selenium';
  2549.  
  2550. beforeAll(() => {
  2551. browser.get(loginLink);
  2552. });
  2553.  
  2554. afterAll(() => {
  2555. commonHelper.clearAllData();
  2556. });
  2557.  
  2558. it('should redirect on dashboard page after login', () => {
  2559. signInPage.login(username, password);
  2560. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2561.  
  2562. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2563. });
  2564.  
  2565. it('should click on plus button and select service ticket', () => {
  2566. dashboardPage.selectItem('Service Ticket');
  2567.  
  2568. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2569. });
  2570.  
  2571. it('should save ticket header', () => {
  2572. editTicketPage.fillLocation('Location' + time);
  2573. editTicketPage.fillAfe(afe);
  2574. editTicketPage.fillJobCode(jobCode);
  2575. editTicketPage.clickSave();
  2576.  
  2577. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2578. });
  2579.  
  2580. it('should click add member',() => {
  2581. editTicketPage.clickAddMember();
  2582. expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
  2583. });
  2584.  
  2585. it('should add member',() => {
  2586. editTicketPage.memberCheckbox(user).click();
  2587. expect(editTicketPage.chkMember().isPresent()).toBe(true);
  2588. editTicketPage.clickMemberSaved();
  2589. });
  2590.  
  2591. it('should see new member', () => {
  2592. expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
  2593. });
  2594. });
  2595.  
  2596. describe('checking for add new attachment', () => {
  2597.  
  2598. beforeAll(() => {
  2599. browser.get(loginLink);
  2600. });
  2601.  
  2602. afterAll(() => {
  2603. commonHelper.clearAllData();
  2604. });
  2605.  
  2606. it('should redirect on dashboard page after login', () => {
  2607. signInPage.login(username, password);
  2608. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2609.  
  2610. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2611. });
  2612.  
  2613. it('should click on plus button and select service ticket', () => {
  2614. dashboardPage.selectItem('Service Ticket');
  2615.  
  2616. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2617. });
  2618.  
  2619. it('should save ticket header', () => {
  2620. editTicketPage.fillLocation('Location' + commonHelper.uniqueValue());
  2621. editTicketPage.fillAfe(afe);
  2622. editTicketPage.fillJobCode(jobCode);
  2623. editTicketPage.clickSave();
  2624.  
  2625. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2626. });
  2627.  
  2628. it('should click add attachment',() => {
  2629. editTicketPage.clickAddAttachment();
  2630.  
  2631. expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
  2632. });
  2633.  
  2634. it('should add new attachment',() => {
  2635. editTicketPage.uploadAttachment('index.jpg');
  2636. editTicketPage.clickSaveAttachment();
  2637.  
  2638. expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
  2639. });
  2640. });
  2641.  
  2642. describe('checking for add hourly line item with errors', () => {
  2643.  
  2644. var time = commonHelper.uniqueValue();
  2645.  
  2646. beforeAll(() => {
  2647. browser.get(loginLink);
  2648. });
  2649.  
  2650. afterAll(() => {
  2651. commonHelper.clearAllData();
  2652. });
  2653.  
  2654. it('should redirect on dashboard page after login', () => {
  2655. signInPage.login(username, password);
  2656. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2657.  
  2658. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2659. });
  2660.  
  2661. it('should click on plus button and select service ticket', () => {
  2662. dashboardPage.selectItem('Service Ticket');
  2663.  
  2664. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2665. });
  2666.  
  2667. it('should save ticket header', () => {
  2668. editTicketPage.fillLocation('Location' + time);
  2669. editTicketPage.fillAfe(afe);
  2670. editTicketPage.fillJobCode(jobCode);
  2671. editTicketPage.clickSave();
  2672.  
  2673. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2674. });
  2675.  
  2676. it('should add line item and see hourly form', () => {
  2677. editTicketPage.clickNewLine();
  2678. editTicketPage.selectCategory('Hourly');
  2679. editTicketPage.selectSubCategory('All');
  2680. editTicketPage.clickSaveClose();
  2681.  
  2682. expect(editTicketPage.tittle.getText()).toEqual('Hourly');
  2683. });
  2684.  
  2685. it('should edit new line', () => {
  2686. editTicketPage.clickEditLine();
  2687. });
  2688.  
  2689. it('should set note', () => {
  2690. editTicketPage.fillLineNote(time);
  2691. });
  2692.  
  2693. it('should set rate and hours', () => {
  2694. editTicketPage.fillRate('qwe');
  2695. editTicketPage.fillHours('qwe');
  2696. });
  2697.  
  2698. it('should see total updates', () => {
  2699. expect(editTicketPage.getTotal()).toEqual('0.00');
  2700. });
  2701.  
  2702. it('should set discount', () => {
  2703. editTicketPage.fillDiscount('qwe');
  2704. });
  2705.  
  2706. it('should see total updates', () => {
  2707. expect(editTicketPage.getTotal()).toEqual('0.00');
  2708. });
  2709.  
  2710. it('should see minimum', () => {
  2711. editTicketPage.fillMinimum('qwe');
  2712. editTicketPage.clickLineNote();
  2713. });
  2714.  
  2715. it('should see total updates', () => {
  2716. expect(editTicketPage.getTotal()).toEqual('0.00');
  2717. });
  2718.  
  2719. it('should save line and see errors', () => {
  2720. editTicketPage.clickSaveClose();
  2721. browser.sleep(2000);
  2722. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  2723. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  2724. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  2725. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  2726. });
  2727. });
  2728.  
  2729. describe('checking for add rental line item in ticket with errors', () => {
  2730.  
  2731. var time = commonHelper.uniqueValue();
  2732.  
  2733. beforeAll(() => {
  2734. browser.get(loginLink);
  2735. });
  2736.  
  2737. afterAll(() => {
  2738. commonHelper.clearAllData();
  2739. });
  2740.  
  2741. it('should redirect on dashboard page after login', () => {
  2742. signInPage.login(username, password);
  2743. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2744.  
  2745. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2746. });
  2747.  
  2748. it('should click on plus button and select service ticket', () => {
  2749. dashboardPage.selectItem('Service Ticket');
  2750.  
  2751. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2752. });
  2753.  
  2754. it('should save ticket header', () => {
  2755. editTicketPage.fillLocation('Location' + time);
  2756. editTicketPage.fillAfe(afe);
  2757. editTicketPage.fillJobCode(jobCode);
  2758. editTicketPage.clickSave();
  2759.  
  2760. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2761. });
  2762.  
  2763. it('should add line item and see rental form', () => {
  2764. editTicketPage.clickNewLine();
  2765. editTicketPage.selectCategory('Rental');
  2766. editTicketPage.selectSubCategory('All');
  2767. editTicketPage.clickSaveClose();
  2768.  
  2769. expect(editTicketPage.tittle.getText()).toEqual('Rental');
  2770. });
  2771.  
  2772. it('should edit new line', () => {
  2773. editTicketPage.clickEditLine();
  2774. });
  2775.  
  2776. it('should set note', () => {
  2777. editTicketPage.fillLineNote(time);
  2778. });
  2779.  
  2780. it('should set rate and hours', () => {
  2781. editTicketPage.selectHour('Per day');
  2782. editTicketPage.fillRate('qwe');
  2783. editTicketPage.fillStandbyRate('qwe');
  2784. editTicketPage.fillHours('qwe');
  2785. editTicketPage.fillQuantity('qwe');
  2786. editTicketPage.fillDaysStandby('qwe');
  2787. });
  2788.  
  2789. it('should see total updates', () => {
  2790. expect(editTicketPage.getTotal()).toEqual('0.00');
  2791. });
  2792.  
  2793. it('should set discount', () => {
  2794. editTicketPage.fillDiscount('qwe');
  2795. });
  2796.  
  2797. it('should see total updates', () => {
  2798. expect(editTicketPage.getTotal()).toEqual('0.00');
  2799. });
  2800.  
  2801. it('should see minimum', () => {
  2802. editTicketPage.fillMinimum('qwe');
  2803. editTicketPage.clickLineNote();
  2804. });
  2805.  
  2806. it('should see total updates', () => {
  2807. expect(editTicketPage.getTotal()).toEqual('0.00');
  2808. });
  2809.  
  2810. it('should save line', () => {
  2811. editTicketPage.clickSaveClose();
  2812. });
  2813.  
  2814. it('should save line and see errors', () => {
  2815. editTicketPage.clickSaveClose();
  2816. browser.sleep(2000);
  2817. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  2818. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  2819. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  2820. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  2821. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  2822. });
  2823. });
  2824.  
  2825. describe('checking for add service line item in ticket with errors', () => {
  2826.  
  2827. var time = commonHelper.uniqueValue();
  2828.  
  2829. var tomorrowDate = new Date();
  2830. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  2831.  
  2832. beforeAll(() => {
  2833. browser.get(loginLink);
  2834. });
  2835.  
  2836. afterAll(() => {
  2837. commonHelper.clearAllData();
  2838. });
  2839.  
  2840. it('should redirect on dashboard page after login', () => {
  2841. signInPage.login(username, password);
  2842. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2843.  
  2844. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2845. });
  2846.  
  2847. it('should click on plus button and select service ticket', () => {
  2848. dashboardPage.selectItem('Service Ticket');
  2849.  
  2850. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2851. });
  2852.  
  2853. it('should save ticket header', () => {
  2854. editTicketPage.fillLocation('Location' + time);
  2855. editTicketPage.fillAfe(afe);
  2856. editTicketPage.fillJobCode(jobCode);
  2857. editTicketPage.clickSave();
  2858.  
  2859. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2860. });
  2861.  
  2862. it('should add line item and see service form', () => {
  2863. editTicketPage.clickNewLine();
  2864. editTicketPage.selectCategory('Service');
  2865. editTicketPage.selectSubCategory('All');
  2866. editTicketPage.clickSaveClose();
  2867.  
  2868. expect(editTicketPage.tittle.getText()).toEqual('Service');
  2869. });
  2870.  
  2871. it('should edit new line', () => {
  2872. editTicketPage.clickEditLine();
  2873. });
  2874.  
  2875. it('should set note', () => {
  2876. editTicketPage.fillLineNote(time);
  2877. });
  2878.  
  2879. it('should select hour', () => {
  2880. editTicketPage.selectHour('Each');
  2881. });
  2882.  
  2883. it('should set start date',() => {
  2884. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  2885. editTicketPage.fillStartHour('qwe');
  2886. editTicketPage.fillStartMinutes('qwe');
  2887. });
  2888.  
  2889. it('should set end date',() => {
  2890. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  2891. editTicketPage.fillEndHour('qwe');
  2892. editTicketPage.fillEndMinutes('qwe');
  2893. });
  2894.  
  2895. it('should set rate and hours', () => {
  2896. editTicketPage.fillQuantity('qwe');
  2897. editTicketPage.fillRate('qwe');
  2898. editTicketPage.fillHours('qwe');
  2899. });
  2900.  
  2901. it('should see total updates', () => {
  2902. expect(editTicketPage.getTotal()).toEqual('0.00');
  2903. });
  2904.  
  2905. it('should set discount', () => {
  2906. editTicketPage.fillDiscount('qwe');
  2907. });
  2908.  
  2909. it('should see total updates', () => {
  2910. expect(editTicketPage.getTotal()).toEqual('0.00');
  2911. });
  2912.  
  2913. it('should see minimum', () => {
  2914. editTicketPage.fillMinimum('qwe');
  2915. editTicketPage.clickLineNote();
  2916. });
  2917.  
  2918. it('should see total updates', () => {
  2919. expect(editTicketPage.getTotal()).toEqual('0.00');
  2920. });
  2921.  
  2922. it('should save line', () => {
  2923. editTicketPage.clickSaveClose();
  2924. });
  2925.  
  2926. it('should save line and see errors', () => {
  2927. editTicketPage.clickSaveClose();
  2928. browser.sleep(2000);
  2929. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  2930. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  2931. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  2932. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  2933. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  2934. });
  2935. });
  2936.  
  2937. describe('checking for add miscellaneous line item in ticket with errors', () => {
  2938.  
  2939. var time = commonHelper.uniqueValue();
  2940.  
  2941. beforeAll(() => {
  2942. browser.get(loginLink);
  2943. });
  2944.  
  2945. afterAll(() => {
  2946. commonHelper.clearAllData();
  2947. });
  2948.  
  2949. it('should redirect on dashboard page after login', () => {
  2950. signInPage.login(username, password);
  2951. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  2952.  
  2953. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  2954. });
  2955.  
  2956. it('should click on plus button and select service ticket', () => {
  2957. dashboardPage.selectItem('Service Ticket');
  2958.  
  2959. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  2960. });
  2961.  
  2962. it('should save ticket header', () => {
  2963. editTicketPage.fillLocation('Location' + time);
  2964. editTicketPage.fillAfe(afe);
  2965. editTicketPage.fillJobCode(jobCode);
  2966. editTicketPage.clickSave();
  2967.  
  2968. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  2969. });
  2970.  
  2971. it('should add line item and see Miscellaneous form', () => {
  2972. editTicketPage.clickNewLine();
  2973. editTicketPage.selectCategory('Miscellaneous');
  2974. });
  2975.  
  2976. it('should set note', () => {
  2977. editTicketPage.fillLineNote(time);
  2978. });
  2979.  
  2980. it('should set rate and hours', () => {
  2981. editTicketPage.selectHour('week');
  2982. editTicketPage.fillStandbyRate('qwe');
  2983. editTicketPage.fillRate('qwe');
  2984. editTicketPage.fillDaysStandby('qwe');
  2985. editTicketPage.fillHours('qwe');
  2986. editTicketPage.fillQuantity('qwe');
  2987. });
  2988.  
  2989. it('should see total updates', () => {
  2990. expect(editTicketPage.getTotal()).toEqual('0.00');
  2991. });
  2992.  
  2993. it('should set discount', () => {
  2994. editTicketPage.fillDiscount('qwe');
  2995. });
  2996.  
  2997. it('should see total updates', () => {
  2998. expect(editTicketPage.getTotal()).toEqual('0.00');
  2999. });
  3000.  
  3001. it('should see minimum', () => {
  3002. editTicketPage.fillMinimum('qwe');
  3003. editTicketPage.clickLineNote();
  3004. });
  3005.  
  3006. it('should see total updates', () => {
  3007. expect(editTicketPage.getTotal()).toEqual('0.00');
  3008. });
  3009.  
  3010. it('should save line and see errors', () => {
  3011. editTicketPage.clickSaveClose();
  3012. browser.sleep(2000);
  3013. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  3014. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  3015. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  3016. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  3017. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  3018. });
  3019. });
  3020. });
  3021. ---------------------------------------------------------------
  3022. wells.spec
  3023.  
  3024. 'use strict';
  3025.  
  3026. const pageObject = require('./../../services').container.PageObject;
  3027. const signInPage = pageObject.getSignInPage();
  3028. const dashboardPage = pageObject.getDashboardPage();
  3029. const wellsPage = pageObject.getWellsPage();
  3030. const addWellsPage = pageObject.getAddWellsPage();
  3031. const viewPage = pageObject.getViewPage();
  3032. const skuPage = pageObject.getSkuPage();
  3033. const addSkuPage = pageObject.getAddSkuPage();
  3034. const signInData = require('./../../data/sign_in');
  3035. const dashboardData = require('./../../data/dashboard');
  3036. const wellsData = require('./../../data/oil_field/wells');
  3037. const commonHelper = require('./../../services/helpers/common.helper');
  3038. var strftime = require('strftime');
  3039.  
  3040. describe('Wells', () => {
  3041.  
  3042. var username = signInData.adminAccount.username;
  3043. var password = signInData.adminAccount.password;
  3044. var owner = wellsData.addWells.owner;
  3045. var location = wellsData.addWells.location;
  3046. var latitude = wellsData.addWells.latitude;
  3047. var longitude = wellsData.addWells.longitude;
  3048. var description = wellsData.addWells.description;
  3049. var direction = wellsData.addWells.direction;
  3050. var addSkuTittle = wellsData.addWells.tittle;
  3051.  
  3052. beforeAll(() => {
  3053. browser.ignoreSynchronization = false;
  3054. browser.driver.manage().window().setSize(1440, 900);
  3055. });
  3056.  
  3057. afterAll(() => {
  3058. commonHelper.clearAllData();
  3059. });
  3060.  
  3061. describe('checking for add new wells location', () => {
  3062.  
  3063. var time = commonHelper.uniqueValue();
  3064.  
  3065. beforeAll(() => {
  3066. browser.get(signInData.link);
  3067. });
  3068.  
  3069. afterAll(() => {
  3070. commonHelper.clearAllData();
  3071. });
  3072.  
  3073. it('should redirect on dashboard page after login', () => {
  3074. signInPage.login(username, password);
  3075. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3076.  
  3077. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3078. });
  3079.  
  3080. it('should click on wells in menu', () => {
  3081. dashboardPage.openMenu('Oil Field');
  3082. dashboardPage.clickWells();
  3083. });
  3084.  
  3085. it('should click on add wells', () => {
  3086. wellsPage.clickAddLocation();
  3087.  
  3088. expect(addSkuPage.pageTitle()).toEqual(addSkuTittle);
  3089. });
  3090.  
  3091. it('should add wells', () => {
  3092. addWellsPage.selectOwnerWells(owner);
  3093. addWellsPage.fillLocation(location + time);
  3094. addWellsPage.fillLatitude(latitude);
  3095. addWellsPage.fillLongtitude(longitude);
  3096. addWellsPage.fillDescription(description + time);
  3097. addWellsPage.fillDirection(direction + time);
  3098.  
  3099. addWellsPage.clickSave();
  3100. commonHelper.waitUntilElementVisible(wellsPage.txtSearch);
  3101. });
  3102.  
  3103. /*
  3104. Disabled due to problem with search
  3105. it('should search wells', () => {
  3106. wellsPage.fillSearch(time);
  3107. });
  3108.  
  3109. it('should click on wells details',()=>{
  3110. skuPage.clickDetails();
  3111. commonHelper.waitUntilElementPresent(viewPage.btnBack);
  3112. });
  3113.  
  3114. it('should see wells details',()=>{
  3115. expect(viewPage.pageTitle(location + time).isDisplayed()).toBe(true);
  3116. expect(viewPage.getTable(description + time).isDisplayed()).toBe(true);
  3117. expect(viewPage.getTable('Roosevelt').isDisplayed()).toBe(true);
  3118. });
  3119. */
  3120. });
  3121.  
  3122. describe('checking for cancel adding well', () => {
  3123.  
  3124. var time = commonHelper.uniqueValue();
  3125.  
  3126. beforeAll(() => {
  3127. browser.get(signInData.link);
  3128. });
  3129.  
  3130. afterAll(() => {
  3131. commonHelper.clearAllData();
  3132. });
  3133.  
  3134. it('should redirect on dashboard page after login', () => {
  3135. signInPage.login(username, password);
  3136. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3137.  
  3138. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3139. });
  3140.  
  3141. it('should click on wells in menu', () => {
  3142. dashboardPage.openMenu('Oil Field');
  3143. dashboardPage.clickWells();
  3144. });
  3145.  
  3146. it('should click on add wells', () => {
  3147. wellsPage.clickAddLocation();
  3148.  
  3149. expect(addSkuPage.pageTitle()).toEqual(addSkuTittle);
  3150. });
  3151.  
  3152. it('should fill field and cancel wells', () => {
  3153. addWellsPage.selectOwnerWells(owner);
  3154. addWellsPage.fillLocation(location + time);
  3155. addWellsPage.fillLatitude(latitude);
  3156. addWellsPage.fillLongtitude(longitude);
  3157. addWellsPage.fillDescription(description + time);
  3158. addWellsPage.fillDirection(direction + time);
  3159.  
  3160. dashboardPage.clickCancel();
  3161. commonHelper.waitUntilElementVisible(wellsPage.txtSearch);
  3162. });
  3163.  
  3164. /*
  3165. Disabled due to problem with search
  3166. it('should search wells', () => {
  3167. wellsPage.fillSearch(time);
  3168. });
  3169.  
  3170. it('should click on wells details',()=>{
  3171. skuPage.clickDetails();
  3172. commonHelper.waitUntilElementPresent(viewPage.btnBack);
  3173. });
  3174.  
  3175. it('should see wells details',()=>{
  3176. expect(viewPage.pageTitle(location + time).isDisplayed()).toBe(true);
  3177. expect(viewPage.getTable(description + time).isDisplayed()).toBe(true);
  3178. expect(viewPage.getTable('Roosevelt').isDisplayed()).toBe(true);
  3179. });
  3180. */
  3181. });
  3182. });
  3183. -----------------------------------------------------------
  3184. workover_ticket.spec
  3185.  
  3186. 'use strict';
  3187.  
  3188. const pageObject = require('./../../../services/index').container.PageObject;
  3189. const signInPage = pageObject.getSignInPage();
  3190. const dashboardPage = pageObject.getDashboardPage();
  3191. const editTicketPage = pageObject.getEditTicketPage();
  3192. const signInData = require('./../../../data/sign_in/index');
  3193. const dashboardData = require('./../../../data/dashboard/index');
  3194. const ticketsData = require('./../../../data/tickets/index');
  3195. const commonHelper = require('./../../../services/helpers/common.helper.js');
  3196. var strftime = require('strftime');
  3197.  
  3198. describe('workover tickets', () => {
  3199.  
  3200. var loginLink = signInData.link;
  3201. var username = signInData.adminAccount.username;
  3202. var password = signInData.adminAccount.password;
  3203. var afe = ticketsData.ticket.afe;
  3204. var jobCode = ticketsData.ticket.jobCode;
  3205. var errorMessage = ticketsData.errorMessage;
  3206.  
  3207. beforeAll(() => {
  3208. browser.ignoreSynchronization = false;
  3209. browser.driver.manage().window().setSize(1440, 900);
  3210. });
  3211.  
  3212. afterAll(() => {
  3213. commonHelper.clearAllData();
  3214. });
  3215.  
  3216. describe('checking for add hourly line item in workover ticket', () => {
  3217.  
  3218. var time = commonHelper.uniqueValue();
  3219.  
  3220. beforeAll(() => {
  3221. browser.get(loginLink);
  3222. });
  3223.  
  3224. afterAll(() => {
  3225. commonHelper.clearAllData();
  3226. });
  3227.  
  3228. it('should redirect on dashboard page after login', () => {
  3229. signInPage.login(username, password);
  3230. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3231.  
  3232. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3233. });
  3234.  
  3235. it('should click on plus button and select workover ticket', () => {
  3236. dashboardPage.selectItem('Workover Service Ticket');
  3237.  
  3238. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3239. });
  3240.  
  3241. it('should save ticket header', () => {
  3242. editTicketPage.fillLocation('Location' + time);
  3243. editTicketPage.fillAfe(afe);
  3244. editTicketPage.fillJobCode(jobCode);
  3245.  
  3246. editTicketPage.clickSave();
  3247.  
  3248. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3249. });
  3250.  
  3251. it('should add line item and see hourly form', () => {
  3252. editTicketPage.clickNewLine();
  3253. editTicketPage.selectCategory('Hourly');
  3254. editTicketPage.selectSubCategory('All');
  3255. editTicketPage.clickSaveClose();
  3256. });
  3257.  
  3258. it('should edit new line', () => {
  3259. editTicketPage.clickEditLineItem('Hourly');
  3260. });
  3261.  
  3262. it('should set note', () => {
  3263. editTicketPage.fillLineNote(time);
  3264. });
  3265.  
  3266. it('should set rate and hours', () => {
  3267. editTicketPage.fillRate('10');
  3268. editTicketPage.fillHours('20');
  3269. });
  3270.  
  3271. it('should see total updates', () => {
  3272. expect(editTicketPage.getTotal()).toEqual('200.00');
  3273. });
  3274.  
  3275. it('should set discount', () => {
  3276. editTicketPage.fillDiscount('5');
  3277. });
  3278.  
  3279. it('should see total updates', () => {
  3280. expect(editTicketPage.getTotal()).toEqual('190.00');
  3281. });
  3282.  
  3283. it('should see minimum', () => {
  3284. editTicketPage.fillMinimum('100');
  3285. editTicketPage.clickLineNote();
  3286. });
  3287.  
  3288. it('should see total updates', () => {
  3289. expect(editTicketPage.getTotal()).toEqual('190.00');
  3290. });
  3291.  
  3292. it('should save line', () => {
  3293. editTicketPage.clickSaveClose();
  3294. });
  3295.  
  3296. it('should display saved line in Hourly table', () => {
  3297. expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
  3298. expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
  3299. expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
  3300. expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
  3301. expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
  3302. });
  3303. });
  3304.  
  3305. describe('checking for add rental line item in workover ticket', () => {
  3306.  
  3307. var time = commonHelper.uniqueValue();
  3308.  
  3309. beforeAll(() => {
  3310. browser.get(loginLink);
  3311. });
  3312.  
  3313. afterAll(() => {
  3314. commonHelper.clearAllData();
  3315. });
  3316.  
  3317. it('should redirect on dashboard page after login', () => {
  3318. signInPage.login(username, password);
  3319. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3320.  
  3321. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3322. });
  3323.  
  3324. it('should click on plus button and select workover ticket', () => {
  3325. dashboardPage.selectItem('Workover Service Ticket');
  3326.  
  3327. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3328. });
  3329.  
  3330. it('should save ticket header', () => {
  3331. editTicketPage.fillLocation('Location' + time);
  3332. editTicketPage.fillAfe(afe);
  3333. editTicketPage.fillJobCode(jobCode);
  3334.  
  3335. editTicketPage.clickSave();
  3336.  
  3337. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3338. });
  3339.  
  3340. it('should add line item and see rental form', () => {
  3341. editTicketPage.clickNewLine();
  3342. editTicketPage.selectCategory('Rental');
  3343. editTicketPage.selectSubCategory('All');
  3344. editTicketPage.clickSaveClose();
  3345. });
  3346.  
  3347. it('should edit new line', () => {
  3348. editTicketPage.clickEditLineItem('Rental');
  3349. });
  3350.  
  3351. it('should set note', () => {
  3352. editTicketPage.fillLineNote(time);
  3353. });
  3354.  
  3355. it('should set rate and hours', () => {
  3356. editTicketPage.selectHour('Per day');
  3357. editTicketPage.fillRate('10');
  3358. editTicketPage.fillStandbyRate('10');
  3359. editTicketPage.fillHours('20');
  3360. editTicketPage.fillQuantity('30');
  3361. editTicketPage.fillDaysStandby('40');
  3362. });
  3363.  
  3364. it('should see total updates', () => {
  3365. expect(editTicketPage.getTotal()).toEqual('700.00');
  3366. });
  3367.  
  3368. it('should set discount', () => {
  3369. editTicketPage.fillDiscount('5');
  3370. });
  3371.  
  3372. it('should see total updates', () => {
  3373. expect(editTicketPage.getTotal()).toEqual('665.00');
  3374. });
  3375.  
  3376. it('should see minimum', () => {
  3377. editTicketPage.fillMinimum('300');
  3378. editTicketPage.clickLineNote();
  3379. });
  3380.  
  3381. it('should see total updates', () => {
  3382. expect(editTicketPage.getTotal()).toEqual('665.00');
  3383. });
  3384.  
  3385. it('should save line', () => {
  3386. editTicketPage.clickSaveClose();
  3387. });
  3388.  
  3389. it('should display saved line in Rental table', () => {
  3390. expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
  3391. expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
  3392. expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
  3393. expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
  3394. expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
  3395. expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
  3396. expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
  3397. });
  3398. });
  3399.  
  3400. describe('checking for add service line item in workover ticket', () => {
  3401.  
  3402. var time = commonHelper.uniqueValue();
  3403.  
  3404. var tomorrowDate = new Date();
  3405. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  3406.  
  3407. beforeAll(() => {
  3408. browser.get(loginLink);
  3409. });
  3410.  
  3411. afterAll(() => {
  3412. commonHelper.clearAllData();
  3413. });
  3414.  
  3415. it('should redirect on dashboard page after login', () => {
  3416. signInPage.login(username, password);
  3417. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3418.  
  3419. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3420. });
  3421.  
  3422. it('should click on plus button and select workover ticket', () => {
  3423. dashboardPage.selectItem('Workover Service Ticket');
  3424.  
  3425. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3426. });
  3427.  
  3428. it('should save ticket header', () => {
  3429. editTicketPage.fillLocation('Location' + time);
  3430. editTicketPage.fillAfe(afe);
  3431. editTicketPage.fillJobCode(jobCode);
  3432.  
  3433. editTicketPage.clickSave();
  3434.  
  3435. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3436. });
  3437.  
  3438. it('should add line item and see service form', () => {
  3439. editTicketPage.clickNewLine();
  3440. editTicketPage.selectCategory('Service');
  3441. editTicketPage.selectSubCategory('All');
  3442. editTicketPage.clickSaveClose();
  3443. });
  3444.  
  3445. it('should edit new line', () => {
  3446. editTicketPage.clickEditLineItem('Service');
  3447. });
  3448.  
  3449. it('should set note', () => {
  3450. editTicketPage.fillLineNote(time);
  3451. });
  3452.  
  3453. it('should select hour', () => {
  3454. editTicketPage.selectHour('Each');
  3455. });
  3456.  
  3457. it('should set start date',() => {
  3458. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  3459. editTicketPage.fillStartHour('10');
  3460. editTicketPage.fillStartMinutes('15');
  3461. });
  3462.  
  3463. it('should set end date',() => {
  3464. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  3465. editTicketPage.fillEndHour('10');
  3466. editTicketPage.fillEndMinutes('30');
  3467. });
  3468.  
  3469. it('should set rate and hours', () => {
  3470. editTicketPage.fillQuantity('20');
  3471. editTicketPage.fillRate('10');
  3472. editTicketPage.fillHours('20');
  3473. });
  3474.  
  3475. it('should see total updates', () => {
  3476. expect(editTicketPage.getTotal()).toEqual('200.00');
  3477. });
  3478.  
  3479. it('should set discount', () => {
  3480. editTicketPage.fillDiscount('5');
  3481. });
  3482.  
  3483. it('should see total updates', () => {
  3484. expect(editTicketPage.getTotal()).toEqual('190.00');
  3485. });
  3486.  
  3487. it('should see minimum', () => {
  3488. editTicketPage.fillMinimum('100');
  3489. editTicketPage.clickLineNote();
  3490. });
  3491.  
  3492. it('should see total updates', () => {
  3493. expect(editTicketPage.getTotal()).toEqual('190.00');
  3494. });
  3495.  
  3496. it('should save line', () => {
  3497. editTicketPage.clickSaveClose();
  3498. });
  3499.  
  3500. it('should display saved line in service table', () => {
  3501. expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
  3502. expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
  3503. expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
  3504. expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
  3505. expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
  3506. expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
  3507. expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
  3508. expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
  3509. });
  3510. });
  3511.  
  3512. describe('checking for add miscellaneous line item in pineline ticket', () => {
  3513.  
  3514. var time = commonHelper.uniqueValue();
  3515.  
  3516. beforeAll(() => {
  3517. browser.get(loginLink);
  3518. });
  3519.  
  3520. afterAll(() => {
  3521. commonHelper.clearAllData();
  3522. });
  3523.  
  3524. it('should redirect on dashboard page after login', () => {
  3525. signInPage.login(username, password);
  3526. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3527.  
  3528. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3529. });
  3530.  
  3531. it('should click on plus button and select workover ticket', () => {
  3532. dashboardPage.selectItem('Workover Service Ticket');
  3533.  
  3534. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3535. });
  3536.  
  3537. it('should save ticket header', () => {
  3538. editTicketPage.fillLocation('Location' + time);
  3539. editTicketPage.fillAfe(afe);
  3540. editTicketPage.fillJobCode(jobCode);
  3541.  
  3542. editTicketPage.clickSave();
  3543.  
  3544. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3545. });
  3546.  
  3547. it('should add line item and see Miscellaneous form', () => {
  3548. editTicketPage.clickNewLine();
  3549. editTicketPage.selectCategory('Miscellaneous');
  3550. });
  3551.  
  3552. it('should set note', () => {
  3553. editTicketPage.fillLineNote(time);
  3554. });
  3555.  
  3556. it('should set rate and hours', () => {
  3557. editTicketPage.selectHour('week');
  3558. editTicketPage.fillStandbyRate('10');
  3559. editTicketPage.fillRate('10');
  3560. editTicketPage.fillDaysStandby('40');
  3561. editTicketPage.fillHours('20');
  3562. editTicketPage.fillQuantity('30');
  3563. });
  3564.  
  3565. it('should see total updates', () => {
  3566. expect(editTicketPage.getTotal()).toEqual('700.00');
  3567. });
  3568.  
  3569. it('should set discount', () => {
  3570. editTicketPage.fillDiscount('5');
  3571. });
  3572.  
  3573. it('should see total updates', () => {
  3574. expect(editTicketPage.getTotal()).toEqual('665.00');
  3575. });
  3576.  
  3577. it('should see minimum', () => {
  3578. editTicketPage.fillMinimum('100');
  3579. editTicketPage.clickLineNote();
  3580. });
  3581.  
  3582. it('should see total updates', () => {
  3583. expect(editTicketPage.getTotal()).toEqual('665.00');
  3584. });
  3585.  
  3586. it('should save line', () => {
  3587. editTicketPage.clickSaveClose();
  3588. });
  3589.  
  3590. it('should display saved line in other table', () => {
  3591. expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
  3592. expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
  3593. expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
  3594. });
  3595. });
  3596.  
  3597. describe('checking for add new signature', () => {
  3598.  
  3599. var time = commonHelper.uniqueValue();
  3600.  
  3601. beforeAll(() => {
  3602. browser.get(loginLink);
  3603. });
  3604.  
  3605. afterAll(() => {
  3606. commonHelper.clearAllData();
  3607. });
  3608.  
  3609. it('should redirect on dashboard page after login', () => {
  3610. signInPage.login(username, password);
  3611. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3612.  
  3613. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3614. });
  3615.  
  3616. it('should click on plus button and select workover ticket', () => {
  3617. dashboardPage.selectItem('Workover Service Ticket');
  3618.  
  3619. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3620. });
  3621.  
  3622. it('should save ticket header', () => {
  3623. editTicketPage.fillLocation('Location' + time);
  3624. editTicketPage.fillAfe(afe);
  3625. editTicketPage.fillJobCode(jobCode);
  3626.  
  3627. editTicketPage.clickSave();
  3628.  
  3629. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3630. });
  3631.  
  3632. it('should click on add signature button', () => {
  3633. editTicketPage.clickAddSignature();
  3634. expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
  3635. });
  3636.  
  3637. it('should add signature ', () => {
  3638. editTicketPage.fillSignatureName(username);
  3639. editTicketPage.selectSignatureStyle();
  3640. editTicketPage.fillSignatureEmail(password);
  3641. editTicketPage.selectSignatureCertify();
  3642. });
  3643.  
  3644. it('should rate signature and feedback', () => {
  3645. editTicketPage.ratePunctuality();
  3646. editTicketPage.rateCompetence();
  3647. editTicketPage.rateProfessionalism();
  3648. editTicketPage.fillFeedback(time)
  3649. });
  3650.  
  3651. it('should click on checkbox signature', () => {
  3652. editTicketPage.btnCheckboxSignature.click();
  3653. expect(editTicketPage.chkSignature().isPresent()).toBe(true);
  3654. });
  3655.  
  3656. it('should save signature', () => {
  3657. editTicketPage.clickSaveSignature();
  3658. expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
  3659. });
  3660. });
  3661.  
  3662. describe('checking for add note', () => {
  3663.  
  3664. var time = commonHelper.uniqueValue();
  3665. var note = commonHelper.randomString(36, 10);
  3666.  
  3667. beforeAll(() => {
  3668. browser.get(loginLink);
  3669. });
  3670.  
  3671. afterAll(() => {
  3672. commonHelper.clearAllData();
  3673. });
  3674.  
  3675. it('should redirect on dashboard page after login', () => {
  3676. signInPage.login(username, password);
  3677. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3678.  
  3679. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3680. });
  3681.  
  3682. it('should click on plus button and select workover ticket', () => {
  3683. dashboardPage.selectItem('Workover Service Ticket');
  3684.  
  3685. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3686. });
  3687.  
  3688. it('should save ticket header', () => {
  3689. editTicketPage.fillLocation('Location' + time);
  3690. editTicketPage.fillAfe(afe);
  3691. editTicketPage.fillJobCode(jobCode);
  3692.  
  3693. editTicketPage.clickSave();
  3694.  
  3695. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3696. });
  3697.  
  3698. it('should click on add note',() => {
  3699. editTicketPage.clickAddNotes();
  3700. expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
  3701. });
  3702.  
  3703. it('should add notes', () => {
  3704. editTicketPage.fillNote(note);
  3705. editTicketPage.clickSaveNote();
  3706. });
  3707.  
  3708. it('should see note', () => {
  3709. commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
  3710. expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
  3711. });
  3712. });
  3713.  
  3714. describe('checking for add new member', () => {
  3715.  
  3716. var time = commonHelper.uniqueValue();
  3717. var user = 'Admin Selenium';
  3718.  
  3719. beforeAll(() => {
  3720. browser.get(loginLink);
  3721. });
  3722.  
  3723. afterAll(() => {
  3724. commonHelper.clearAllData();
  3725. });
  3726.  
  3727. it('should redirect on dashboard page after login', () => {
  3728. signInPage.login(username, password);
  3729. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3730.  
  3731. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3732. });
  3733.  
  3734. it('should click on plus button and select workover ticket', () => {
  3735. dashboardPage.selectItem('Workover Service Ticket');
  3736.  
  3737. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3738. });
  3739.  
  3740. it('should save ticket header', () => {
  3741. editTicketPage.fillLocation('Location' + time);
  3742. editTicketPage.fillAfe(afe);
  3743. editTicketPage.fillJobCode(jobCode);
  3744.  
  3745. editTicketPage.clickSave();
  3746.  
  3747. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3748. });
  3749.  
  3750. it('should click add member',() => {
  3751. editTicketPage.clickAddMember();
  3752. expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
  3753. });
  3754.  
  3755. it('should add member',() => {
  3756. editTicketPage.memberCheckbox(user).click();
  3757. expect(editTicketPage.chkMember().isPresent()).toBe(true);
  3758. editTicketPage.clickMemberSaved();
  3759. });
  3760.  
  3761. it('should see new member', () => {
  3762. expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
  3763. });
  3764. });
  3765.  
  3766. describe('checking for add new attachment', () => {
  3767.  
  3768. var time = commonHelper.uniqueValue();
  3769.  
  3770. beforeAll(() => {
  3771. browser.get(loginLink);
  3772. });
  3773.  
  3774. afterAll(() => {
  3775. commonHelper.clearAllData();
  3776. });
  3777.  
  3778. it('should redirect on dashboard page after login', () => {
  3779. signInPage.login(username, password);
  3780. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3781.  
  3782. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3783. });
  3784.  
  3785. it('should click on plus button and select workover ticket', () => {
  3786. dashboardPage.selectItem('Workover Service Ticket');
  3787.  
  3788. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3789. });
  3790.  
  3791. it('should save ticket header', () => {
  3792. editTicketPage.fillLocation('Location' + time);
  3793. editTicketPage.fillAfe(afe);
  3794. editTicketPage.fillJobCode(jobCode);
  3795.  
  3796. editTicketPage.clickSave();
  3797.  
  3798. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3799. });
  3800.  
  3801. it('should click add attachment',() => {
  3802. editTicketPage.clickAddAttachment();
  3803.  
  3804. expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
  3805. });
  3806.  
  3807. it('should add new attachment',() => {
  3808. editTicketPage.uploadAttachment('index.jpg');
  3809. editTicketPage.clickSaveAttachment();
  3810.  
  3811. expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
  3812. });
  3813. });
  3814.  
  3815. describe('checking for add hourly line item with errors', () => {
  3816.  
  3817. var time = commonHelper.uniqueValue();
  3818.  
  3819. beforeAll(() => {
  3820. browser.get(loginLink);
  3821. });
  3822.  
  3823. afterAll(() => {
  3824. commonHelper.clearAllData();
  3825. });
  3826.  
  3827. it('should redirect on dashboard page after login', () => {
  3828. signInPage.login(username, password);
  3829. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3830.  
  3831. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3832. });
  3833.  
  3834. it('should click on plus button and select workover ticket', () => {
  3835. dashboardPage.selectItem('Workover Service Ticket');
  3836.  
  3837. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3838. });
  3839.  
  3840. it('should save ticket header', () => {
  3841. editTicketPage.fillLocation('Location' + time);
  3842. editTicketPage.fillAfe(afe);
  3843. editTicketPage.fillJobCode(jobCode);
  3844.  
  3845. editTicketPage.clickSave();
  3846.  
  3847. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3848. });
  3849.  
  3850. it('should add line item and see hourly form', () => {
  3851. editTicketPage.clickNewLine();
  3852. editTicketPage.selectCategory('Hourly');
  3853. editTicketPage.selectSubCategory('All');
  3854. editTicketPage.clickSaveClose();
  3855. });
  3856.  
  3857. it('should edit new line', () => {
  3858. editTicketPage.clickEditLineItem('Hourly');
  3859. });
  3860.  
  3861. it('should set note', () => {
  3862. editTicketPage.fillLineNote(time);
  3863. });
  3864.  
  3865. it('should set rate and hours', () => {
  3866. editTicketPage.fillRate('qwe');
  3867. editTicketPage.fillHours('qwe');
  3868. });
  3869.  
  3870. it('should see total updates', () => {
  3871. expect(editTicketPage.getTotal()).toEqual('0.00');
  3872. });
  3873.  
  3874. it('should set discount', () => {
  3875. editTicketPage.fillDiscount('qwe');
  3876. });
  3877.  
  3878. it('should see total updates', () => {
  3879. expect(editTicketPage.getTotal()).toEqual('0.00');
  3880. });
  3881.  
  3882. it('should see minimum', () => {
  3883. editTicketPage.fillMinimum('qwe');
  3884. editTicketPage.clickLineNote();
  3885. });
  3886.  
  3887. it('should see total updates', () => {
  3888. expect(editTicketPage.getTotal()).toEqual('0.00');
  3889. });
  3890.  
  3891. it('should save line and see errors', () => {
  3892. editTicketPage.clickSaveClose();
  3893. browser.sleep(2000);
  3894. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  3895. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  3896. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  3897. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  3898. });
  3899. });
  3900.  
  3901. describe('checking for add rental line item in ticket with errors', () => {
  3902.  
  3903. var time = commonHelper.uniqueValue();
  3904.  
  3905. beforeAll(() => {
  3906. browser.get(loginLink);
  3907. });
  3908.  
  3909. afterAll(() => {
  3910. commonHelper.clearAllData();
  3911. });
  3912.  
  3913. it('should redirect on dashboard page after login', () => {
  3914. signInPage.login(username, password);
  3915. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  3916.  
  3917. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  3918. });
  3919.  
  3920. it('should click on plus button and select workover ticket', () => {
  3921. dashboardPage.selectItem('Workover Service Ticket');
  3922.  
  3923. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  3924. });
  3925.  
  3926. it('should save ticket header', () => {
  3927. editTicketPage.fillLocation('Location' + time);
  3928. editTicketPage.fillAfe(afe);
  3929. editTicketPage.fillJobCode(jobCode);
  3930.  
  3931. editTicketPage.clickSave();
  3932.  
  3933. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  3934. });
  3935.  
  3936. it('should add line item and see hourly form', () => {
  3937. editTicketPage.clickNewLine();
  3938. editTicketPage.selectCategory('Rental');
  3939. editTicketPage.selectSubCategory('All');
  3940. editTicketPage.clickSaveClose();
  3941. });
  3942.  
  3943. it('should edit new line', () => {
  3944. editTicketPage.clickEditLineItem('Rental');
  3945. });
  3946.  
  3947. it('should set note', () => {
  3948. editTicketPage.fillLineNote(time);
  3949. });
  3950.  
  3951. it('should set rate and hours', () => {
  3952. editTicketPage.selectHour('Per day');
  3953. editTicketPage.fillRate('qwe');
  3954. editTicketPage.fillStandbyRate('qwe');
  3955. editTicketPage.fillHours('qwe');
  3956. editTicketPage.fillQuantity('qe');
  3957. editTicketPage.fillDaysStandby('qwe');
  3958. });
  3959.  
  3960. it('should see total updates', () => {
  3961. expect(editTicketPage.getTotal()).toEqual('0.00');
  3962. });
  3963.  
  3964. it('should set discount', () => {
  3965. editTicketPage.fillDiscount('qwe');
  3966. });
  3967.  
  3968. it('should see total updates', () => {
  3969. expect(editTicketPage.getTotal()).toEqual('0.00');
  3970. });
  3971.  
  3972. it('should see minimum', () => {
  3973. editTicketPage.fillMinimum('qwe');
  3974. editTicketPage.clickLineNote();
  3975. });
  3976.  
  3977. it('should see total updates', () => {
  3978. expect(editTicketPage.getTotal()).toEqual('0.00');
  3979. });
  3980.  
  3981. it('should save line and see errors', () => {
  3982. editTicketPage.clickSaveClose();
  3983. browser.sleep(2000);
  3984. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  3985. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  3986. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  3987. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  3988. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  3989. });
  3990. });
  3991.  
  3992. describe('checking for add service line item in ticket with errors', () => {
  3993.  
  3994. var time = commonHelper.uniqueValue();
  3995.  
  3996. var tomorrowDate = new Date();
  3997. tomorrowDate.setDate(tomorrowDate.getDate() + 1);
  3998.  
  3999. beforeAll(() => {
  4000. browser.get(loginLink);
  4001. });
  4002.  
  4003. afterAll(() => {
  4004. commonHelper.clearAllData();
  4005. });
  4006.  
  4007. it('should redirect on dashboard page after login', () => {
  4008. signInPage.login(username, password);
  4009. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  4010.  
  4011. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  4012. });
  4013.  
  4014. it('should click on plus button and select workover ticket', () => {
  4015. dashboardPage.selectItem('Workover Service Ticket');
  4016.  
  4017. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  4018. });
  4019.  
  4020. it('should save ticket header', () => {
  4021. editTicketPage.fillLocation('Location' + time);
  4022. editTicketPage.fillAfe(afe);
  4023. editTicketPage.fillJobCode(jobCode);
  4024.  
  4025. editTicketPage.clickSave();
  4026.  
  4027. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  4028. });
  4029.  
  4030. it('should add line item and see hourly form', () => {
  4031. editTicketPage.clickNewLine();
  4032. editTicketPage.selectCategory('Service');
  4033. editTicketPage.selectSubCategory('All');
  4034. editTicketPage.clickSaveClose();
  4035. });
  4036.  
  4037. it('should edit new line', () => {
  4038. editTicketPage.clickEditLineItem('Service');
  4039. });
  4040.  
  4041. it('should set note', () => {
  4042. editTicketPage.fillLineNote(time);
  4043. });
  4044.  
  4045. it('should select hour', () => {
  4046. editTicketPage.selectHour('Each');
  4047. });
  4048.  
  4049. it('should set start date',() => {
  4050. editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
  4051. editTicketPage.fillStartHour('qwe');
  4052. editTicketPage.fillStartMinutes('qwe');
  4053. });
  4054.  
  4055. it('should set end date',() => {
  4056. editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
  4057. editTicketPage.fillEndHour('qwe');
  4058. editTicketPage.fillEndMinutes('qwe');
  4059. });
  4060.  
  4061. it('should set rate and hours', () => {
  4062. editTicketPage.fillQuantity('qwe');
  4063. editTicketPage.fillRate('qwe');
  4064. editTicketPage.fillHours('qwe');
  4065. });
  4066.  
  4067. it('should see total updates', () => {
  4068. expect(editTicketPage.getTotal()).toEqual('0.00');
  4069. });
  4070.  
  4071. it('should set discount', () => {
  4072. editTicketPage.fillDiscount('qwe');
  4073. });
  4074.  
  4075. it('should see total updates', () => {
  4076. expect(editTicketPage.getTotal()).toEqual('0.00');
  4077. });
  4078.  
  4079. it('should see minimum', () => {
  4080. editTicketPage.fillMinimum('qwe');
  4081. editTicketPage.clickLineNote();
  4082. });
  4083.  
  4084. it('should see total updates', () => {
  4085. expect(editTicketPage.getTotal()).toEqual('0.00');
  4086. });
  4087.  
  4088. it('should save line', () => {
  4089. editTicketPage.clickSaveClose();
  4090. });
  4091.  
  4092. it('should save line and see errors', () => {
  4093. editTicketPage.clickSaveClose();
  4094. browser.sleep(2000);
  4095. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  4096. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  4097. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  4098. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  4099. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  4100. });
  4101. });
  4102.  
  4103. describe('checking for add miscellaneous line item in ticket with errors', () => {
  4104.  
  4105. var time = commonHelper.uniqueValue();
  4106.  
  4107. beforeAll(() => {
  4108. browser.get(loginLink);
  4109. });
  4110.  
  4111. afterAll(() => {
  4112. commonHelper.clearAllData();
  4113. });
  4114.  
  4115. it('should redirect on dashboard page after login', () => {
  4116. signInPage.login(username, password);
  4117. commonHelper.waitUntilElementPresent(dashboardPage.menu);
  4118.  
  4119. expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
  4120. });
  4121.  
  4122. it('should click on plus button and select workover ticket', () => {
  4123. dashboardPage.selectItem('Workover Service Ticket');
  4124.  
  4125. expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
  4126. });
  4127.  
  4128. it('should save ticket header', () => {
  4129. editTicketPage.fillLocation('Location' + time);
  4130. editTicketPage.fillAfe(afe);
  4131. editTicketPage.fillJobCode(jobCode);
  4132.  
  4133. editTicketPage.clickSave();
  4134.  
  4135. expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
  4136. });
  4137.  
  4138. it('should add line item and see Miscellaneous form', () => {
  4139. editTicketPage.clickNewLine();
  4140. editTicketPage.selectCategory('Miscellaneous');
  4141. });
  4142.  
  4143. it('should set note', () => {
  4144. editTicketPage.fillLineNote(time);
  4145. });
  4146.  
  4147. it('should set rate and hours', () => {
  4148. editTicketPage.selectHour('week');
  4149. editTicketPage.fillStandbyRate('qwe');
  4150. editTicketPage.fillRate('qwe');
  4151. editTicketPage.fillDaysStandby('qwe');
  4152. editTicketPage.fillHours('qwe');
  4153. editTicketPage.fillQuantity('qwe');
  4154. });
  4155.  
  4156. it('should see total updates', () => {
  4157. expect(editTicketPage.getTotal()).toEqual('0.00');
  4158. });
  4159.  
  4160. it('should set discount', () => {
  4161. editTicketPage.fillDiscount('qwe');
  4162. });
  4163.  
  4164. it('should see total updates', () => {
  4165. expect(editTicketPage.getTotal()).toEqual('0.00');
  4166. });
  4167.  
  4168. it('should see minimum', () => {
  4169. editTicketPage.fillMinimum('qwe');
  4170. editTicketPage.clickLineNote();
  4171. });
  4172.  
  4173. it('should see total updates', () => {
  4174. expect(editTicketPage.getTotal()).toEqual('0.00');
  4175. });
  4176.  
  4177. it('should save line and see errors', () => {
  4178. editTicketPage.clickSaveClose();
  4179. browser.sleep(2000);
  4180. expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
  4181. expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
  4182. expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
  4183. expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
  4184. expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
  4185. });
  4186. });
  4187. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement