Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_asset.po
- 'use strict';
- const commonHelper = require('./../../helpers/common.helper.js');
- class AddAssetsPage {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- constructor() {
- this.txtAssetsCompany = element(by.model('asset.company'));
- this.txtLease = $('[aria-label="Lease"]');
- this.txtAssetName = element(by.model('asset.name'));
- this.txtAssetBarrel = element(by.model('asset.max_barrels'));
- this.txtAssetsDescription = element(by.model('asset.tank_description'));
- this.btnAddIncrement = $('[aria-label="Add Increment"]');
- this.btnShowPanel = $('[ng-click="showPanel()"]');
- this.txtFeet = element(by.model('feet'));
- this.txtWhole = element(by.model('whole'));
- this.txtQuarters = element(by.model('quarters'));
- this.btnOk = $('[aria-label="OK"]');
- this.txtIncrements = element(by.model('strappingIncrement.increments'));
- this.btnEdit = $('[aria-label="edit"]');
- this.btnSaveIncrement = $('[ng-click="save(strappingIncrementForm)"]');
- this.btnSaveAndClose = $('[aria-label="Save & Close"]');
- this.txtTankSize = element(by.model('asset.tank_size'));
- this.txtLeaseNumber = element(by.model('asset.virtual_fields[\'lease_number\']'));
- this.txtField = element(by.model('asset.virtual_fields[\'field\']'));
- this.txtFieldOperator = element(by.model('asset.virtual_fields[\'field_operator\']'));
- this.txtLegalLocation = element(by.model('asset.virtual_fields[\'legal_location\']'));
- this.txtCountry = element(by.model('asset.virtual_fields[\'country\']'));
- this.txtState = element(by.model('asset.virtual_fields[\'state\']'));
- this.txtFederal = element(by.model('asset.virtual_fields[\'federal_indian_lsc_number\']'));
- }
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- fillFederal(value) {
- this.txtFederal.clear();
- this.txtFederal.sendKeys(value);
- }
- fillLeaseNumber(value) {
- this.txtLeaseNumber.clear();
- this.txtLeaseNumber.sendKeys(value);
- }
- fillField(value) {
- this.txtField.clear();
- this.txtField.sendKeys(value);
- }
- fillFieldOperator(value) {
- this.txtFieldOperator.clear();
- this.txtFieldOperator.sendKeys(value);
- }
- fillLegalLocation(value) {
- this.txtLegalLocation.clear();
- this.txtLegalLocation.sendKeys(value);
- }
- fillCountry(value) {
- this.txtCountry.clear();
- this.txtCountry.sendKeys(value);
- }
- fillState(value) {
- this.txtState.clear();
- this.txtState.sendKeys(value);
- }
- fillTankSize(value) {
- this.txtTankSize.clear();
- this.txtTankSize.sendKeys(value);
- }
- clickSaveAndClose(){
- this.btnSaveAndClose.click();
- }
- clickSaveIncrement(){
- this.btnSaveIncrement.click();
- }
- fillIncrements(value){
- this.txtIncrements.clear();
- this.txtIncrements.sendKeys(value);
- }
- clickOk(){
- this.btnOk.click();
- }
- fillWhole(value){
- this.txtWhole.clear();
- this.txtWhole.sendKeys(value);
- }
- fillQuarters(value){
- this.txtQuarters.clear();
- this.txtQuarters.sendKeys(value);
- }
- fillFeet(value){
- this.txtFeet.clear();
- this.txtFeet.sendKeys(value);
- }
- clickShowPanel(){
- this.btnShowPanel.click();
- }
- clickAddIncrement(){
- this.btnAddIncrement.click();
- }
- fillAssetsDescription(value){
- this.txtAssetsDescription.clear();
- this.txtAssetsDescription.sendKeys(value);
- }
- fillAssetBarrel(value){
- this.txtAssetBarrel.clear();
- this.txtAssetBarrel.sendKeys(value);
- }
- fillAssetName(value){
- this.txtAssetName.clear();
- this.txtAssetName.sendKeys(value);
- }
- fillLease(value){
- this.txtLease.clear();
- this.txtLease.sendKeys(value);
- }
- selectCompanyAssets(type){
- browser.waitForAngular();
- commonHelper.waitUntilElementVisible(this.txtAssetsCompany);
- browser.sleep(1000);
- this.txtAssetsCompany.click();
- browser.sleep(2000);
- element(by.xpath('//div[contains(@class, "md-active")]//div[contains(.,"'+ type +'")]')).click();
- }
- }
- module.exports = AddAssetsPage;
- --------------------------------------------------------------------
- assets.po
- this.btnAddAssets = $('[aria-label="Add Asset"]');
- ---------------------------------------------------------------------
- assets.spec
- 'use strict';
- const pageObject = require('./../../services').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const assetsPage = pageObject.getAssetsPage();
- const addAssetsPage = pageObject.getAddAssetsPage();
- const jobCodePage = pageObject.getJobCodePage();
- const skuPage = pageObject.getSkuPage();
- const signInData = require('./../../data/sign_in');
- const dashboardData = require('./../../data/dashboard');
- const commonHelper = require('./../../services/helpers/common.helper');
- var strftime = require('strftime');
- describe('Assets', () => {
- var username = signInData.testAccount.username;
- var password = signInData.testAccount.password;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for adding new assets and edit', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(signInData.link);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on assets in menu', () => {
- dashboardPage.openMenu('Oil Field');
- dashboardPage.clickAssets();
- expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
- });
- it('should click on add assets', () => {
- assetsPage.clickAddAssets();
- expect(jobCodePage.btnSave.isDisplayed()).toBe(true);
- });
- it('should add assets', () => {
- addAssetsPage.selectCompanyAssets('Testware Associates home office');
- addAssetsPage.fillLease('qwe');
- addAssetsPage.fillAssetName('name' + time);
- addAssetsPage.fillTankSize('100');
- addAssetsPage.fillState('Texas');
- addAssetsPage.fillCountry('USA');
- addAssetsPage.fillLegalLocation('Legal');
- addAssetsPage.fillFieldOperator('QA');
- addAssetsPage.fillField('Test');
- addAssetsPage.fillLeaseNumber('123456');
- addAssetsPage.fillFederal('Federal');
- jobCodePage.clickSave();
- });
- it('should see assets title', () => {
- expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
- });
- it('should search assets', () => {
- assetsPage.fillSearch('name' + time);
- commonHelper.waitUntilElementVisible(jobCodePage.searchCode(time));
- });
- it('should edit assets', () => {
- skuPage.clickDetails();
- addAssetsPage.selectCompanyAssets('Testware Associates home office');
- addAssetsPage.fillLease('qwe');
- addAssetsPage.fillAssetName('name' + time);
- addAssetsPage.fillTankSize('200');
- addAssetsPage.fillState('Idaho');
- addAssetsPage.fillCountry('Canada');
- addAssetsPage.fillLegalLocation('Location');
- addAssetsPage.fillFieldOperator('Auto');
- addAssetsPage.fillField('Qa');
- addAssetsPage.fillLeaseNumber('654321');
- addAssetsPage.fillFederal('Test');
- });
- it('should click add increment', () => {
- addAssetsPage.clickAddIncrement();
- commonHelper.waitUntilElementVisible(addAssetsPage.btnShowPanel)
- });
- it('should add increment', () => {
- addAssetsPage.clickShowPanel();
- addAssetsPage.fillWhole('1');
- addAssetsPage.fillFeet('1');
- addAssetsPage.fillQuarters('1');
- addAssetsPage.clickOk();
- addAssetsPage.fillIncrements('10');
- addAssetsPage.clickSaveIncrement();
- });
- it('should see increment', () => {
- expect(addAssetsPage.btnAddIncrement.isPresent()).toBe(true);
- });
- it('should save changes', () => {
- addAssetsPage.clickSaveAndClose();
- commonHelper.waitUntilElementVisible(assetsPage.btnAddAssets);
- });
- });
- describe('checking for cancel adding new assets', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(signInData.link);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on assets in menu', () => {
- dashboardPage.openMenu('Oil Field');
- dashboardPage.clickAssets();
- expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
- });
- it('should click on add assets', () => {
- assetsPage.clickAddAssets();
- expect(jobCodePage.btnSave.isDisplayed()).toBe(true);
- });
- it('should add assets', () => {
- addAssetsPage.selectCompanyAssets('Testware Associates home office');
- addAssetsPage.fillLease('qwe');
- addAssetsPage.fillAssetName('Bob' + time);
- addAssetsPage.fillTankSize('200');
- addAssetsPage.fillState('Idaho');
- addAssetsPage.fillCountry('Canada');
- addAssetsPage.fillLegalLocation('Location');
- addAssetsPage.fillFieldOperator('Auto');
- addAssetsPage.fillField('Qa');
- addAssetsPage.fillLeaseNumber('654321');
- addAssetsPage.fillFederal('Test');
- dashboardPage.clickCancel();
- });
- it('should see assets title', () => {
- expect(assetsPage.btnAddAssets.isDisplayed()).toBe(true);
- });
- it('should search assets', () => {
- assetsPage.fillSearch('Bob' + time);
- expect(skuPage.searchOnOilFieldPage('Bob' + time).isPresent()).toBe(false);
- });
- });
- });
- ------------------------------------------------------------------
- dashboard.spec (задизейблил поиск)
- 'use strict';
- const pageObject = require('./../../services').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const editTicketPage = pageObject.getEditTicketPage();
- const addCompanyPage = pageObject.getAddCompanyPage();
- const addContactsPage = pageObject.getAddContactPage();
- const signInData = require('./../../data/sign_in');
- const dashboardData = require('./../../data/dashboard');
- const commonHelper = require('./../../services/helpers/common.helper');
- var strftime = require('strftime');
- describe('Dashboard', () => {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var name = dashboardData.companies.name;
- var site = dashboardData.companies.site;
- var type = dashboardData.companies.type;
- var editName = dashboardData.editCompanies.name;
- var editSite = dashboardData.editCompanies.site;
- var editType = dashboardData.editCompanies.type;
- var contactsName = dashboardData.contacts.name;
- var contactsLastName = dashboardData.contacts.lastName;
- var contactsTittle = dashboardData.contacts.tittle;
- var contactsCompany = dashboardData.contacts.company;
- var contactsOffice = dashboardData.contacts.office;
- var contactsEmail = dashboardData.contacts.email;
- var contactsEditName = dashboardData.editContacts.name;
- var contactsEditLastName = dashboardData.editContacts.lastName;
- var contactsEditTittle = dashboardData.editContacts.tittle;
- var contactsEditCompany = dashboardData.editContacts.company;
- var contactsEditOffice = dashboardData.editContacts.office;
- var contactsEditEmail = dashboardData.editContacts.email;
- var loginLink = signInData.link;
- var dashboardTitle = dashboardData.title;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add and edit company', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should click on add company', () => {
- dashboardPage.clickAddCompany();
- expect(addCompanyPage.companyTitle.getText()).toEqual('Add Company');
- });
- it('should add company', () => {
- addCompanyPage.fillCompanyName(name + time);
- addCompanyPage.fillCompanySite(site);
- addCompanyPage.selectCompanyType(type);
- addCompanyPage.fillCompanyNote(time);
- });
- it('should add icon for company',() => {
- editTicketPage.uploadAttachment('index.jpg');
- addCompanyPage.clickSave();
- expect(addCompanyPage.imageCompany.isDisplayed()).toBe(true);
- });
- it('should redirect to dashboard',() => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should search company',() => {
- addCompanyPage.txtSeachCompany.sendKeys(name + time);
- commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(name + time));
- });
- it('should click on edit button',() => {
- dashboardPage.clickEdit();
- expect(addCompanyPage.companyTitle.getText()).toEqual('Edit Company');
- });
- it('should edit company', () => {
- addCompanyPage.fillCompanyName(editName + time);
- addCompanyPage.fillCompanySite(editSite);
- addCompanyPage.selectCompanyType(editType);
- addCompanyPage.fillCompanyNote(time);
- });
- it('should edit icon for company',() => {
- editTicketPage.uploadAttachment('index.jpg');
- addCompanyPage.clickSave();
- expect(addCompanyPage.imageCompany.isDisplayed()).toBe(true);
- });
- it('should redirect to dashboard',() => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should search company',() => {
- addCompanyPage.fillSearchCompany(editName + time);
- commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(editName + time));
- });
- it('should see changes in company details',() => {
- dashboardPage.clickDetails();
- expect(dashboardPage.pageTitle()).toEqual('PineApple' + time);
- });
- });
- describe('checking for add and edit contact', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should click on add contacts', () => {
- dashboardPage.clickAddContacts();
- });
- it('should add contacts', () => {
- addContactsPage.fillContactName(contactsName + time);
- addContactsPage.fillContactLastName(contactsLastName);
- addContactsPage.fillContactTitle(contactsTittle);
- addContactsPage.selectContactCompany(contactsCompany);
- addContactsPage.selectContactOffices(contactsOffice);
- addContactsPage.fillContactNumber(time);
- addContactsPage.fillContactEmail(contactsEmail);
- });
- it('should save contacts', () => {
- addContactsPage.saveCompany();
- });
- it('should redirect to dashboard',() => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- /* it('should search contacts',() => {
- addContactsPage.fillSearchContacts(contactsName + time);
- commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(contactsName + time));
- });
- it('should see contacts details',() => {
- addContactsPage.clickBtnDetailsContact();
- expect(dashboardPage.pageTitle()).toEqual(contactsTittle);
- expect(addContactsPage.getTable(contactsEmail));
- expect(addContactsPage.getTable(time));
- });
- it('should click on edit contacts', () => {
- addContactsPage.clickEditContact();
- commonHelper.waitUntilElementVisible(addContactsPage.tittleEdit);
- });
- it('should edit contacts', () => {
- addContactsPage.fillContactName(contactsEditName + time);
- addContactsPage.fillContactLastName(contactsEditLastName);
- addContactsPage.fillContactTitle(contactsEditTittle);
- addContactsPage.selectContactCompany(contactsEditCompany);
- addContactsPage.selectContactOffices(contactsEditOffice);
- addContactsPage.fillContactNumber(time + '00');
- addContactsPage.fillContactEmail(contactsEditEmail);
- });
- it('should save contacts', () => {
- addContactsPage.saveCompany();
- });
- it('should redirect to dashboard',() => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should search contacts',() => {
- addContactsPage.fillSearchContacts(contactsEditName + time);
- commonHelper.waitUntilElementVisible(addCompanyPage.searchCompany(contactsEditName + time));
- });
- it('should see contacts details',() => {
- addContactsPage.clickBtnDetailsContact();
- expect(dashboardPage.pageTitle()).toEqual(contactsEditTittle);
- expect(addContactsPage.getTable(contactsEditEmail));
- expect(addContactsPage.getTable(time + '00'));
- });*/
- });
- describe('checking cancel adding company', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should click on add company', () => {
- dashboardPage.clickAddCompany();
- expect(addCompanyPage.companyTitle.getText()).toEqual('Add Company');
- });
- it('should add company', () => {
- addCompanyPage.fillCompanyName(name + time);
- addCompanyPage.fillCompanySite(site);
- addCompanyPage.selectCompanyType(type);
- addCompanyPage.fillCompanyNote(time);
- });
- it('should add icon for company and cancel adding',() => {
- editTicketPage.uploadAttachment('index.jpg');
- dashboardPage.clickCancel();
- });
- it('should redirect to dashboard',() => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- /* it('should search company',() => {
- addCompanyPage.txtSeachCompany.sendKeys(name + time);
- expect(addCompanyPage.searchCompany(name + time).isPresent()).toBe(false);
- });*/
- });
- describe('checking for cancel adding contact', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });
- it('should click on add contacts', () => {
- dashboardPage.clickAddContacts();
- });
- it('should add contacts', () => {
- addContactsPage.fillContactName(contactsName + time);
- addContactsPage.fillContactLastName(contactsLastName);
- addContactsPage.fillContactTitle(contactsTittle);
- addContactsPage.selectContactCompany(contactsCompany);
- addContactsPage.selectContactOffices(contactsOffice);
- addContactsPage.fillContactNumber(time);
- addContactsPage.fillContactEmail(contactsEmail);
- });
- it('should cancel contacts', () => {
- addContactsPage.cancelContacts();
- });
- it('should redirect to dashboard', () => {
- dashboardPage.openMenu('Dashboard');
- expect(dashboardPage.pageTitle()).toEqual(dashboardTitle);
- });/*
- it('should search contacts', () => {
- addContactsPage.fillSearchContacts(contactsName + time);
- expect(addCompanyPage.searchCompany(contactsName + time).isPresent()).toBe(false);
- });*/
- });
- });
- ---------------------------------------------------------------------
- pipeline_ticket.spec
- 'use strict';
- const pageObject = require('./../../../services/index').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const editTicketPage = pageObject.getEditTicketPage();
- const pipelineTicketPage = pageObject.getPipelineTicketPage();
- const signInData = require('./../../../data/sign_in/index');
- const dashboardData = require('./../../../data/dashboard/index');
- const ticketsData = require('./../../../data/tickets/index');
- const commonHelper = require('./../../../services/helpers/common.helper.js');
- var strftime = require('strftime');
- describe('Pipeline tickets', () => {
- var loginLink = signInData.link;
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var afe = ticketsData.ticket.afe;
- var jobCode = ticketsData.ticket.jobCode;
- var linePressure = ticketsData.pipeline.note.linePressure;
- var jobDescription = ticketsData.pipeline.note.jobDescription;
- var locationDirection = ticketsData.pipeline.note.locationDirection;
- var contacts = ticketsData.pipeline.note.contacts;
- var lead = ticketsData.pipeline.note.lead;
- var assistant = ticketsData.pipeline.note.assistant;
- var injectionPoint = ticketsData.pipeline.note.injectionPoint;
- var errorMessage = ticketsData.errorMessage;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add hourly line item in pipeline ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Hourly');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Hourly table', () => {
- expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
- expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
- expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
- expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add rental line item in pipeline ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see rental form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Rental');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('10');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- editTicketPage.fillDaysStandby('40');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('300');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Rental table', () => {
- expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
- expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
- expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
- expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add service line item in pipeline ticket', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see service form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Service');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('10');
- editTicketPage.fillStartMinutes('15');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('10');
- editTicketPage.fillEndMinutes('30');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('20');
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in service table', () => {
- expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
- expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
- expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
- expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
- expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
- });
- });
- describe('checking for add miscellaneous line item in pipeline ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillRate('10');
- editTicketPage.fillDaysStandby('40');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in other table', () => {
- expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
- expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add new signature', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add signature button', () => {
- editTicketPage.clickAddSignature();
- expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
- });
- it('should add signature ', () => {
- editTicketPage.fillSignatureName(username);
- editTicketPage.selectSignatureStyle();
- editTicketPage.fillSignatureEmail(password);
- editTicketPage.selectSignatureCertify();
- });
- it('should rate signature and feedback', () => {
- editTicketPage.ratePunctuality();
- editTicketPage.rateCompetence();
- editTicketPage.rateProfessionalism();
- editTicketPage.fillFeedback(time)
- });
- it('should click on checkbox signature', () => {
- editTicketPage.btnCheckboxSignature.click();
- expect(editTicketPage.chkSignature().isPresent()).toBe(true);
- });
- it('should save signature', () => {
- editTicketPage.clickSaveSignature();
- expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
- });
- });
- describe('checking for add note', () => {
- var time = commonHelper.uniqueValue();
- var note = commonHelper.randomString(36, 10);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add note',() => {
- editTicketPage.clickAddNotes();
- expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
- });
- it('should add notes', () => {
- editTicketPage.fillNote(note);
- editTicketPage.clickSaveNote();
- });
- it('should see note', () => {
- commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
- expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new member', () => {
- var time = commonHelper.uniqueValue();
- var user = 'Admin Selenium';
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add member',() => {
- editTicketPage.clickAddMember();
- expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
- });
- it('should add member',() => {
- editTicketPage.memberCheckbox(user).click();
- expect(editTicketPage.chkMember().isPresent()).toBe(true);
- editTicketPage.clickMemberSaved();
- });
- it('should see new member', () => {
- expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new attachment', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add attachment',() => {
- editTicketPage.clickAddAttachment();
- expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
- });
- it('should add new attachment',() => {
- editTicketPage.uploadAttachment('index.jpg');
- editTicketPage.clickSaveAttachment();
- expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
- });
- });
- describe('checking for add hourly line item with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and pipeline service ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- });
- });
- describe('checking for add rental line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see rental form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Rental');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qe');
- editTicketPage.fillDaysStandby('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add service line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select pipeline ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- });
- it('should add notes', () => {
- pipelineTicketPage.fillLinePressure(linePressure);
- pipelineTicketPage.fillLocationDirection(locationDirection);
- pipelineTicketPage.fillContacts(contacts);
- pipelineTicketPage.fillLead(lead);
- pipelineTicketPage.fillAssistant(assistant);
- pipelineTicketPage.fillInjectionPoint(injectionPoint);
- pipelineTicketPage.fillJobDescription(jobDescription);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see service form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Service');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('qwe');
- editTicketPage.fillStartMinutes('qwe');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('qwe');
- editTicketPage.fillEndMinutes('qwe');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add miscellaneous line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and pipeline service ticket', () => {
- dashboardPage.selectItem('Pipeline Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillDaysStandby('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- });
- ---------------------------------------------------------------------
- service_ticket.spec
- 'use strict';
- const pageObject = require('./../../../services/index').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const editTicketPage = pageObject.getEditTicketPage();
- const ticketsPage = pageObject.getTicketsPage();
- const signInData = require('./../../../data/sign_in/index');
- const dashboardData = require('./../../../data/dashboard/index');
- const ticketsData = require('./../../../data/tickets/index');
- const commonHelper = require('./../../../services/helpers/common.helper.js');
- var strftime = require('strftime');
- describe('Service Ticket', () => {
- var loginLink = signInData.link;
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var afe = ticketsData.ticket.afe;
- var jobCode = ticketsData.ticket.jobCode;
- var errorMessage = ticketsData.errorMessage;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add hourly line item in ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Hourly');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Hourly table', () => {
- expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
- expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
- expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
- expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
- });
- /*it('should save ticket', () => {
- editTicketPage.clickSave();
- dashboardPage.openMenu('Tickets');
- });
- it('should search ticket', ()=> {
- ticketsPage.selectSearchType('Location');
- ticketsPage.searchTicket('Location' + time);
- ticketsPage.clickDetails();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should edit note', () => {
- editTicketPage.fillLineNote(time + time);
- });
- it('should edit rate and hours', () => {
- editTicketPage.fillRate('20');
- editTicketPage.fillHours('30');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('570.00');
- });
- it('should edit discount', () => {
- editTicketPage.fillDiscount('6');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('564.00');
- });
- it('should edit minimum', () => {
- editTicketPage.fillMinimum('150');
- editTicketPage.clickLineNote();
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('564.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display edited line in Hourly table', () => {
- expect(editTicketPage.getRate('Hourly', '1')).toEqual('$20.00/hr');
- expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('30 Hours');
- expect(editTicketPage.getMin('Hourly', '1')).toEqual('$150.00');
- expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$564.00');
- expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time + time);
- });*/
- });
- describe('checking for add rental line item in ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see rental form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Rental');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('10');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- editTicketPage.fillDaysStandby('40');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('300');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Rental table', () => {
- expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
- expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
- expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
- expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
- });
- /*it('should save ticket', () => {
- editTicketPage.clickSave();
- dashboardPage.openMenu('Tickets');
- });
- it('should search ticket', () => {
- ticketsPage.selectSearchType('Location');
- ticketsPage.searchTicket('Location' + time);
- ticketsPage.clickDetails();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time + time);
- });
- it('should edit rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('20');
- editTicketPage.fillStandbyRate('20');
- editTicketPage.fillHours('30');
- editTicketPage.fillQuantity('40');
- editTicketPage.fillDaysStandby('50');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('1710.00');
- });
- it('should edit discount', () => {
- editTicketPage.fillDiscount('6');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('1692.00');
- });
- it('should edit minimum', () => {
- editTicketPage.fillMinimum('400');
- editTicketPage.clickLineNote();
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('1692.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Rental table', () => {
- expect(editTicketPage.getRate('Rental', '1')).toEqual('$20.00/day');
- expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$20.00/day');
- expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('50 Days');
- expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('30 Days');
- expect(editTicketPage.getMin('Rental', '1')).toEqual('$400.00');
- expect(editTicketPage.getAmount('Rental', '1')).toEqual('$1,692.00');
- expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time + time);
- });*/
- });
- describe('checking for add service line item in ticket', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see service form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Service');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('10');
- editTicketPage.fillStartMinutes('15');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('10');
- editTicketPage.fillEndMinutes('30');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('20');
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in service table', () => {
- expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
- expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
- expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
- expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
- expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
- });
- /*it('should save ticket', () => {
- editTicketPage.clickSave();
- dashboardPage.openMenu('Tickets');
- });
- it('should search ticket', ()=> {
- ticketsPage.selectSearchType('Location');
- ticketsPage.searchTicket('Location' + time);
- ticketsPage.clickDetails();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should edit note', () => {
- editTicketPage.fillLineNote(time + time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should edit start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('15');
- editTicketPage.fillStartMinutes('30');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('15');
- editTicketPage.fillEndMinutes('45');
- });
- it('should edit rate and hours', () => {
- editTicketPage.fillQuantity('30');
- editTicketPage.fillRate('20');
- editTicketPage.fillHours('30');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('570.00');
- });
- it('should edit discount', () => {
- editTicketPage.fillDiscount('7');
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('558.00');
- });
- it('should edit minimum', () => {
- editTicketPage.fillMinimum('200');
- editTicketPage.clickLineNote();
- });
- it('should see edited total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('558.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in service table', () => {
- expect(editTicketPage.getRate('Service', '1')).toEqual('$20.00/ea');
- expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('30 Units');
- expect(editTicketPage.getMin('Service', '1')).toEqual('$200.00');
- expect(editTicketPage.getAmount('Service', '1')).toEqual('$558.00');
- expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('30 Units');
- expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time + time);
- expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:30:00 PM');
- expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '3:45:00 PM');
- });*/
- });
- describe('checking for add miscellaneous line item in ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillRate('10');
- editTicketPage.fillDaysStandby('40');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in other table', () => {
- expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
- expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add new signature', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add signature button', () => {
- editTicketPage.clickAddSignature();
- expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
- });
- it('should add signature ', () => {
- editTicketPage.fillSignatureName(username);
- editTicketPage.selectSignatureStyle();
- editTicketPage.fillSignatureEmail(password);
- editTicketPage.selectSignatureCertify();
- });
- it('should rate signature and feedback', () => {
- editTicketPage.ratePunctuality();
- editTicketPage.rateCompetence();
- editTicketPage.rateProfessionalism();
- editTicketPage.fillFeedback(time)
- });
- it('should click on checkbox signature', () => {
- editTicketPage.btnCheckboxSignature.click();
- expect(editTicketPage.chkSignature().isPresent()).toBe(true);
- });
- it('should save signature', () => {
- editTicketPage.clickSaveSignature();
- expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
- });
- });
- describe('checking for add note', () => {
- var time = commonHelper.uniqueValue();
- var note = commonHelper.randomString(36, 10);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add note',() => {
- editTicketPage.clickAddNotes();
- expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
- });
- it('should add notes', () => {
- editTicketPage.fillNote(note);
- editTicketPage.clickSaveNote();
- });
- it('should see note', () => {
- commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
- expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new member', () => {
- var time = commonHelper.uniqueValue();
- var user = 'Admin Selenium';
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add member',() => {
- editTicketPage.clickAddMember();
- expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
- });
- it('should add member',() => {
- editTicketPage.memberCheckbox(user).click();
- expect(editTicketPage.chkMember().isPresent()).toBe(true);
- editTicketPage.clickMemberSaved();
- });
- it('should see new member', () => {
- expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new attachment', () => {
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + commonHelper.uniqueValue());
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add attachment',() => {
- editTicketPage.clickAddAttachment();
- expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
- });
- it('should add new attachment',() => {
- editTicketPage.uploadAttachment('index.jpg');
- editTicketPage.clickSaveAttachment();
- expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
- });
- });
- describe('checking for add hourly line item with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Hourly');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- });
- });
- describe('checking for add rental line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see rental form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Rental');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qwe');
- editTicketPage.fillDaysStandby('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add service line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see service form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- expect(editTicketPage.tittle.getText()).toEqual('Service');
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLine();
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('qwe');
- editTicketPage.fillStartMinutes('qwe');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('qwe');
- editTicketPage.fillEndMinutes('qwe');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add miscellaneous line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select service ticket', () => {
- dashboardPage.selectItem('Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillDaysStandby('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- });
- ---------------------------------------------------------------
- wells.spec
- 'use strict';
- const pageObject = require('./../../services').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const wellsPage = pageObject.getWellsPage();
- const addWellsPage = pageObject.getAddWellsPage();
- const viewPage = pageObject.getViewPage();
- const skuPage = pageObject.getSkuPage();
- const addSkuPage = pageObject.getAddSkuPage();
- const signInData = require('./../../data/sign_in');
- const dashboardData = require('./../../data/dashboard');
- const wellsData = require('./../../data/oil_field/wells');
- const commonHelper = require('./../../services/helpers/common.helper');
- var strftime = require('strftime');
- describe('Wells', () => {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var owner = wellsData.addWells.owner;
- var location = wellsData.addWells.location;
- var latitude = wellsData.addWells.latitude;
- var longitude = wellsData.addWells.longitude;
- var description = wellsData.addWells.description;
- var direction = wellsData.addWells.direction;
- var addSkuTittle = wellsData.addWells.tittle;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add new wells location', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(signInData.link);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on wells in menu', () => {
- dashboardPage.openMenu('Oil Field');
- dashboardPage.clickWells();
- });
- it('should click on add wells', () => {
- wellsPage.clickAddLocation();
- expect(addSkuPage.pageTitle()).toEqual(addSkuTittle);
- });
- it('should add wells', () => {
- addWellsPage.selectOwnerWells(owner);
- addWellsPage.fillLocation(location + time);
- addWellsPage.fillLatitude(latitude);
- addWellsPage.fillLongtitude(longitude);
- addWellsPage.fillDescription(description + time);
- addWellsPage.fillDirection(direction + time);
- addWellsPage.clickSave();
- commonHelper.waitUntilElementVisible(wellsPage.txtSearch);
- });
- /*
- Disabled due to problem with search
- it('should search wells', () => {
- wellsPage.fillSearch(time);
- });
- it('should click on wells details',()=>{
- skuPage.clickDetails();
- commonHelper.waitUntilElementPresent(viewPage.btnBack);
- });
- it('should see wells details',()=>{
- expect(viewPage.pageTitle(location + time).isDisplayed()).toBe(true);
- expect(viewPage.getTable(description + time).isDisplayed()).toBe(true);
- expect(viewPage.getTable('Roosevelt').isDisplayed()).toBe(true);
- });
- */
- });
- describe('checking for cancel adding well', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(signInData.link);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on wells in menu', () => {
- dashboardPage.openMenu('Oil Field');
- dashboardPage.clickWells();
- });
- it('should click on add wells', () => {
- wellsPage.clickAddLocation();
- expect(addSkuPage.pageTitle()).toEqual(addSkuTittle);
- });
- it('should fill field and cancel wells', () => {
- addWellsPage.selectOwnerWells(owner);
- addWellsPage.fillLocation(location + time);
- addWellsPage.fillLatitude(latitude);
- addWellsPage.fillLongtitude(longitude);
- addWellsPage.fillDescription(description + time);
- addWellsPage.fillDirection(direction + time);
- dashboardPage.clickCancel();
- commonHelper.waitUntilElementVisible(wellsPage.txtSearch);
- });
- /*
- Disabled due to problem with search
- it('should search wells', () => {
- wellsPage.fillSearch(time);
- });
- it('should click on wells details',()=>{
- skuPage.clickDetails();
- commonHelper.waitUntilElementPresent(viewPage.btnBack);
- });
- it('should see wells details',()=>{
- expect(viewPage.pageTitle(location + time).isDisplayed()).toBe(true);
- expect(viewPage.getTable(description + time).isDisplayed()).toBe(true);
- expect(viewPage.getTable('Roosevelt').isDisplayed()).toBe(true);
- });
- */
- });
- });
- -----------------------------------------------------------
- workover_ticket.spec
- 'use strict';
- const pageObject = require('./../../../services/index').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const editTicketPage = pageObject.getEditTicketPage();
- const signInData = require('./../../../data/sign_in/index');
- const dashboardData = require('./../../../data/dashboard/index');
- const ticketsData = require('./../../../data/tickets/index');
- const commonHelper = require('./../../../services/helpers/common.helper.js');
- var strftime = require('strftime');
- describe('workover tickets', () => {
- var loginLink = signInData.link;
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var afe = ticketsData.ticket.afe;
- var jobCode = ticketsData.ticket.jobCode;
- var errorMessage = ticketsData.errorMessage;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add hourly line item in workover ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Hourly');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Hourly table', () => {
- expect(editTicketPage.getRate('Hourly', '1')).toEqual('$10.00/hr');
- expect(editTicketPage.getUnitsMin('Hourly', '1')).toEqual('20 Hours');
- expect(editTicketPage.getMin('Hourly', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Hourly', '1')).toEqual('$190.00');
- expect(editTicketPage.getNote('Hourly', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add rental line item in workover ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see rental form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Rental');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('10');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- editTicketPage.fillDaysStandby('40');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('300');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in Rental table', () => {
- expect(editTicketPage.getRate('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getStandBy('Rental', '1')).toEqual('$10.00/day');
- expect(editTicketPage.getUnitStandBy('Rental', '1')).toEqual('40 Days');
- expect(editTicketPage.getUnitsMin('Rental', '1')).toEqual('20 Days');
- expect(editTicketPage.getMin('Rental', '1')).toEqual('$300.00');
- expect(editTicketPage.getAmount('Rental', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Rental', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add service line item in workover ticket', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see service form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Service');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('10');
- editTicketPage.fillStartMinutes('15');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('10');
- editTicketPage.fillEndMinutes('30');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('20');
- editTicketPage.fillRate('10');
- editTicketPage.fillHours('20');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('200.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('190.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in service table', () => {
- expect(editTicketPage.getRate('Service', '1')).toEqual('$10.00/ea');
- expect(editTicketPage.getUnitsMin('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getMin('Service', '1')).toEqual('$100.00');
- expect(editTicketPage.getAmount('Service', '1')).toEqual('$190.00');
- expect(editTicketPage.getUnitUsed('Service', '1')).toEqual('20 Units');
- expect(editTicketPage.getNote('Service', '1')).toEqual('Note: ' + time);
- expect(editTicketPage.getStartDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:15:00 AM');
- expect(editTicketPage.getEndDate('Service', '1')).toEqual(strftime('%b %e, %Y ', tomorrowDate) + '10:30:00 AM');
- });
- });
- describe('checking for add miscellaneous line item in pineline ticket', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('10');
- editTicketPage.fillRate('10');
- editTicketPage.fillDaysStandby('40');
- editTicketPage.fillHours('20');
- editTicketPage.fillQuantity('30');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('700.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('5');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('100');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('665.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should display saved line in other table', () => {
- expect(editTicketPage.getRate('Other', '1')).toEqual('$10.00/wk');
- expect(editTicketPage.getAmount('Other', '1')).toEqual('$665.00');
- expect(editTicketPage.getNote('Other', '1')).toEqual('Note: ' + time);
- });
- });
- describe('checking for add new signature', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add signature button', () => {
- editTicketPage.clickAddSignature();
- expect(editTicketPage.btnSaveSignature.isDisplayed()).toBe(true);
- });
- it('should add signature ', () => {
- editTicketPage.fillSignatureName(username);
- editTicketPage.selectSignatureStyle();
- editTicketPage.fillSignatureEmail(password);
- editTicketPage.selectSignatureCertify();
- });
- it('should rate signature and feedback', () => {
- editTicketPage.ratePunctuality();
- editTicketPage.rateCompetence();
- editTicketPage.rateProfessionalism();
- editTicketPage.fillFeedback(time)
- });
- it('should click on checkbox signature', () => {
- editTicketPage.btnCheckboxSignature.click();
- expect(editTicketPage.chkSignature().isPresent()).toBe(true);
- });
- it('should save signature', () => {
- editTicketPage.clickSaveSignature();
- expect(editTicketPage.SignatureBlock.isPresent()).toBe(true);
- });
- });
- describe('checking for add note', () => {
- var time = commonHelper.uniqueValue();
- var note = commonHelper.randomString(36, 10);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click on add note',() => {
- editTicketPage.clickAddNotes();
- expect(editTicketPage.btnSaveNote.isDisplayed()).toBe(true);
- });
- it('should add notes', () => {
- editTicketPage.fillNote(note);
- editTicketPage.clickSaveNote();
- });
- it('should see note', () => {
- commonHelper.waitUntilElementPresent(editTicketPage.btnAddNotes);
- expect(editTicketPage.notePresent(note).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new member', () => {
- var time = commonHelper.uniqueValue();
- var user = 'Admin Selenium';
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add member',() => {
- editTicketPage.clickAddMember();
- expect(editTicketPage.btnMemberSaved.isDisplayed()).toBe(true);
- });
- it('should add member',() => {
- editTicketPage.memberCheckbox(user).click();
- expect(editTicketPage.chkMember().isPresent()).toBe(true);
- editTicketPage.clickMemberSaved();
- });
- it('should see new member', () => {
- expect(editTicketPage.teamMemberIsPresennt(user).isDisplayed()).toBe(true);
- });
- });
- describe('checking for add new attachment', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should click add attachment',() => {
- editTicketPage.clickAddAttachment();
- expect(editTicketPage.mdlNewAttachment.isDisplayed()).toBe(true);
- });
- it('should add new attachment',() => {
- editTicketPage.uploadAttachment('index.jpg');
- editTicketPage.clickSaveAttachment();
- expect(editTicketPage.attachment('index.jpg').isDisplayed()).toBe(true);
- });
- });
- describe('checking for add hourly line item with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Hourly');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Hourly');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- });
- });
- describe('checking for add rental line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Rental');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Rental');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('Per day');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qe');
- editTicketPage.fillDaysStandby('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add service line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- var tomorrowDate = new Date();
- tomorrowDate.setDate(tomorrowDate.getDate() + 1);
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see hourly form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Service');
- editTicketPage.selectSubCategory('All');
- editTicketPage.clickSaveClose();
- });
- it('should edit new line', () => {
- editTicketPage.clickEditLineItem('Service');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should select hour', () => {
- editTicketPage.selectHour('Each');
- });
- it('should set start date',() => {
- editTicketPage.selectStartDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillStartHour('qwe');
- editTicketPage.fillStartMinutes('qwe');
- });
- it('should set end date',() => {
- editTicketPage.selectEndDate(strftime('%m/%d/%Y', tomorrowDate));
- editTicketPage.fillEndHour('qwe');
- editTicketPage.fillEndMinutes('qwe');
- });
- it('should set rate and hours', () => {
- editTicketPage.fillQuantity('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillHours('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line', () => {
- editTicketPage.clickSaveClose();
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- describe('checking for add miscellaneous line item in ticket with errors', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(loginLink);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should redirect on dashboard page after login', () => {
- signInPage.login(username, password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should click on plus button and select workover ticket', () => {
- dashboardPage.selectItem('Workover Service Ticket');
- expect(editTicketPage.btnSaveTicket.isDisplayed()).toBe(true);
- });
- it('should save ticket header', () => {
- editTicketPage.fillLocation('Location' + time);
- editTicketPage.fillAfe(afe);
- editTicketPage.fillJobCode(jobCode);
- editTicketPage.clickSave();
- expect(editTicketPage.btnNewLine.isDisplayed()).toBe(true);
- });
- it('should add line item and see Miscellaneous form', () => {
- editTicketPage.clickNewLine();
- editTicketPage.selectCategory('Miscellaneous');
- });
- it('should set note', () => {
- editTicketPage.fillLineNote(time);
- });
- it('should set rate and hours', () => {
- editTicketPage.selectHour('week');
- editTicketPage.fillStandbyRate('qwe');
- editTicketPage.fillRate('qwe');
- editTicketPage.fillDaysStandby('qwe');
- editTicketPage.fillHours('qwe');
- editTicketPage.fillQuantity('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should set discount', () => {
- editTicketPage.fillDiscount('qwe');
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should see minimum', () => {
- editTicketPage.fillMinimum('qwe');
- editTicketPage.clickLineNote();
- });
- it('should see total updates', () => {
- expect(editTicketPage.getTotal()).toEqual('0.00');
- });
- it('should save line and see errors', () => {
- editTicketPage.clickSaveClose();
- browser.sleep(2000);
- expect(editTicketPage.getErrorRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorStandByRate()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHourMin()).toEqual(errorMessage);
- expect(editTicketPage.getErrorDiscount()).toEqual(errorMessage);
- expect(editTicketPage.getErrorHoursUsed()).toEqual(errorMessage);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement