From 548c5a220333c7cd666b861e737bff0b45461f18 Mon Sep 17 00:00:00 2001 From: "Stone, Avi (as206k)" Date: Sun, 3 Jun 2018 13:12:12 +0300 Subject: Update FE project Update FE to latest version so that fe can run on docker Change-Id: I9c5dee756b567dbe64fac6d3d6fd89362813bdcc Issue-ID: SDC-1359 Signed-off-by: Stone, Avi (as206k) --- public/cypress/integration/mocks/homePage-spec.ts | 75 +++++++++++++---------- 1 file changed, 41 insertions(+), 34 deletions(-) (limited to 'public/cypress/integration/mocks/homePage-spec.ts') diff --git a/public/cypress/integration/mocks/homePage-spec.ts b/public/cypress/integration/mocks/homePage-spec.ts index 2889390..5f96c98 100644 --- a/public/cypress/integration/mocks/homePage-spec.ts +++ b/public/cypress/integration/mocks/homePage-spec.ts @@ -6,11 +6,11 @@ export const buttonCreateMCSpan = () => { }; export const tableItems = () => { - return cy.get('tr[data-tests-id="monitoringComponentTableItems"]'); + return cy.get('datatable-row-wrapper'); }; -export const tableHeaders = () => { - return cy.get('tr[data-tests-id="monitoringComponentTableHeaders"]'); +export const monitoringComponentTable = () => { + return cy.get('ngx-datatable[data-tests-id="monitoringComponentTable"]'); }; export const tableItemsDeleteButton = () => { return cy.get('button[data-tests-id="tableItemsButtonDelete"]'); @@ -64,9 +64,9 @@ describe('Home Page - E2E test flow with mock', () => { }); it("Shouldn't have create table with headers", () => { - tableHeaders().should('not.be.visible'); + monitoringComponentTable().should('not.be.visible'); }); - it("Shouldn't have create table without items", () => { + it("Shouldn't have create table with items", () => { buttonCreateMC() .get('div[data-tests-id="new-monitoring-title"]') .should('contain', 'Monitoring'); @@ -100,20 +100,13 @@ describe('Home Page - E2E test flow with mock', () => { }); it('Should have create table with headers', () => { - tableHeaders().should('be.visible'); + monitoringComponentTable().should('be.visible'); }); it('Should have create table with items', () => { tableItems().should('have.length', NUMBER_OF_ITEMS); }); }); - describe('MC List Edit Tests', () => { - beforeEach(() => { - cy.getMCList(); - cy.homePage(); - }); - }); - describe('MC List Delete Tests', () => { beforeEach(() => { cy.getMCList(); @@ -126,26 +119,34 @@ describe('Home Page - E2E test flow with mock', () => { tableItemsDeleteButton().should('be.visible'); tableItemsInfoButton().should('not.be.visible'); }); - it('Mouse hover over item, call delete and remove not submitted (call delete without blueprint api)', () => { - tableItems().should('have.length', NUMBER_OF_ITEMS); - doHoverOverFirstLine(); - tableItemsDeleteButton() - .should('be.visible') - .click({ force: true }); - popupGetDeleteBtn().click({ force: true }); - tableItems().should('have.length', NUMBER_OF_ITEMS - 1); - }); - it('Mouse hover over item, call delete and remove submitted (call delete with blueprint api)', () => { - tableItems() - .should('have.length', NUMBER_OF_ITEMS) - .last() - .trigger('mouseover'); - tableItemsDeleteButton() - .should('be.visible') - .click({ force: true }); - popupGetDeleteBtn().click({ force: true }); - tableItems().should('have.length', NUMBER_OF_ITEMS - 1); - }); + it( + 'Mouse hover over item, call delete and remove not submitted (call delete without' + + ' blueprint api)', + () => { + tableItems().should('have.length', NUMBER_OF_ITEMS); + doHoverOverFirstLine(); + tableItemsDeleteButton() + .should('be.visible') + .click({ force: true }); + popupGetDeleteBtn().click({ force: true }); + tableItems().should('have.length', NUMBER_OF_ITEMS - 1); + } + ); + it( + 'Mouse hover over item, call delete and remove submitted (call delete with bluepr' + + 'int api)', + () => { + tableItems() + .should('have.length', NUMBER_OF_ITEMS) + .last() + .trigger('mouseover'); + tableItemsDeleteButton() + .should('be.visible') + .click({ force: true }); + popupGetDeleteBtn().click({ force: true }); + tableItems().should('have.length', NUMBER_OF_ITEMS - 1); + } + ); it('Mouse hover over item, call delete and cancelOperation', () => { tableItems().should('have.length', NUMBER_OF_ITEMS); doHoverOverFirstLine(); @@ -171,6 +172,7 @@ describe('Home Page - E2E test flow with mock', () => { describe('Successfully Entry Home Page Monitoring Configuration', () => { beforeEach(() => { + cy.httpGetDDLData(); cy.getMCListEmpty(); cy.homePage(); }); @@ -190,12 +192,17 @@ describe('Home Page - E2E test flow with mock', () => { it('Buttons Functionality Assertion', () => { buttonCreateMC() .click() - .get('div[data-tests-id="new-monitoring-title"]') + .get('div[data-tests-id="new-monitorying-titie"]') .should('contain', 'Monitoring'); }); }); describe('Not Auth Entry Home Page Monitoring Configuration', () => { + beforeEach(() => { + cy.httpGetDDLData(); + cy.getMCListEmpty(); + }); + it('Buttons disabled when user not owner', () => { cy.sdcIsOwnerFalse(); navigateButtonDisabled(); -- cgit 1.2.3-korg