refactor(ticket_basic-data): test e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2021-12-22 08:11:33 +01:00
parent e609994efa
commit 67dc5c2cbc
3 changed files with 7 additions and 7 deletions

View File

@ -669,7 +669,6 @@ INSERT INTO `vn`.`ticketTracking`(`ticketFk`, `stateFk`, `workerFk`, `created`)
(24, 16, 21, NOW()), (24, 16, 21, NOW()),
(27, 3, 21, NOW()); (27, 3, 21, NOW());
INSERT INTO `vn`.`stowaway`(`id`, `shipFk`, `created`) INSERT INTO `vn`.`stowaway`(`id`, `shipFk`, `created`)
VALUES VALUES
(12, 13, CURDATE()); (12, 13, CURDATE());

View File

@ -563,7 +563,6 @@ export default {
transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text', transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text',
transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable', transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable',
firstSaleId: 'vn-ticket-sale vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(6) > span', firstSaleId: 'vn-ticket-sale vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(6) > span',
firstSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(1)',
firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]', firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img', firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img',

View File

@ -8,7 +8,7 @@ describe('Ticket Edit basic data path', () => {
beforeAll(async() => { beforeAll(async() => {
browser = await getBrowser(); browser = await getBrowser();
page = browser.page; page = browser.page;
await page.loginAndModule('employee', 'ticket'); await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('11'); await page.accessToSearchResult('11');
await page.accessToSection('ticket.card.basicData.stepOne'); await page.accessToSection('ticket.card.basicData.stepOne');
}); });
@ -95,7 +95,7 @@ describe('Ticket Edit basic data path', () => {
const tomorrow = new Date(); const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
await page.accessToSearchResult('14'); await page.accessToSearchResult('27');
await page.accessToSection('ticket.card.basicData.stepOne'); await page.accessToSection('ticket.card.basicData.stepOne');
const originalDate = await page const originalDate = await page
@ -105,6 +105,7 @@ describe('Ticket Edit basic data path', () => {
await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Silla247'); await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Silla247');
await page.pickDate(selectors.ticketBasicData.shipped, tomorrow); await page.pickDate(selectors.ticketBasicData.shipped, tomorrow);
await page.waitToClick(selectors.ticketBasicData.nextStepButton); await page.waitToClick(selectors.ticketBasicData.nextStepButton);
await page.waitToClick(selectors.ticketBasicData.withoutNegatives); await page.waitToClick(selectors.ticketBasicData.withoutNegatives);
@ -122,6 +123,7 @@ describe('Ticket Edit basic data path', () => {
it(`should new ticket have one line from splited ticket`, async() => { it(`should new ticket have one line from splited ticket`, async() => {
const tomorrow = new Date(); const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
const expectedDay = tomorrow.getDate(); const expectedDay = tomorrow.getDate();
const expectedMonth = tomorrow.getMonth() + 1; const expectedMonth = tomorrow.getMonth() + 1;
const expectedYear = tomorrow.getFullYear(); const expectedYear = tomorrow.getFullYear();
@ -140,8 +142,8 @@ describe('Ticket Edit basic data path', () => {
expect(item).toEqual('4'); expect(item).toEqual('4');
expect(agency).toEqual('Silla247'); expect(agency).toEqual('Silla247');
expect(date[0]).toContain(expectedDay); expect(parseInt(date[0])).toEqual(expectedDay);
expect(date[1]).toContain(expectedMonth); expect(parseInt(date[1])).toEqual(expectedMonth);
expect(date[2]).toContain(expectedYear); expect(parseInt(date[2])).toEqual(expectedYear);
}); });
}); });