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

111
Views
Feature flags in Next js application

I am using Cypress to test my Next.js application. Also I have set feature flags to hide a specific item. In _app.js I wrapped my components like this:

<FlagsContainer><Component {...props} /></FlagsContainer>

Inside FlagsContainer I fetch my feature flags from an external service and if the page for example corresponds to login I hide that page. The feature is working well.

Also I test my app using Cypress and Cucumber. Taking into account that for local environment the feature flag is not set, my tests are working because the page is displayed, but on prod env. the feature flag is set and the page will be hidden, and deploying the app to prod will run again the CI making the test to fail because the page won't be there. Inside my Cucumber file I have a test like this:

Scenario: Get login page
   Given i am on welcome page
   And i click on login page
   Then i should see login page
 

Also I implemented this test and all works.

How to avoid failing the Cypress test on production? How to run the tests/scenarios taking into account that when the flag is set to true the scenario above should work and if is false another scenario should be applied? How to configure Cypress?

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!