e2e path updated for clonation
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-12-24 13:15:14 +01:00
parent e6106b1aa9
commit 68f2976c2d
2 changed files with 29 additions and 1 deletions

View File

@ -674,7 +674,14 @@ export default {
confirmButton: '.vn-confirm.shown button[response="accept"]',
},
routeIndex: {
addNewRouteButton: 'vn-route-index a[ui-sref="route.create"]'
anyResult: 'vn-table a',
firstRouteCheckbox: 'a:nth-child(1) vn-td:nth-child(1) > vn-check',
addNewRouteButton: 'vn-route-index a[ui-sref="route.create"]',
cloneButton: 'vn-route-index button > vn-icon[icon="icon-clone"]',
submitClonationButton: 'tpl-buttons > button[response="accept"]',
openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]',
searchAgencyAutocomlete: 'vn-route-search-panel vn-autocomplete[ng-model="filter.agencyModeFk"]',
advancedSearchButton: 'vn-route-search-panel button[type=submit]',
},
createRouteView: {
worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',

View File

@ -57,5 +57,26 @@ describe('Route create path', () => {
it(`should confirm the redirection to the created route summary`, async() => {
await page.waitForState('route.card.summary');
});
it(`should navigate back to the route index`, async() => {
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
await page.waitForState('route.index');
});
it(`should clone the first route`, async() => {
await page.waitToClick(selectors.routeIndex.firstRouteCheckbox);
await page.waitToClick(selectors.routeIndex.cloneButton);
await page.waitToClick(selectors.routeIndex.submitClonationButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should search for the agency of the cloned routes and find two results`, async() => {
await page.waitToClick(selectors.routeIndex.openAdvancedSearchButton);
await page.autocompleteSearch(selectors.routeIndex.searchAgencyAutocomlete, 'inhouse pickup');
await page.waitToClick(selectors.routeIndex.advancedSearchButton);
await page.waitForNumberOfElements(selectors.routeIndex.anyResult, 2);
});
});
});