Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
Cypress iterate through array of objects and click requisite permission types

I am currently trying to create a test that will check all privileges based on the array of objects passed in for an application. The idea is I would pass in the array and identify within each key the access and the type and then select those elements on the webpage. I am not sure what the correct looping structure is for this as I feel a nested loop within a loop is wrong. My example is below. The Page object is just a quick mock of what I currently was thinking of for handling the inner loop by no means a final product. I believe there is a better way possibly leveraging Cypress more but am unsure how any insight is appreciated

// Spec Test

     const permissions = [
       "overview page" : {
         view: false,
         create: false,
         edit: true,
       },
       "campaigns" : {
         view: false,
         create: false,
         edit: true,
       }
     ]
    permissionPage.setPermissions(permissions)
//Page object
     const permissions = [];

     for (const [key, value] of Permissions.entries(permissions)) {
       cy.get("tr").children("td").contains(key).parents("tr").children("td");
         if (value === true) {
          cy.clickOn(key)
       }
     }
  }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda