diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 916c4dc1c..fbc1047de 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -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: { diff --git a/e2e/paths/create_client_path.spec.js b/e2e/paths/create_client_path.spec.js index ca4ac2e61..8de5bf166 100644 --- a/e2e/paths/create_client_path.spec.js +++ b/e2e/paths/create_client_path.spec.js @@ -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)); + // }); }); });