Skip to content

Commit

Permalink
Merge pull request #19955 from mshima/skip_ci-fix_cypress
Browse files Browse the repository at this point in the history
cypress template path should be constant
  • Loading branch information
DanielFran authored Oct 25, 2022
2 parents e35eef3 + f0d9070 commit 9620de0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions generators/cypress/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@

const faker = require('@faker-js/faker');

const constants = require('../generator-constants');

const { stringHashCode } = require('../utils');

const CYPRESS_TEMPLATES_DIR = `${constants.CLIENT_TEST_SRC_DIR}cypress/`;

const cypressFiles = {
common: [
{
Expand All @@ -34,7 +38,8 @@ const cypressFiles = {
],
clientTestFw: [
{
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: [
'.eslintrc.json',
'fixtures/integration-test.png',
Expand All @@ -50,12 +55,14 @@ const cypressFiles = {
},
{
condition: generator => !generator.authenticationTypeOauth2,
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: ['e2e/account/login-page.cy.ts'],
},
{
condition: generator => !generator.authenticationTypeOauth2 && !generator.databaseTypeNo && !generator.applicationTypeMicroservice,
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: [
'e2e/account/register-page.cy.ts',
'e2e/account/settings-page.cy.ts',
Expand All @@ -65,14 +72,16 @@ const cypressFiles = {
},
{
condition: generator => generator.authenticationTypeOauth2,
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: ['support/oauth2.ts'],
},
],
audit: [
{
condition: generator => generator.cypressAudit,
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: ['e2e/lighthouse.audits.ts'],
},
{
Expand All @@ -83,7 +92,8 @@ const cypressFiles = {
coverage: [
{
condition: generator => generator.cypressCoverage,
path: generator => generator.cypressFolder,
path: CYPRESS_TEMPLATES_DIR,
renameTo: (ctx, file) => `${ctx.cypressFolder}${file}`,
templates: ['plugins/global.d.ts'],
},
],
Expand Down

0 comments on commit 9620de0

Please sign in to comment.