import { browser, element, by } from 'protractor'; import { HelpDeskPage } from './helpDesk.po'; import { DispatchPage } from '../dispatch-page/dispatch.po'; type result = any; let hd = new HelpDeskPage(); let dis = new DispatchPage(); describe('Helpdesk Page', () => { it ('show the Tickets Page', async () => { await hd.navigateTo(); await dis.waitForItemToBeVisible(dis.topBarUser); await expect(dis.pageHeader.getText()).toBe(hd.helpdeskTitle); }); it ('create a bug ticket with note', async() => { await hd.createBugTicket(); await hd.createBugNote(); await expect(hd.noteTimeline.isDisplayed()).toBeTruthy(); await hd.saveTicket.click(); await browser.sleep(1000); await expect(hd.confirmSave.isDisplayed()).toBeTruthy(); }); it ('create a request ticket with note', async() => { await hd.createRequestTicket(); await hd.createRequestNote(); await expect(hd.noteTimeline.isDisplayed()).toBeTruthy(); await hd.saveTicket.click(); await browser.sleep(1000); await expect(hd.confirmSave.isDisplayed()).toBeTruthy(); }); it ('should edit note in Ticket', async () =>{ await hd.editTicketAddNote(); await hd.saveTicket.click(); await expect(hd.confirmSave.isDisplayed()).toBeTruthy(); }); it('go back to Dispatch page',async () =>{ await element(by.linkText('Dispatch')).click(); await browser.sleep(6000); await dis.refreshBtn.click(); await browser.sleep(2000); }); // it ('should count the rows', async () =>{ // var row = element.all(by.className('ui-table-tbody')); // var value = row.all(by.tagName("tr")); // await value.getSize().then(function(rowCount){ // console.log("Count: "+ rowCount) // }); // await browser.sleep(2000) // }); });