e2e create client path get to basic data tests

This commit is contained in:
Carlos 2017-10-29 18:52:21 +01:00
parent 70afe95459
commit 19192236b0
2 changed files with 31 additions and 3 deletions

View File

@ -19,7 +19,7 @@ export default {
clientsIndex: {
searchClientInput: 'body > vn-app > vn-vertical > vn-vertical > vn-client-index > div > div > vn-card:nth-child(1) > div > vn-horizontal > vn-searchbar > form > vn-horizontal > vn-textfield > div > input',
searchButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-index > div > div > vn-card:nth-child(1) > div > vn-horizontal > vn-searchbar > form > vn-horizontal > vn-icon-button > button',
searchResult: 'body > vn-app > vn-vertical > vn-vertical > vn-client-index > div > div > vn-card:nth-child(2) > div > vn-item-client',
searchResult: 'body > vn-app > vn-vertical > vn-vertical > vn-client-index > div > div > vn-card:nth-child(2) > div > vn-item-client:nth-child(1) > a',
createClientButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-index > div > a > vn-float-button > button'
},
createClientView: {

View File

@ -4,8 +4,9 @@ import selectors from '../helpers/selectors.js';
import {catchErrors} from '../../services/utils/jasmineHelpers';
const nightmare = createNightmare();
const moduleAccessViewHashURL = '#!/';
const basicDataViewHashURL = '#!/clients/14/basic-data';
fdescribe('Clients path', () => {
describe('Clients path', () => {
describe('Create', () => {
it('should log in', done => {
nightmare
@ -160,7 +161,7 @@ fdescribe('Clients path', () => {
// the below tests should be enabled when the e2e execution restores fixtures
it(`should create a new user with all it's data`, done => {
// it(`should create a new user with all it's data`, done => {
// nightmare
// .waitForSnackbarReset()
// .wait(selectors.createClientView.email)
@ -195,5 +196,32 @@ fdescribe('Clients path', () => {
// })
// .catch(catchErrors(done));
// });
// it(`should search for the user Carol Danvers to confirm it exists`, done => {
// nightmare
// .wait(selectors.clientsIndex.searchResult)
// .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
// .click(selectors.clientsIndex.searchButton)
// .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
// .countSearchResults(selectors.clientsIndex.searchResult)
// .then(result => {
// expect(result).toBe(1);
// done();
// })
// .catch(catchErrors(done));
// });
// it(`should click on the search result to access to the client's basic data`, done => {
// nightmare
// .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
// .waitToClick(selectors.clientsIndex.searchResult) // this is targeting Bruce Wayne 1 of 10 times instead of Carol Danvers watchout for intermitence
// .waitForURL(basicDataViewHashURL)
// .url()
// .then(url => {
// expect(url).toBe(config.url + basicDataViewHashURL);
// done();
// })
// .catch(catchErrors(done));
// });
});
});