e2e mandate path plus fixtures update
This commit is contained in:
parent
953eca5ad7
commit
178e4ccb28
|
@ -134,5 +134,9 @@ export default {
|
||||||
typeSecondOption: `${components.vnAutocomplete}[field="$ctrl.greuge.greugeTypeFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-auto:nth-child(2) > ul > li`,
|
typeSecondOption: `${components.vnAutocomplete}[field="$ctrl.greuge.greugeTypeFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-auto:nth-child(2) > ul > li`,
|
||||||
saveButton: `${components.vnSubmit}`,
|
saveButton: `${components.vnSubmit}`,
|
||||||
firstGreugeText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-greuge-list > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
firstGreugeText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-greuge-list > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
||||||
|
},
|
||||||
|
mandate: {
|
||||||
|
mandateButton: `${components.vnMenuItem}[ui-sref="clientCard.mandate"]`,
|
||||||
|
firstMandateText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-mandate > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
import config from '../helpers/config.js';
|
||||||
|
import createNightmare from '../helpers/nightmare';
|
||||||
|
import selectors from '../helpers/selectors.js';
|
||||||
|
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
||||||
|
const nightmare = createNightmare();
|
||||||
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||||
|
|
||||||
|
describe('mandate path', () => {
|
||||||
|
describe('warm up', () => {
|
||||||
|
it('should warm up login and fixtures', done => {
|
||||||
|
nightmare
|
||||||
|
.login()
|
||||||
|
.waitForURL(moduleAccessViewHashURL)
|
||||||
|
.waitToClick(selectors.globalItems.logOutButton)
|
||||||
|
.then(() => {
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should log in', done => {
|
||||||
|
nightmare
|
||||||
|
.login()
|
||||||
|
.waitForURL(moduleAccessViewHashURL)
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toEqual(config.url + moduleAccessViewHashURL);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should make sure the language is English', done => {
|
||||||
|
nightmare
|
||||||
|
.changeLanguageToEnglish()
|
||||||
|
.then(() => {
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should click on the Clients button of the top bar menu', done => {
|
||||||
|
nightmare
|
||||||
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||||
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||||
|
.waitToClick(selectors.globalItems.clientsButton)
|
||||||
|
.wait(selectors.clientsIndex.createClientButton)
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toEqual(config.url + '#!/clients');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should search for the user Petter Parker', done => {
|
||||||
|
nightmare
|
||||||
|
.wait(selectors.clientsIndex.searchResult)
|
||||||
|
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
|
||||||
|
.click(selectors.clientsIndex.searchButton)
|
||||||
|
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
|
||||||
|
.countSearchResults(selectors.clientsIndex.searchResult)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual(1);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should click on the search result to access to the client's mandate`, done => {
|
||||||
|
nightmare
|
||||||
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter')
|
||||||
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
|
.waitToClick(selectors.mandate.mandateButton)
|
||||||
|
.waitForURL('mandate')
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toContain('mandate');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should confirm the client has a mandate of the CORE type', done => {
|
||||||
|
nightmare
|
||||||
|
.wait(selectors.mandate.firstMandateText)
|
||||||
|
.getInnerText(selectors.mandate.firstMandateText)
|
||||||
|
.then(value => {
|
||||||
|
expect(value).toContain('1');
|
||||||
|
expect(value).toContain('WAY');
|
||||||
|
expect(value).toContain('CORE');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
});
|
|
@ -525,5 +525,5 @@ INSERT INTO `vn`.`mandateType`(`id`, `name`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`mandate`(`id`, `clientFk`, `companyFk`, `code`, `created`, `mandateTypeFk`)
|
INSERT INTO `vn`.`mandate`(`id`, `clientFk`, `companyFk`, `code`, `created`, `mandateTypeFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 442, '1-1', CURDATE(), 2);
|
(1, 2, 442, '1-1', CURDATE(), 2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue