remove import and add force in order to fix cypress
[vid.git] / vid-webpack-master / cypress / integration / iFrames / instantiationStatus.e2e.ts
index 56a2491..094ea83 100644 (file)
@@ -33,6 +33,9 @@ describe('Instantiation status', function () {
       const serviceAction:any = {INSTANTIATE : 'Instantiate', DELETE: 'Delete', UPDATE: 'Update', UPGRADE: 'Upgrade'};
       cy.openIframe('app/ui/#/instantiationStatus');
       for(let i = 0 ; i < asyncRes.length; i++){
+        cy.getTableRowByIndex('instantiation-status', i).get(`td custom-icon#jobStatusIcon-${i} div`)
+        .should('have.class', `__${getJobIconClass(asyncRes[i].jobStatus)}`);
+
         if(asyncRes[i].project){
           cy.getTableRowByIndex('instantiation-status', i).get('td#project span').contains(asyncRes[i].project);
         }
@@ -60,6 +63,29 @@ describe('Instantiation status', function () {
     }
   });
 
+  function getJobIconClass(status: string) : string{
+    switch(`${status}`.toUpperCase()) {
+      case  'PENDING' :
+        return "pending";
+      case  'IN_PROGRESS' :
+        return  "in_progress";
+      case  'PAUSED' :
+        return "pause";
+      case  'FAILED' :
+        return "x-circle-o";
+      case  'COMPLETED' :
+        return "success-circle-o";
+      case  'STOPPED' :
+        return "stop";
+      case  'COMPLETED_WITH_ERRORS' :
+        return "success_with_warning";
+      case  'COMPLETED_AND_PAUSED' :
+        return "stopped-upon-success";
+      default:
+        return "question-mark-circle-o";
+    }
+  }
+
   it('should filter rows by filter text', function () {
     cy.openIframe('app/ui/#/instantiationStatus');
     cy.getElementByDataTestsId("instantiation-status-filter").type("ComplexService");
@@ -78,7 +104,7 @@ describe('Instantiation status', function () {
 
   function clickOnTitleAndThenOnMenuWithJobId(jobId: string) {
     cy.getElementByDataTestsId("instantiation-status-title").click();
-    cy.get('#' + jobId).find('.menu-div').click();
+    cy.get('#' + jobId).find('.menu-div').click({force: true});
   }
 
   it('should disabled correct menu items', function () {
@@ -86,7 +112,6 @@ describe('Instantiation status', function () {
     cy.openIframe('app/ui/#/instantiationStatus');
 
     // Instantiate action with Job status FAILED - isRetry = true
-
     clickOnTitleAndThenOnMenuWithJobId('5c2cd8e5-27d0-42e3-85a1-85db5eaba459');
     getDisabledDropDownItemByDataTestId('context-menu-retry').should('not.exist');
     getDisabledDropDownItemByDataTestId('context-menu-remove').should('exist');
@@ -116,6 +141,13 @@ describe('Instantiation status', function () {
     getDisabledDropDownItemByDataTestId('context-menu-hide').should('not.exist');
     getDisabledDropDownItemByDataTestId('context-menu-audit-info').should('not.exist');
     getDisabledDropDownItemByDataTestId(contextMenuCreateAnotherOne).should('exist');
+
+    //COMPLETED_AND_PAUSED
+    clickOnTitleAndThenOnMenuWithJobId('850dc7d2-5240-437f-9bcd-b1ed7dc339d9');
+    getDisabledDropDownItemByDataTestId('context-menu-retry').should('exist');
+    getDisabledDropDownItemByDataTestId('context-menu-open').should('exist');
+    getDisabledDropDownItemByDataTestId('context-menu-audit-info').should('exist');
+    getDisabledDropDownItemByDataTestId(contextMenuCreateAnotherOne).should('exist');
   });
 
   it('clicking on create another one item, go to expected url', function () {