Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!