ws-nextjs-app/cypress/support/helpers/runTestsForPage.ts

Summary

Maintainability
A
0 mins
Test Coverage
export default ({ pageType, testSuites }) => {
  testSuites.forEach(testData => {
    const { path, tests, runforEnv, ...params } = testData;
    const cypressEnv = Cypress.env('APP_ENV');
    if (runforEnv.includes(cypressEnv)) {
      before(() => {
        cy.visit(path);
      });
      tests.forEach(test => test({ path, pageType, ...params }));
    }
  });
};