#1587 e2e client.create Añadir código postal

This commit is contained in:
Carlos Jimenez Ruiz 2019-10-04 13:13:14 +02:00
parent e158bd5811
commit 82fd9505ea
1 changed files with 14 additions and 2 deletions

View File

@ -65,6 +65,18 @@ describe('Client create path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should attempt to create a new user with all it's data but wrong postal code`, async() => {
const result = await nightmare
.clearInput(selectors.createClientView.email)
.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es')
.clearInput(selectors.createClientView.postcode)
.write(selectors.createClientView.postcode, '479999')
.waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual(`The postcode doesn't exists. Ensure you put the correct format`);
});
it(`should check for autocompleted city, province and country`, async() => { it(`should check for autocompleted city, province and country`, async() => {
const clientCity = await nightmare const clientCity = await nightmare
.waitToGetProperty(`${selectors.createClientView.city}`, 'value'); .waitToGetProperty(`${selectors.createClientView.city}`, 'value');
@ -82,8 +94,8 @@ describe('Client create path', () => {
it(`should create a new user with all correct data`, async() => { it(`should create a new user with all correct data`, async() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.createClientView.email) .clearInput(selectors.createClientView.postcode)
.write(selectors.createClientView.email, 'caroldanvers@verdnatura.es') .write(selectors.createClientView.postcode, '46000')
.waitToClick(selectors.createClientView.createButton) .waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar(); .waitForLastSnackbar();