fix cypress test: should enable correct menu items 89/99289/4
authorEylon Malin <eylon.malin@intl.att.com>
Sun, 8 Dec 2019 08:12:01 +0000 (10:12 +0200)
committerEylon Malin <eylon.malin@intl.att.com>
Sun, 8 Dec 2019 09:09:16 +0000 (09:09 +0000)
Issue-ID: VID-724
The cypress test not handling well scroll bar so decrease data

Change-Id: I7541b7127866bb0cc8651d80ab2721846eafabde
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json

index 054f785..9a0c1aa 100644 (file)
@@ -70,34 +70,46 @@ describe('Instantiation status', function () {
     cy.get('table#instantiation-status tbody tr').should('have.length', 3);
   });
 
+  function getDropDownMenuByDataTestId(testId:String) {
+    return cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='${testId}']`);
+  }
+
+  function clickOnTitleAndThenOnMenuWithJobId(jobId: string) {
+    cy.getElementByDataTestsId("instantiation-status-title").click();
+    cy.get('#' + jobId).find('.menu-div').click();
+  }
+
   it('should enable correct menu items', function () {
-        cy.openIframe('app/ui/#/instantiationStatus');
-
-        // Instantiate action with Job status FAILED - isRetry = true
-        cy.get( '#5c2cd8e5-27d0-42e3-85a1-85db5eaba459').find('.menu-div').click();
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-retry']`).should('not.exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-remove']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-open']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-hide']`).should('not.exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-audit-info']`).should('not.exist');
-
-        // Instantiate action with Job status FAILED - isRetry = false
-        cy.get( '#e1db03c3-6274-4ff7-84cf-7bd3a3946de7').find('.menu-div').click();
-        cy.get('.dropdown-menu').find(`[data-tests-id='context-menu-retry']`).should('not.be.visible');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-open']`).should('exist');
-
-        //Delete action with Job status IN_PROGRESS
-        cy.get( '#850dc7d2-5240-437f-9bcd-b1ed7dc339c2').find('.menu-div').click();
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-remove']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-open']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-hide']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-audit-info']`).should('not.exist');
-        //Update action with Job status COMPLETED
-        cy.get( '#850dc7d2-5240-437f-9bcd-b1ed7dc339c1').find('.menu-div').click();
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-remove']`).should('exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-open']`).should('not.exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-hide']`).should('not.exist');
-        cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-audit-info']`).should('not.exist');
+
+    cy.openIframe('app/ui/#/instantiationStatus');
+
+    // Instantiate action with Job status FAILED - isRetry = true
+
+    clickOnTitleAndThenOnMenuWithJobId('5c2cd8e5-27d0-42e3-85a1-85db5eaba459');
+    getDropDownMenuByDataTestId('context-menu-retry').should('not.exist');
+    getDropDownMenuByDataTestId('context-menu-remove').should('exist');
+    getDropDownMenuByDataTestId('context-menu-open').should('exist');
+    getDropDownMenuByDataTestId('context-menu-hide').should('not.exist');
+    getDropDownMenuByDataTestId('context-menu-audit-info').should('not.exist');
+
+    // Instantiate action with Job status FAILED - isRetry = false
+    clickOnTitleAndThenOnMenuWithJobId('e1db03c3-6274-4ff7-84cf-7bd3a3946de7');
+    getDropDownMenuByDataTestId('context-menu-retry').should('not.be.visible');
+    getDropDownMenuByDataTestId('context-menu-open').should('exist');
+
+    //Delete action with Job status IN_PROGRESS
+    clickOnTitleAndThenOnMenuWithJobId('850dc7d2-5240-437f-9bcd-b1ed7dc339c2');
+    getDropDownMenuByDataTestId('context-menu-remove').should('exist');
+    getDropDownMenuByDataTestId('context-menu-open').should('exist');
+    getDropDownMenuByDataTestId('context-menu-hide').should('exist');
+    getDropDownMenuByDataTestId('context-menu-audit-info').should('not.exist');
+
+    //Update action with Job status COMPLETED
+    clickOnTitleAndThenOnMenuWithJobId('850dc7d2-5240-437f-9bcd-b1ed7dc339c1');
+    getDropDownMenuByDataTestId('context-menu-remove').should('exist');
+    getDropDownMenuByDataTestId('context-menu-open').should('not.exist');
+    getDropDownMenuByDataTestId('context-menu-hide').should('not.exist');
+    getDropDownMenuByDataTestId('context-menu-audit-info').should('not.exist');
   });
 
 });
index 01eda95..c6fc4eb 100644 (file)
     "createdBulkDate": 1524991828000,
     "isRetryEnabled": false
   },
-  {
-    "id": 2,
-    "created": 1524663233000,
-    "modified": 1524663236000,
-    "action": "INSTANTIATE",
-    "createdId": null,
-    "modifiedId": null,
-    "rowNum": null,
-    "auditUserId": null,
-    "auditTrail": null,
-    "jobId": "b1ff271b-829a-43f9-a2e3-23987a34f261",
-    "templateId": "262fccc5-cae9-4258-b522-540c4010e0a9",
-    "userId": "16807000",
-    "aLaCarte": true,
-    "msoRequestId": "c0011670-0e1a-4b74-945d-8bf5aede1d98",
-    "jobStatus": "FAILED",
-    "statusModifiedDate": 1524663233000,
-    "hidden": false,
-    "pause": false,
-    "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
-    "owningEntityName": "WayneHolland",
-    "project": "WATKINS",
-    "aicZoneId": "NFT1",
-    "aicZoneName": "NFTJSSSS-NFT1",
-    "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054",
-    "tenantName": "AIN Web Tool-15-D-testalexandria",
-    "regionId": "hvf6",
-    "regionName": null,
-    "serviceType": "TYLER SILVIA",
-    "subscriberName": "e433710f-9217-458d-a79d-1c7aff376d89",
-    "serviceInstanceId": null,
-    "serviceInstanceName": "sPenLiZXXpqzsVck instance name_02",
-    "serviceModelId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
-    "serviceModelName": "action-data",
-    "serviceModelVersion": "1.0",
-    "createdBulkDate": 1524663233000,
-    "isRetryEnabled": true
-  },
-  {
-    "id": 1,
-    "created": 1524663233000,
-    "modified": 1524663236000,
-    "action": "INSTANTIATE",
-    "createdId": null,
-    "modifiedId": null,
-    "rowNum": null,
-    "auditUserId": null,
-    "auditTrail": null,
-    "jobId": "850dc7d2-5240-437f-9bcd-b1ed7dc339ca",
-    "templateId": "262fccc5-cae9-4258-b522-540c4010e0a9",
-    "userId": "16807000",
-    "aLaCarte": true,
-    "msoRequestId": "c0011670-0e1a-4b74-945d-8bf5aede1d45",
-    "jobStatus": "IN_PROGRESS",
-    "statusModifiedDate": 1524663233000,
-    "hidden": false,
-    "pause": false,
-    "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
-    "owningEntityName": "WayneHolland",
-    "project": "WATKINS",
-    "aicZoneId": "NFT1",
-    "aicZoneName": "NFTJSSSS-NFT1",
-    "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054",
-    "tenantName": "AIN Web Tool-15-D-testalexandria",
-    "regionId": "hvf6",
-    "regionName": null,
-    "serviceType": "TYLER SILVIA",
-    "subscriberName": "e433710f-9217-458d-a79d-1c7aff376d89",
-    "serviceInstanceId": null,
-    "serviceInstanceName": "sPenLiZXXpqzsVck instance name_01",
-    "serviceModelId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
-    "serviceModelName": "action-data",
-    "serviceModelVersion": "1.0",
-    "createdBulkDate": 1524663233000,
-    "isRetryEnabled": false
-  },
   {
   "id": 9,
   "created": 1524663233000,