path unstable
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-03-20 12:05:45 +01:00
parent 249c6b1bec
commit 569f67ffba
2 changed files with 122 additions and 0 deletions

View File

@ -368,6 +368,13 @@ export default {
advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"]',
newTicketButton: 'vn-ticket-index a',
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
secondTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(2) > vn-td:nth-child(1) > vn-check',
thirdTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(3) > vn-td:nth-child(1) > vn-check',
sixthTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(6) > vn-td:nth-child(1) > vn-check',
payoutButton: 'vn-ticket-index vn-button[icon="icon-recovery"]',
payoutCompany: '.vn-dialog vn-autocomplete[ng-model="$ctrl.receipt.companyFk"]',
payoutBank: '.vn-dialog vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]',
submitPayout: '.vn-dialog vn-button[label="Save"]',
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)',
topbarSearch: 'vn-searchbar',

View File

@ -0,0 +1,115 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
xdescribe('Ticket index payout path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
});
afterAll(async() => {
await browser.close();
});
it('should navigate to the ticket index', async() => {
await page.loginAndModule('administrative', 'ticket');
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
});
it('should check three tickets 2 of a clinet and 1 of another', async() => {
await page.keyboard.press('Enter');
await page.waitToClick(selectors.ticketsIndex.secondTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.sixthTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('You cannot make a payment on account from multiple clients');
});
it('should uncheck the sixth ticket result and check the third which is from the same client then open the payout form', async() => {
await page.waitToClick(selectors.ticketsIndex.sixthTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton);
await page.waitForSelector(selectors.ticketsIndex.payoutCompany);
});
it('should fill the company and bank to perform a payout', async() => {
await page.autocompleteSearch(selectors.ticketsIndex.payoutBank, 'cash');
await page.waitToClick(selectors.ticketsIndex.submitPayout);
const result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should navigate to the client balance section', async() => {
await page.waitToClick(selectors.globalItems.homeButton);
// await page.selectModule('client');
// await page.accessToSearchResult('Bruce Wayne');
// await page.accessToSection('client.card.balance.index');
// await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
// let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
// expect(result).toEqual(4);
});
it('should B', async() => {
// await page.waitToClick(selectors.globalItems.homeButton);
await page.selectModule('client');
// await page.accessToSearchResult('Bruce Wayne');
// await page.accessToSection('client.card.balance.index');
// await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
// let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
// expect(result).toEqual(4);
});
it('should C', async() => {
// await page.waitToClick(selectors.globalItems.homeButton);
// await page.selectModule('client');
await page.accessToSearchResult('Bruce Wayne');
// await page.accessToSection('client.card.balance.index');
// await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
// let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
// expect(result).toEqual(4);
});
it('should D', async() => {
// await page.waitToClick(selectors.globalItems.homeButton);
// await page.selectModule('client');
// await page.accessToSearchResult('Bruce Wayne');
await page.accessToSection('client.card.balance.index');
// await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
// let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
// expect(result).toEqual(4);
});
it('should E', async() => {
// await page.waitToClick(selectors.globalItems.homeButton);
// await page.selectModule('client');
// await page.accessToSearchResult('Bruce Wayne');
// await page.accessToSection('client.card.balance.index');
await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
// let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
// expect(result).toEqual(4);
});
it('should F', async() => {
// await page.waitToClick(selectors.globalItems.homeButton);
// await page.selectModule('client');
// await page.accessToSearchResult('Bruce Wayne');
// await page.accessToSection('client.card.balance.index');
// await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr');
let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr');
expect(result).toEqual(4);
});
});