diff --git a/functional/cypress-tests/cypress/fixtures/credentialsEndpoints.js b/functional/cypress-tests/cypress/fixtures/credentialsEndpoints.js index 64823d913..789dbdff8 100644 --- a/functional/cypress-tests/cypress/fixtures/credentialsEndpoints.js +++ b/functional/cypress-tests/cypress/fixtures/credentialsEndpoints.js @@ -16,6 +16,16 @@ export const testEndpoint = timestamp => { }; }; +export const testEndpointByIp = timestamp => { + return { + label: `TE-${timestamp}`, + url: 'https://123.123.123.13:9082', + publicUrl: 'https://123.123.123.13:9082', + credentials: `TC-${timestamp}`, + id: `TE-${timestamp}` + }; +}; + export const testLbl = 'test'; export const editedLbl = 'EditedLabel'; diff --git a/functional/cypress-tests/cypress/integration/credentialsEndpoints.js b/functional/cypress-tests/cypress/integration/credentialsEndpoints.js index 2257d7316..f30c8809b 100644 --- a/functional/cypress-tests/cypress/integration/credentialsEndpoints.js +++ b/functional/cypress-tests/cypress/integration/credentialsEndpoints.js @@ -2,6 +2,7 @@ import { testCredential, testEndpoint, + testEndpointByIp, testLbl, editedLbl } from '../fixtures/credentialsEndpoints'; @@ -102,7 +103,9 @@ describe('Credentials and endpoints', () => { cy.get('[data-cy="endpoint-form-credentials-input"]').click(); cy.get('[role="listbox"]').within(() => { - cy.contains('li', `${testCredential(timestamp).label}`).click(); + cy.contains('li', `${testCredential(timestamp).label}`) + .scrollIntoView() + .click(); }); cy.get('[data-cy="endpoint-form-submit-button"]').click(); cy.get('[data-cy="app-dialog-content"]').should( @@ -111,10 +114,35 @@ describe('Credentials and endpoints', () => { ); }); + it('User can add new endpoint by IP and with port number. New endpoints label is visible', () => { + cy.get('[data-cy="add-endpoint-add-button"]').click(); + cy.get('[data-cy="endpoint-form-label-input"]') + .type(testEndpointByIp(testLbl).label + '2') + .blur(); + + cy.get('[data-cy="endpoint-form-url-input"]') + .type(testEndpointByIp(testLbl).url) + .blur(); + + cy.get('[data-cy="endpoint-form-public-url-input"]') + .type(testEndpointByIp(testLbl).publicUrl) + .blur(); + + cy.get('[data-cy="endpoint-form-credentials-input"]').click(); + cy.get('[role="listbox"]').within(() => { + cy.contains('li', `${testCredential(timestamp).label}`).click(); + }); + cy.get('[data-cy="endpoint-form-submit-button"]').click(); + cy.get('[data-cy="app-dialog-content"]').should( + 'contain', + testEndpointByIp(testLbl).label + '2' + ); + }); + it('User cannot add endpoints with existing label', () => { cy.get('[data-cy="add-endpoint-add-button"]').click(); cy.get('[data-cy="endpoint-form-label-input"]') - .type(testEndpoint(timestamp).label) + .type(testEndpoint(testLbl).label) .blur(); cy.get('[data-cy="endpoint-form-label-input-error"]') .should('be.visible') @@ -145,6 +173,22 @@ describe('Credentials and endpoints', () => { 'not.contain', testEndpoint(timestamp).label ); + cy.contains('li.MuiListItem-container', testEndpoint(testLbl).label + '2') + .find('[data-cy="delete-endpoint-delete-button"]') + .click(); + cy.get('[data-cy="confirmation-dialog-ok"]').click(); + cy.get('[data-cy="app-dialog-content"]').should( + 'not.contain', + testEndpoint(testLbl).label + '2' + ); + cy.contains('li.MuiListItem-container', testEndpoint('EditedLabel').label) + .find('[data-cy="delete-endpoint-delete-button"]') + .click(); + cy.get('[data-cy="confirmation-dialog-ok"]').click(); + cy.get('[data-cy="app-dialog-content"]').should( + 'not.contain', + testEndpoint('EditedLabel').label + ); }); }); @@ -240,6 +284,17 @@ describe('Credentials and endpoints', () => { 'not.contain', testCredential(timestamp).label ); + cy.contains( + 'li.MuiListItem-container', + testCredential('EditedLabel').label + ) + .find('[data-cy="delete-credential-delete-button"]') + .click(); + cy.get('[data-cy="confirmation-dialog-ok"]').click(); + cy.get('[data-cy="app-dialog-content"]').should( + 'not.contain', + testCredential('EditedLabel').label + ); }); }); });