Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contacts.po
- 'use strict';
- const pageObject = require('./../../services').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const addContactsPage = pageObject.getAddContactPage();
- const contactsPage = pageObject.getContactsPage();
- const jobCodePage = pageObject.getJobCodePage();
- const signInData = require('./../../data/sign_in');
- const dashboardData = require('./../../data/dashboard');
- const commonHelper = require('./../../services/helpers/common.helper');
- var strftime = require('strftime');
- describe('Contacts', () => {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking for add contacts from menu', () => {
- 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 contacts from menu', () => {
- dashboardPage.openMenu('Contacts');
- expect(dashboardPage.pageTitle()).toEqual('Contacts');
- });
- it('should click on add contacts', () => {
- contactsPage.clickAddContact();
- commonHelper.waitUntilElementVisible(addContactsPage.txtContactName);
- });
- it('should add contacts', () => {
- addContactsPage.fillContactName('Gabe' + time);
- addContactsPage.fillContactLastName('Malcovich'+ time);
- addContactsPage.fillContactTitle('QA' + time);
- addContactsPage.selectContactCompany('Chevron');
- addContactsPage.selectContactOffices('Chevron Corporate Offices');
- addContactsPage.fillContactNumber(time);
- addContactsPage.fillContactEmail(time + '@mailinator.com');
- });
- it('should save contacts', () => {
- addContactsPage.saveCompany();
- });
- it('should search contacts', () => {
- contactsPage.fillSearchContact(time);
- contactsPage.waitForContact(time);
- });
- it('should see contacts details',()=>{
- jobCodePage.clickDetails();
- expect(contactsPage.getTable('QA' + time));
- expect(addContactsPage.getTable(time + '@mailinator.com'));
- expect(addContactsPage.getTable(time));
- expect(contactsPage.getTable('Gabe' + time + ' Malcovich' + time));
- });
- });
- describe('checking for add office', () => {
- 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 contacts from menu', () => {
- dashboardPage.openMenu('Contacts');
- expect(dashboardPage.pageTitle()).toEqual('Contacts');
- });
- it('should click on companies tab', () => {
- contactsPage.clickCompaniesTab();
- commonHelper.waitUntilElementVisible(contactsPage.btnAddOffice);
- });
- it('should click on add office', () => {
- contactsPage.clickAddOffice();
- commonHelper.waitUntilElementVisible(contactsPage.txtOfficeName);
- });
- it('should add office', () => {
- contactsPage.selectContactOffices('Chevron');
- contactsPage.fillOfficeName('Batcave' + time);
- contactsPage.selectRegion('Roosevelt');
- contactsPage.fillOfficePhone(time);
- contactsPage.fillOfficeAttn('Inc.' + time);
- contactsPage.fillOfficeLine1(time);
- contactsPage.fillOfficeLine2(time);
- contactsPage.fillOfficeCity('Lyon' + time);
- contactsPage.fillOfficeState('Minnesota' + time);
- contactsPage.fillOfficeZip(time);
- contactsPage.fillOfficeCountry('Country' + time);
- contactsPage.clickSave();
- });
- it('should search office', () => {
- contactsPage.fillSearchCompany('Chevron');
- contactsPage.waitForContact('Batcave' + time);
- });
- });
- describe('checking for cancel adding contacts from menu', () => {
- 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 contacts from menu', () => {
- dashboardPage.openMenu('Contacts');
- expect(dashboardPage.pageTitle()).toEqual('Contacts');
- });
- it('should click on add contacts', () => {
- contactsPage.clickAddContact();
- commonHelper.waitUntilElementVisible(addContactsPage.txtContactName);
- });
- it('should add contacts', () => {
- addContactsPage.fillContactName('Gabe' + time);
- addContactsPage.fillContactLastName('Malcovich'+ time);
- addContactsPage.fillContactTitle('QA' + time);
- addContactsPage.selectContactCompany('Chevron');
- addContactsPage.selectContactOffices('Chevron Corporate Offices');
- addContactsPage.fillContactNumber(time + time);
- addContactsPage.fillContactEmail(time + '@mailinator.com');
- });
- it('should cancel contacts', () => {
- addContactsPage.cancelContacts();
- });
- it('should search contacts', () => {
- contactsPage.fillSearchContact(time + time);
- expect(jobCodePage.searchCode(time + time).isPresent()).toBe(false);
- });
- });
- describe('checking for cancel adding office', () => {
- 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 contacts from menu', () => {
- dashboardPage.openMenu('Contacts');
- expect(dashboardPage.pageTitle()).toEqual('Contacts');
- });
- it('should click on companies tab', () => {
- contactsPage.clickCompaniesTab();
- commonHelper.waitUntilElementVisible(contactsPage.btnAddOffice);
- });
- it('should click on add office', () => {
- contactsPage.clickAddOffice();
- commonHelper.waitUntilElementVisible(contactsPage.txtOfficeName);
- });
- it('should cancel adding office', () => {
- contactsPage.selectContactOffices('Chevron');
- contactsPage.fillOfficeName('Wave' + time);
- contactsPage.selectRegion('Roosevelt');
- contactsPage.fillOfficePhone(time);
- contactsPage.fillOfficeAttn('Inc.' + time);
- contactsPage.fillOfficeLine1(time);
- contactsPage.fillOfficeLine2(time);
- contactsPage.fillOfficeCity('Lyon' + time);
- contactsPage.fillOfficeState('Minnesota' + time);
- contactsPage.fillOfficeZip(time);
- contactsPage.fillOfficeCountry('Country' + time);
- contactsPage.clickCancel();
- });
- it('should search office', () => {
- contactsPage.fillSearchCompany('Chevron');
- expect(jobCodePage.searchCode('Wave' + time).isPresent()).toBe(false);
- });
- });
- });
- --------------------------------------------
- job_code.po
- changeStatus(status, changedStatus){
- element(by.xpath('//*[text()="Service Ticket: #' + status.trim() + '" ]/ancestor::div[@class="layout-margin-sm layout-fill md-whiteframe-1dp"]//md-select')).click();
- browser.sleep(500);
- element(by.xpath('//*[contains(@class, "md-active")]//div[contains(.,"' + changedStatus + '")]')).click();
- }
- ------------------------------------------------------------------
- manage_users.spec
- 'use strict';
- const pageObject = require('./../../services').container.PageObject;
- const signInPage = pageObject.getSignInPage();
- const dashboardPage = pageObject.getDashboardPage();
- const profilePage = pageObject.getProfilePage();
- const addUserPage = pageObject.getAddUserPage();
- const addCompanyPage = pageObject.getAddCompanyPage();
- const addContactsPage = pageObject.getAddContactPage();
- const jobCodePage = pageObject.getJobCodePage();
- const signInData = require('./../../data/sign_in');
- const dashboardData = require('./../../data/dashboard');
- const profileData = require('./../../data/profile');
- const commonHelper = require('./../../services/helpers/common.helper');
- describe('Manage users', () => {
- var username = signInData.adminAccount.username;
- var password = signInData.adminAccount.password;
- var dashboardTitle = dashboardData.title;
- var firstName = profileData.profile.firstName;
- var lastName = profileData.profile.lastName;
- var title = profileData.profile.title;
- var email = profileData.profile.email;
- var phoneNumber = profileData.profile.phoneNumber;
- var usernameManager = profileData.profile.username;
- var passwordManager = profileData.profile.password;
- var editFirstName = profileData.editProfile.firstName;
- var editLastName = profileData.editProfile.lastName;
- var editTitle = profileData.editProfile.title;
- var editEmail = profileData.editProfile.email;
- var editPhoneNumber = profileData.editProfile.phoneNumber;
- var editUsername = profileData.editProfile.username;
- beforeAll(() => {
- browser.ignoreSynchronization = false;
- browser.driver.manage().window().setSize(1440, 900);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- describe('checking add user', () => {
- var time = commonHelper.uniqueValue();
- beforeAll(() => {
- browser.get(signInData.link);
- });
- afterAll(() => {
- commonHelper.clearAllData();
- });
- it('should open login page', () => {
- expect(signInPage.btnLogin.isDisplayed()).toBe(true);
- });
- 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 manage users', () => {
- dashboardPage.clickUser();
- commonHelper.waitUntilElementVisible(dashboardPage.btnManageUser);
- dashboardPage.clickManageUsers();
- expect(dashboardPage.pageTitle()).toEqual('Users');
- });
- it('should click on add user', () => {
- profilePage.clickAddUser();
- commonHelper.waitUntilElementVisible(addUserPage.txtFirstName);
- });
- it('should add user', () => {
- addUserPage.fillFirstName(firstName + time);
- addUserPage.fillLastName(lastName + time);
- addUserPage.fillTitle(title + time);
- addUserPage.fillEmail(time + email);
- addUserPage.fillPhoneNumber(phoneNumber);
- addUserPage.fillUsername(usernameManager + time.trim());
- addUserPage.fillPassword(passwordManager);
- addUserPage.fillPasswordConfirm(passwordManager);
- });
- it('should save user',() => {
- addCompanyPage.clickSave();
- expect(dashboardPage.pageTitle()).toEqual('Users');
- });
- it('should logout', () => {
- dashboardPage.clickUser();
- dashboardPage.clickLogout();
- commonHelper.waitUntilElementVisible(signInPage.btnLogin);
- });
- it('should login as new user', () => {
- signInPage.login(usernameManager + time.trim(), passwordManager);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- it('should logout', () => {
- dashboardPage.clickUser();
- dashboardPage.clickLogout();
- commonHelper.waitUntilElementVisible(signInPage.btnLogin);
- });
- 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 manage users', () => {
- dashboardPage.clickUser();
- commonHelper.waitUntilElementVisible(dashboardPage.btnManageUser);
- dashboardPage.clickManageUsers();
- expect(dashboardPage.pageTitle()).toEqual('Users');
- });
- it('should click edit user', () => {
- addContactsPage.fillSearchContacts(time);
- jobCodePage.clickDetails();
- commonHelper.waitUntilElementVisible(addUserPage.txtFirstName);
- });
- it('should edit user', () => {
- addUserPage.fillFirstName(editFirstName + time);
- addUserPage.fillLastName(editLastName + time);
- addUserPage.fillTitle(editTitle + time);
- addUserPage.fillEmail(time + editEmail);
- addUserPage.fillPhoneNumber(editPhoneNumber);
- addUserPage.fillUsername(editUsername + time.trim());
- addUserPage.fillPassword(password);
- addUserPage.fillPasswordConfirm(password);
- });
- it('should save edited user',() => {
- addCompanyPage.clickSave();
- expect(dashboardPage.pageTitle()).toEqual('Users');
- });
- it('should logout', () => {
- dashboardPage.clickUser();
- dashboardPage.clickLogout();
- commonHelper.waitUntilElementVisible(signInPage.btnLogin);
- });
- it('should login as edited user', () => {
- signInPage.login(editUsername + time.trim(), password);
- commonHelper.waitUntilElementPresent(dashboardPage.menu);
- expect(dashboardPage.pageTitle()).toEqual(dashboardData.title);
- });
- });
- });
- --------------------------------------------------
- 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;
- 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);
- });
- });
- });
- --------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement