Updated e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-05-14 14:30:43 +02:00
parent 62d27e45e2
commit e51341102b
4 changed files with 20 additions and 10 deletions

View File

@ -613,7 +613,8 @@ export default {
firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]', firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]',
secondLineDestination: 'vn-claim-action vn-tr:nth-child(2) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]', secondLineDestination: 'vn-claim-action vn-tr:nth-child(2) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]',
firstDeleteLine: 'vn-claim-action vn-tr:nth-child(1) vn-icon-button[icon="delete"]', firstDeleteLine: 'vn-claim-action vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
isPaidWithManaCheckbox: 'vn-check[ng-model="$ctrl.claim.isChargedToMana"]' isPaidWithManaCheckbox: 'vn-claim-action vn-check[ng-model="$ctrl.claim.isChargedToMana"]',
hasToPickUpCheckbox: 'vn-claim-action vn-check[ng-model="$ctrl.claim.hasToPickUp"]'
}, },
ordersIndex: { ordersIndex: {
searchResult: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr', searchResult: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr',

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js'; import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer'; import getBrowser from '../../helpers/puppeteer';
describe('Claim action path', () => { fdescribe('Claim action path', () => {
let browser; let browser;
let page; let page;
@ -66,17 +66,26 @@ describe('Claim action path', () => {
}); });
it('should check the "is paid with mana" checkbox', async() => { it('should check the "is paid with mana" checkbox', async() => {
page.waitFor(3000); // can't use waitForNavigation here and needs more time than a single second to get the section ready... // page.waitFor(3000); // can't use waitForNavigation here and needs more time than a single second to get the section ready...
await page.waitToClick(selectors.claimAction.isPaidWithManaCheckbox); await page.waitToClick(selectors.claimAction.isPaidWithManaCheckbox);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.type).toBe('success'); expect(message.type).toBe('success');
}); });
it('should confirm the "is paid with mana" checkbox is checked', async() => { it('should check the "Pick up" checkbox', async() => {
await page.reloadSection('claim.card.action'); await page.waitToClick(selectors.claimAction.hasToPickUpCheckbox);
const result = await page.checkboxState(selectors.claimAction.isPaidWithManaCheckbox); const message = await page.waitForSnackbar();
expect(result).toBe('checked'); expect(message.type).toBe('success');
});
it('should confirm the "is paid with mana" and "Pick up" checkbox are checked', async() => {
await page.reloadSection('claim.card.action');
const isPaidWithManaCheckbox = await page.checkboxState(selectors.claimAction.isPaidWithManaCheckbox);
const hasToPickUpCheckbox = await page.checkboxState(selectors.claimAction.hasToPickUpCheckbox);
expect(isPaidWithManaCheckbox).toBe('checked');
expect(hasToPickUpCheckbox).toBe('checked');
}); });
}); });

View File

@ -46,8 +46,8 @@
</vn-range> </vn-range>
</vn-tool-bar> </vn-tool-bar>
<vn-check vn-one class="vn-mr-md" <vn-check vn-one class="vn-mr-md"
label="Pickup" label="Pick up"
ng-model="::$ctrl.claim.hasToPickUp" ng-model="$ctrl.claim.hasToPickUp"
on-change="$ctrl.save({hasToPickUp: value})"> on-change="$ctrl.save({hasToPickUp: value})">
</vn-check> </vn-check>
<vn-check vn-one <vn-check vn-one

View File

@ -10,4 +10,4 @@ Do you want to insert greuges?: Desea insertar greuges?
Insert greuges on client card: Insertar greuges en la ficha del cliente Insert greuges on client card: Insertar greuges en la ficha del cliente
Greuge inserted: Greuge insertado Greuge inserted: Greuge insertado
ClaimGreugeDescription: Reclamación id {{claimId}} ClaimGreugeDescription: Reclamación id {{claimId}}
Pickup: Recoger Pick up: Recoger