e2e client path tests, full user creation pending

This commit is contained in:
Carlos 2017-09-17 20:01:15 +02:00
parent 8597dab1de
commit 639c7e901e
2 changed files with 92 additions and 3 deletions

View File

@ -18,9 +18,9 @@ export default {
createClientView: { createClientView: {
name: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(1) > div > input', name: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(1) > div > input',
taxNumber: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(2) > div > input', taxNumber: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(2) > div > input',
BusinessName: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(3) > div > input', businessName: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-textfield:nth-child(1) > div > input',
UserName: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(4) > div > input', userName: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-textfield:nth-child(2) > div > input',
email: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-textfield:nth-child(5) > div > input', email: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-card > div > vn-vertical > vn-horizontal:nth-child(4) > vn-textfield > div > input',
createButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-button-bar > vn-button > button' createButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-create > form > div > vn-button-bar > vn-button > button'
} }
}; };

View File

@ -55,4 +55,93 @@ describe('Clients path', () => {
done(); done();
}); });
}); });
it('should receive an error when clicking the create button having all the form fields empty but name', done => {
nightmare
.wait(3000)
.type(selectors.createClientView.name, 'Bruce Wayne')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toContain(`Error:`);
done();
});
});
it('should receive an error when clicking the create button having all the form fields empty but Tax Number', done => {
nightmare
.wait(3000)
.clearInput(selectors.createClientView.name)
.type(selectors.createClientView.taxNumber, 'Wayne Industries Tax Number')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toContain(`Error:`);
done();
});
});
it('should receive an error when clicking the create button having all the form fields empty but Business Name', done => {
nightmare
.wait(3000)
.clearInput(selectors.createClientView.taxNumber)
.type(selectors.createClientView.businessName, 'Wayne Industries')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toContain(`Error:`);
done();
});
});
it('should receive an error when clicking the create button having all the form fields empty but User Name', done => {
nightmare
.wait(3000)
.clearInput(selectors.createClientView.businessName)
.type(selectors.createClientView.userName, 'Batman')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toContain(`Error:`);
done();
});
});
it('should receive an error when clicking the create button having all the form fields empty but email while email have incorrect format', done => {
nightmare
.wait(3000)
.clearInput(selectors.createClientView.userName)
.type(selectors.createClientView.email, 'I will save Gotham!')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toBe(`Algunos campos no son válidos`);
done();
});
});
it('should receive an error when clicking the create button having all the form fields empty but email', done => {
nightmare
.wait(3000)
.clearInput(selectors.createClientView.email)
.type(selectors.createClientView.email, 'IAmBatman@WayneIndustries.gotham')
.click(selectors.createClientView.createButton)
.wait(100)
.wait(selectors.globalItems.snackbar)
.getInnerText(selectors.globalItems.snackbar)
.then(result => {
expect(result).toContain(`Error:`);
done();
});
});
}); });