Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

92
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda