@trackunit/iris-app-e2e 1.8.91 → 1.8.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/commands/defaultCommands.js.map +0 -1
- package/src/generators/e2e-configuration/generator.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/plugins/createLogFile.js.map +0 -1
- package/src/plugins/defaultPlugins.js.map +0 -1
- package/src/plugins/nxPreset.js.map +0 -1
- package/src/plugins/writeFileWithPrettier.js.map +0 -1
- package/src/setup/defaultE2ESetup.js.map +0 -1
- package/src/setup/setupHarRecording.js.map +0 -1
- package/src/support.js.map +0 -1
- package/src/utils/Codeowner.js.map +0 -1
- package/src/utils/fileNameBuilder.js.map +0 -1
- package/src/utils/fileUpdater.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultCommands.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/commands/defaultCommands.ts"],"names":[],"mappings":";;AAIA,oDAsIC;AA1ID;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,aAAa,EACb;QACE,WAAW,EAAE,CAAC,UAAU,CAAC;KAC1B;IACD,8DAA8D;IAC9D,CAAC,OAAY,EAAE,MAAc,EAAE,UAAgC,EAAE,EAAE,EAAE;QACnE,MAAM,QAAQ,GAAG,iBAAiB,MAAM,IAAI,CAAC;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;QAEzC,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACpE,OAAO,EAAE,CAAC,IAAI,CA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AAE,CAAC,oBAAoB,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,8DAA8D;IAC9D,IAAI,MAAM,GAAQ,IAAI,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAChD,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;gBACtD,OAAO,MAAM,EAAE,IAAI,CAAC,CAAC,EAAmB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;YACvE,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,MAAM,EAAE,IAAI,CAAC,CAAC,EAAmB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;QACvE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Sets up default Cypress commands for E2E testing.\n * Adds custom commands like getByTestId, login, enterIrisApp, etc.\n */\nexport function setupDefaultCommands() {\n Cypress.Commands.add(\n \"getByTestId\",\n {\n prevSubject: [\"optional\"],\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (subject: any, testId: string, options: { timeout?: number } = {}) => {\n const selector = `[data-testid=\"${testId}\"]`;\n const timeout = options.timeout ?? 15000;\n\n if (subject) {\n if (Cypress.dom.isElement(subject) || Cypress.dom.isJquery(subject)) {\n return cy.wrap(subject, { timeout }).find(selector, { timeout });\n } else if (Cypress.dom.isWindow(subject)) {\n return cy.get(selector, { timeout });\n } else if (Array.isArray(subject)) {\n const element = subject.map(el => cy.wrap(el, { timeout }).find(selector, { timeout }));\n if (element[0]) {\n return element[0];\n }\n return cy.wrap(null);\n }\n return cy.get(selector, { timeout });\n } else {\n return cy.get(selector, { timeout });\n }\n }\n );\n\n Cypress.Commands.add(\"login\", fixture => {\n const envUrl = `${Cypress.config().baseUrl}/env`;\n cy.log(`Getting env from: ${envUrl}`);\n cy.request({\n method: \"GET\",\n url: envUrl,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then(envResponse => {\n const env = envResponse.body;\n const domain = env.auth?.url;\n if (!(Boolean(domain))) {\n throw new Error(`No domain found from servers /env found env: ${JSON.stringify(env)}`);\n }\n cy.log(`Using: ${domain}`);\n cy.clearCookies();\n cy.fixture(fixture ?? \"auth\").then(({ username, password }) => {\n const options = {\n warnBeforePasswordExpired: true,\n multiOptionalFactorEnroll: false,\n };\n\n cy.request({\n method: \"POST\",\n url: `${domain}/api/v1/authn`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: {\n username,\n password,\n options,\n },\n })\n .then(response => {\n if (response.isOkStatusCode) {\n const sessionToken = response.body.sessionToken;\n\n return cy.visit(`/auth/manager-classic#session_token=${sessionToken}&fleetHome=true`);\n } else {\n throw new Error(`Could not get a session token for user: ${username}, ${JSON.stringify(response)}`);\n }\n })\n .then(() => cy.url({ timeout: 20000 }).should(\"not.include\", \"manager-classic\")) // Wait for redirect away from manager-classic\n .url()\n .should(\"contain\", `${Cypress.config().baseUrl}`);\n cy.get(\"#host-layout-content\", { timeout: 15000 }).should(\"be.visible\"); // Wait for host layout to be visible\n });\n });\n });\n\n Cypress.Commands.add(\"switchToLocalDevMode\", () => {\n cy.getByTestId(\"developerPortalNav\").click();\n cy.url({ timeout: 15000, log: true }).should(\"contain\", \"/iris-sdk-portal\");\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n cy.getByTestId(\"localDevModeSwitch-input\").then(($ele: any) => {\n if ($ele && !$ele.is(\":checked\")) {\n cy.getByTestId(\"localDevModeSwitch-thumb\").click();\n }\n });\n });\n\n Cypress.Commands.add(\"enterIrisApp\", options => {\n return cy\n .get(`iframe[data-testid=\"${options?.testId ?? \"app-iframe\"}\"]`, { timeout: 30000 })\n .first()\n .its(\"0.contentDocument.body\", { timeout: 30000, log: true })\n .should(\"not.be.empty\")\n .then($body => {\n return () => cy.wrap($body);\n });\n });\n\n Cypress.Commands.add(\"enterStorybookPreview\", options => {\n return cy\n .get(`iframe[id=\"${options?.testId ?? \"storybook-preview-iframe\"}\"]`, { timeout: 30000 })\n .first()\n .its(\"0.contentDocument.body\", { timeout: 30000, log: true })\n .should(\"not.be.empty\")\n .then($body => {\n return () => cy.wrap($body);\n });\n });\n\n Cypress.Commands.add(\"getValidateFeatureFlags\", () => {\n cy.intercept({ url: \"**/ValidateFeatureFlags\" }).as(\"ValidateFeatureFlags\");\n cy.intercept({ url: \"**/UserPermissions\" }).as(\"UserPermissions\");\n cy.intercept({ url: \"**/ActiveSubscription\" }).as(\"ActiveSubscription\");\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ccData: any = null;\n Cypress.Commands.add(\"configCat\", value => {\n if (!ccData) {\n cy.wait(\"@ValidateFeatureFlags\").then(intercept => {\n ccData = intercept.response?.body?.data?.featureFlags;\n return ccData?.find((ff: { key: string }) => ff.key === value).state;\n });\n } else {\n return ccData?.find((ff: { key: string }) => ff.key === value).state;\n }\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app-e2e/src/generators/e2e-configuration/generator.ts"],"names":[],"mappings":";;AAqCA,8DA0NC;;AA/PD,mHAAwH;AACxH,uCAQoB;AACpB,yDAA6E;AAG7E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,KAAK,UAAU,yBAAyB,CAAC,IAAU,EAAE,OAAwC;IAClG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACnE,MAAM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AmB,EAAE,aAAa,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,2FAA2F;gBAC3F,mFAAmF;gBACnF,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;IAe1B,kBAAkB;;CAErB,CAAC;gBACM,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QACD,4DAA4D;IAC9D,CAAC;IAED,IAAA,8BAAgB,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,aAAa,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC;IAE3F,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAExB,OAAO,GAAG,EAAE;QACV,sCAAsC;QACtC,OAAO,CAAC,GAAG,CACT,mDAAmD,EACnD,IAAA,0BAAiB,EAAC,aAAa,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAC/D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import configurationGenerator, { CypressE2EConfigSchema } from \"@nx/cypress/src/generators/configuration/configuration\";\nimport {\n formatFiles,\n generateFiles,\n joinPathFragments,\n offsetFromRoot,\n readProjectConfiguration,\n Tree,\n updateProjectConfiguration,\n} from \"@nx/devkit\";\nimport { deleteFileInTree, updateFileInTree } from \"../../utils/fileUpdater\";\nimport { E2eConfigurationGeneratorSchema } from \"./schema\";\n\n/**\n * Generates E2E test configuration for an existing project using Iris App E2E library.\n *\n * This generator sets up Cypress end-to-end testing infrastructure within an existing project,\n * including configuration files, test targets, and template files that use the public\n * iris-app-e2e library for cross-platform compatibility.\n *\n * @param tree - The NX virtual file system tree\n * @param options - Configuration options for the generator\n * @param options.project - The name of the project to add E2E configuration to\n * @returns {Function} A function that logs completion message with the path to the generated test file\n * @example\n * ```bash\n * nx generate @trackunit/iris-app-e2e:e2e-configuration --project my-app\n * ```\n *\n * Generated structure:\n * - cypress.config.ts - Main Cypress configuration using Iris App E2E\n * - cypress/e2e/app.cy.ts - Sample test file\n * - cypress/support/commands.ts - Custom commands setup\n * - cypress/support/e2e.ts - Support file configuration\n * - cypress/fixtures/auth.json - Authentication fixture template\n * - Project targets for e2e and e2e-ui execution with multiple environment configurations\n */\nexport async function e2eConfigurationGenerator(tree: Tree, options: E2eConfigurationGeneratorSchema) {\n const libName = options.project.replace(new RegExp(\"/\", \"g\"), \"-\");\n const projectConfig = readProjectConfiguration(tree, libName);\n const projectRoot = projectConfig.root; // Get the actual root of the library\n const optionsWithDefaults: CypressE2EConfigSchema = {\n linter: \"none\",\n project: options.project,\n bundler: \"vite\",\n directory: \"cypress\",\n baseUrl: \"https://dev.manager.trackunit.com\",\n };\n\n // reading project.json content\n const existingProjectConfig = readProjectConfiguration(tree, options.project);\n\n // generate the cypress configuration files\n await configurationGenerator(tree, optionsWithDefaults);\n\n //adding cypress target to project.json\n updateProjectConfiguration(tree, options.project, {\n ...existingProjectConfig,\n targets: {\n ...existingProjectConfig.targets,\n \"e2e-ui\": {\n executor: \"@nx/cypress:cypress\",\n options: {\n cypressConfig: `${projectRoot}/cypress.config.ts`,\n baseUrl: \"https://dev.manager.trackunit.com\",\n headed: true,\n watch: true,\n testingType: \"e2e\",\n },\n configurations: {\n local: {\n baseUrl: \"http://localhost:3000\",\n },\n dev: {\n baseUrl: \"https://dev.manager.trackunit.com\",\n },\n stage: {\n baseUrl: \"https://stage.manager.trackunit.com\",\n },\n prod: {\n baseUrl: \"https://new.manager.trackunit.com\",\n },\n },\n },\n e2e: {\n executor: \"@nx/cypress:cypress\",\n options: {\n cypressConfig: `${projectRoot}/cypress.config.ts`,\n browser: \"chrome\",\n testingType: \"e2e\",\n },\n configurations: {\n local: {\n baseUrl: \"http://localhost:3000\",\n },\n dev: {\n baseUrl: \"https://dev.manager.trackunit.com\",\n },\n stage: {\n baseUrl: \"https://stage.manager.trackunit.com\",\n },\n prod: {\n baseUrl: \"https://new.manager.trackunit.com\",\n },\n \"feature-branch\": {},\n },\n },\n },\n });\n\n // overwrite the generated files with the custom files\n generateFiles(tree, joinPathFragments(__dirname, \"files/root\"), projectRoot, {\n ...options,\n directory: \"\",\n tmpl: \"\",\n });\n\n // Check if we're in the manager-side monorepo (has eslint-e2e.config.cjs at root)\n const isInternalWorkspace = tree.exists(\"eslint-e2e.config.cjs\");\n const workspaceEslintConfigCjsPath = \"eslint.config.cjs\";\n const workspaceEslintConfigMjsPath = \"eslint.config.mjs\";\n const eslintConfigCjsPath = joinPathFragments(projectConfig.root, \"eslint.config.cjs\");\n const eslintConfigMjsPath = joinPathFragments(projectConfig.root, \"eslint.config.mjs\");\n\n if (isInternalWorkspace) {\n // Manager-side monorepo: update existing eslint.config.cjs\n updateFileInTree(tree, eslintConfigCjsPath, _ => {\n const hasPublishNpmTag = projectConfig.tags?.includes(\"publish:npm\") ?? false;\n const publicRulesImport = hasPublishNpmTag\n ? `\\nconst publicConfig = require(\"${offsetFromRoot(projectRoot)}eslint-public.config.cjs\");`\n : \"\";\n const publicRulesSpread = hasPublishNpmTag ? \", ...publicConfig\" : \"\";\n\n return `const clientConfig = require(\"${offsetFromRoot(projectRoot)}eslint-client.config.cjs\");\nconst e2eConfig = require(\"${offsetFromRoot(projectRoot)}eslint-e2e.config.cjs\");\nconst { defineConfig } = require(\"eslint/config\");${publicRulesImport}\nmodule.exports = defineConfig([...clientConfig, ...e2eConfig${publicRulesSpread}]);\n`;\n });\n } else {\n // External workspace: extend existing config or create minimal config with Cypress support\n // Check for both .mjs and .cjs ESLint config files\n const workspaceMjsContent = tree.exists(workspaceEslintConfigMjsPath)\n ? tree.read(workspaceEslintConfigMjsPath, \"utf-8\") || \"\"\n : \"\";\n const workspaceCjsContent = tree.exists(workspaceEslintConfigCjsPath)\n ? tree.read(workspaceEslintConfigCjsPath, \"utf-8\") || \"\"\n : \"\";\n const existingMjsContent = tree.exists(eslintConfigMjsPath) ? tree.read(eslintConfigMjsPath, \"utf-8\") || \"\" : \"\";\n const existingCjsContent = tree.exists(eslintConfigCjsPath) ? tree.read(eslintConfigCjsPath, \"utf-8\") || \"\" : \"\";\n\n const cypressConfigBlock = `{\n files: [\"cypress/**/*.ts\", \"cypress/**/*.js\"],\n languageOptions: {\n globals: {\n cy: \"readonly\",\n Cypress: \"readonly\",\n describe: \"readonly\",\n it: \"readonly\",\n beforeEach: \"readonly\",\n afterEach: \"readonly\",\n before: \"readonly\",\n after: \"readonly\",\n expect: \"readonly\",\n },\n },\n rules: {\n \"@typescript-eslint/no-namespace\": \"off\",\n },\n }`;\n\n if (existingMjsContent && !existingMjsContent.includes(\"cypress\")) {\n // Update existing .mjs config to add Cypress support\n // Find the export default array and add cypress config to it\n const updatedContent = existingMjsContent.replace(\n /export\\s+default\\s+(\\[[\\s\\S]*?)(];?\\s*$)/m,\n (_, arrayContent, closing) => {\n const trimmedContent = arrayContent.trimEnd();\n const needsComma = trimmedContent.endsWith(\"}\") || trimmedContent.endsWith(\")\");\n return `export default ${trimmedContent}${needsComma ? \",\" : \"\"}\\n ${cypressConfigBlock}\\n${closing}`;\n }\n );\n tree.write(eslintConfigMjsPath, updatedContent);\n } else if (existingCjsContent && !existingCjsContent.includes(\"cypress\")) {\n // Update existing .cjs config to add Cypress support\n const eslintContent = `const baseConfig = require(\"./eslint.config.base.cjs\");\n\nmodule.exports = [\n ...(Array.isArray(baseConfig) ? baseConfig : [baseConfig]),\n ${cypressConfigBlock},\n];\n`;\n // Backup the original config\n tree.write(joinPathFragments(projectConfig.root, \"eslint.config.base.cjs\"), existingCjsContent);\n tree.write(eslintConfigCjsPath, eslintContent);\n } else if (!existingMjsContent && !existingCjsContent) {\n // No project-level config - compose with the workspace base config when available.\n if (workspaceCjsContent) {\n const eslintContent = `const { defineConfig } = require(\"eslint/config\");\nconst baseConfig = require(\"${offsetFromRoot(projectRoot)}eslint.config.cjs\");\n\nmodule.exports = defineConfig([\n ...(Array.isArray(baseConfig) ? baseConfig : [baseConfig]),\n ${cypressConfigBlock},\n]);\n`;\n tree.write(eslintConfigCjsPath, eslintContent);\n } else if (workspaceMjsContent) {\n const eslintContent = `import baseConfig from \"${offsetFromRoot(projectRoot)}eslint.config.mjs\";\n\nexport default [\n ...(Array.isArray(baseConfig) ? baseConfig : [baseConfig]),\n ${cypressConfigBlock},\n];\n`;\n tree.write(eslintConfigMjsPath, eslintContent);\n } else {\n // Final fallback for workspaces without any ESLint setup: bootstrap the same Nx React flat\n // config shape our app generators start from, then layer Cypress overrides on top.\n const eslintContent = `const nx = require(\"@nx/eslint-plugin\");\nconst { defineConfig } = require(\"eslint/config\");\n\nmodule.exports = defineConfig([\n ...nx.configs[\"flat/react\"],\n {\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.js\", \"**/*.jsx\"],\n languageOptions: {\n parserOptions: { project: [\"./tsconfig.*?.json\"] },\n },\n rules: {},\n },\n {\n ignores: [\"node_modules/**\", \"dist/**\"],\n },\n ${cypressConfigBlock},\n]);\n`;\n tree.write(eslintConfigCjsPath, eslintContent);\n }\n }\n // If eslintConfig already includes cypress, don't modify it\n }\n\n deleteFileInTree(tree, joinPathFragments(projectConfig.root, \"cypress/support/app.po.ts\"));\n\n await formatFiles(tree);\n\n return () => {\n // eslint-disable-next-line no-console\n console.log(\n \"\\n\\n\\n✅ 🚀 Please open this file to get started\\n\",\n joinPathFragments(projectConfig.root, \"cypress/e2e/app.cy.ts\")\n );\n return tree;\n };\n}\n"]}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-e2e/src/index.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;AAE7C;;;;;;GAMG;AAEH,kEAAwC;AACxC,mEAAyC;AACzC,6DAAmC;AACnC,0EAAgD","sourcesContent":["/// <reference path=\"./types/cypress.d.ts\" />\n\n/**\n * Node.js-compatible exports for Cypress config files (cypress.config.ts).\n * These can be safely imported in Node.js context during config processing.\n *\n * For browser-only exports (commands, setup functions that use Cypress global),\n * import from \"@trackunit/iris-app-e2e/support\" instead.\n */\n\nexport * from \"./plugins/createLogFile\";\nexport * from \"./plugins/defaultPlugins\";\nexport * from \"./plugins/nxPreset\";\nexport * from \"./plugins/writeFileWithPrettier\";\n\nexport type {\n CypressPluginConfig,\n E2EBehaviorConfig,\n E2EConfigOptions,\n E2EPluginConfig,\n E2EProjectConfig,\n} from \"./plugins/defaultPlugins\";\nexport type { Formatter } from \"./plugins/writeFileWithPrettier\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createLogFile.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/plugins/createLogFile.ts"],"names":[],"mappings":";;AAkBA,sCAoDC;;AAtED,iDAAoC;AACpC,wDAAwB;AACxB,mEAA2E;AAQ3E,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,EAAE;IACjC,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,aAAa,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AACrH,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,QAAgB,EAChB,wBAAgC,EAChC,IAAgB,EAChB,SAAoB;IAEpB,IAAI,CAAC,IAAA,eAAU,EAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,YAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;IAClE,IAAA,6CAAqB,EAAC,MAAM,EAAE,WAAW,GAAG,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IACzG,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAC3B,GAAG,CAAC,EAAE,CACJ,GAAG,CAAC,QAAQ,KAAK,OAAO;QACxB,0GAA0G;QAC1G,oEAAoE;QACpE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CACtD,CAAC;IACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,IAAA,6CAAqB,EACnB,MAAM,EACN,WAAW,GAAG,cAAc,EAC5B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EACzB;YACE,IAAI,EAAE,GAAG;SACV,EACD,SAAS,CACV,CAAC;IACJ,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CACnC,GAAG,CAAC,EAAE,CACJ,aAAa,CAAC,GAAG,CAAC;QAClB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;QACpC,GAAG,CAAC,QAAQ,KAAK,SAAS;QAC1B,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACvC,0GAA0G;QAC1G,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CACtD,CAAC;IACF,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,IAAA,6CAAqB,EACnB,MAAM,EACN,WAAW,GAAG,sBAAsB,EACpC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EACjC;YACE,IAAI,EAAE,GAAG;SACV,EACD,SAAS,CACV,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import fs, { existsSync } from \"fs\";\nimport path from \"path\";\nimport { Formatter, writeFileWithPrettier } from \"./writeFileWithPrettier\";\n\ntype Log = {\n type: string;\n message: string;\n severity: string;\n};\n\nconst isNetworkCall = (log: Log) => {\n return log.type === \"cy:fetch\" || log.type === \"cy:request\" || log.type === \"cy:response\" || log.type === \"cy:xrh\";\n};\n\n/**\n * Creates log files for Cypress test runs.\n * Generates separate files for all logs, errors, and network errors.\n */\nexport function createLogFile(\n nxRoot: string,\n logsPath: string,\n fileNameWithoutExtension: string,\n logs: Array<Log>,\n logWriter: Formatter\n) {\n if (!existsSync(logsPath)) {\n fs.mkdirSync(logsPath, { recursive: true });\n }\n\n const logFilePath = path.join(logsPath, fileNameWithoutExtension);\n writeFileWithPrettier(nxRoot, logFilePath + \"-all.json\", JSON.stringify(logs), { flag: \"a\" }, logWriter);\n const errorCmds = logs.filter(\n log =>\n log.severity === \"error\" &&\n // This seems to be when apollo has cancelled requests it marks it as failed to fetch only on cypress ?!??\n // might be fixed by https://github.com/Trackunit/manager/pull/12917\n !log.message.includes(\"TypeError: Failed to fetch\")\n );\n if (errorCmds.length > 0) {\n writeFileWithPrettier(\n nxRoot,\n logFilePath + \"-errors.json\",\n JSON.stringify(errorCmds),\n {\n flag: \"a\",\n },\n logWriter\n );\n }\n\n const networkErrorsCmds = logs.filter(\n log =>\n isNetworkCall(log) &&\n !log.message.includes(\"Status: 200\") &&\n log.severity !== \"success\" &&\n !log.message.includes(\"sentry.io/api/\") &&\n // This seems to be when apollo has cancelled requests it marks it as failed to fetch only on cypress ?!??\n !log.message.includes(\"TypeError: Failed to fetch\")\n );\n if (networkErrorsCmds.length > 0) {\n writeFileWithPrettier(\n nxRoot,\n logFilePath + \"-network-errors.json\",\n JSON.stringify(networkErrorsCmds),\n {\n flag: \"a\",\n },\n logWriter\n );\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultPlugins.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/plugins/defaultPlugins.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,2BAA8C;AAC9C,yCAAkC;AAClC,wDAAwB;AACxB,kDAAmE;AACnE,8DAA2D;AAC3D,mDAAgD;AAGhD;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAA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,EAAE,CAAC,MAAM,EAAE;QACT,SAAS,CAAC,QAAgB;YACxB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACrC,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,IAAA,iBAAK,EAAC,IAAA,iBAAY,EAAC,QAAQ,CAAC,CAAC,CAAC;oBAC/C,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,UAAU,CAAC,QAAgB;YACzB,OAAO,IAAA,eAAU,EAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC,CAAC;IACH,+BAA+B;IAE/B,sCAAsC;IACtC,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,IAAA,wBAAY,EAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;IACjC,oCAAoC;IAEpC,gCAAgC;IAChC,iFAAiF;IACjF,gGAAgG;IAChG,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,8BAA8B;IAC9B,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAnDW,QAAA,YAAY,gBAmDvB","sourcesContent":["import crypto from \"crypto\";\nimport { existsSync, readFileSync } from \"fs\";\nimport { parse } from \"node-xlsx\";\nimport path from \"path\";\nimport { getCodeowner, toShortTeamName } from \"../utils/Codeowner\";\nimport { fileNameBuilder } from \"../utils/fileNameBuilder\";\nimport { createLogFile } from \"./createLogFile\";\nimport { Formatter } from \"./writeFileWithPrettier\";\n\n/**\n * Utility function to find NX workspace root by looking for nx.json or workspace.json.\n * This is more reliable than hardcoded relative paths and works from any directory.\n *\n * @param startDir Starting directory for the search (defaults to current working directory)\n * @returns {string} Absolute path to the workspace root\n * @throws Error if workspace root cannot be found\n */\nfunction findWorkspaceRoot(startDir: string = process.cwd()): string {\n let currentDir = startDir;\n while (currentDir !== path.dirname(currentDir)) {\n if (existsSync(path.join(currentDir, \"nx.json\")) || existsSync(path.join(currentDir, \"workspace.json\"))) {\n return currentDir;\n }\n currentDir = path.dirname(currentDir);\n }\n throw new Error(\"Could not find NX workspace root (nx.json or workspace.json not found)\");\n}\n\nexport interface CypressPluginConfig extends Cypress.PluginConfigOptions {\n currentRetry: number | null;\n nxRoot: string;\n logsFolder: string;\n}\n\nexport interface E2EPluginConfig {\n outputPath?: string;\n logsFolder?: string;\n videosFolder?: string;\n screenshotsFolder?: string;\n harFolder?: string;\n}\n\nexport interface E2EProjectConfig {\n projectId?: string;\n specPattern?: string;\n fixturesFolder?: string;\n supportFile?: string;\n}\n\nexport interface E2EBehaviorConfig {\n defaultCommandTimeout?: number;\n retries?: { runMode: number; openMode: number };\n requestTimeout?: number;\n responseTimeout?: number;\n execTimeout?: number;\n taskTimeout?: number;\n pageLoadTimeout?: number;\n}\n\nexport interface E2EConfigOptions {\n nxRoot?: string;\n outputDirOverride?: string;\n projectConfig?: E2EProjectConfig;\n behaviorConfig?: E2EBehaviorConfig;\n pluginConfig?: E2EPluginConfig;\n}\n\n/**\n * Creates default Cypress configuration for E2E testing.\n * Supports both legacy string parameter (dirname) and new options object for backward compatibility.\n */\nexport const defaultCypressConfig: (\n optionsOrDirname?: E2EConfigOptions | string\n) => Partial<CypressPluginConfig> = optionsOrDirname => {\n // Support both old API (string/undefined) and new API (object) for backward compatibility\n const options = typeof optionsOrDirname === \"object\" ? optionsOrDirname : {};\n\n const {\n nxRoot: providedNxRoot,\n outputDirOverride,\n projectConfig = {},\n behaviorConfig = {},\n pluginConfig = {},\n } = options;\n\n // Use NX workspace detection for reliable root finding\n const nxRoot = providedNxRoot ?? findWorkspaceRoot();\n\n // For output path calculation, determine the relative path from caller to workspace root\n const callerDirname = typeof optionsOrDirname === \"string\" ? optionsOrDirname : process.cwd();\n const relativePath = path.relative(nxRoot, callerDirname);\n const dotsToNxRoot = relativePath\n .split(path.sep)\n .map(_ => \"..\")\n .join(\"/\");\n\n const envOutputDirOverride = process.env.NX_E2E_OUTPUT_DIR || outputDirOverride;\n\n // Function to build output paths that respects the override\n const buildOutputPath = (subPath: string) => {\n if (envOutputDirOverride) {\n return path.join(dotsToNxRoot, envOutputDirOverride, subPath);\n }\n return `${dotsToNxRoot}/dist/cypress/${relativePath}/${subPath}`;\n };\n\n return {\n projectId: projectConfig.projectId ?? process.env.CYPRESS_PROJECT_ID,\n defaultCommandTimeout: behaviorConfig.defaultCommandTimeout ?? 20000,\n execTimeout: behaviorConfig.execTimeout ?? 300000,\n taskTimeout: behaviorConfig.taskTimeout ?? 35000,\n pageLoadTimeout: behaviorConfig.pageLoadTimeout ?? 35000,\n // setting to undefined makes no effect on the baseUrl so child projects can override it\n baseUrl: process.env.NX_FEATURE_BRANCH_BASE_URL ?? undefined,\n\n // This avoid issues with SRI hashes changing\n modifyObstructiveCode: false,\n\n requestTimeout: behaviorConfig.requestTimeout ?? 25000,\n responseTimeout: behaviorConfig.responseTimeout ?? 150000,\n retries: behaviorConfig.retries ?? {\n runMode: 3,\n openMode: 0,\n },\n\n fixturesFolder: projectConfig.fixturesFolder ?? \"./src/fixtures\",\n downloadsFolder: pluginConfig.outputPath ?? buildOutputPath(\"downloads\"),\n logsFolder: pluginConfig.logsFolder ?? buildOutputPath(\"logs\"),\n chromeWebSecurity: false,\n reporter: \"junit\",\n reporterOptions: {\n mochaFile: buildOutputPath(\"results-[hash].xml\"),\n },\n specPattern: projectConfig.specPattern ?? \"src/e2e/**/*.e2e.{js,jsx,ts,tsx}\",\n supportFile: projectConfig.supportFile ?? \"src/support/e2e.ts\",\n nxRoot,\n\n fileServerFolder: \".\",\n video: true,\n trashAssetsBeforeRuns: false, // Don't delete videos from previous test runs (important for sequential runs)\n videosFolder: pluginConfig.videosFolder ?? buildOutputPath(\"videos\"),\n screenshotsFolder: pluginConfig.screenshotsFolder ?? buildOutputPath(\"screenshots\"),\n env: {\n hars_folders: pluginConfig.harFolder ?? buildOutputPath(\"hars\"),\n CYPRESS_RUN_UNIQUE_ID: crypto.randomUUID(),\n },\n };\n};\n\n/**\n * Sets up Cypress plugins for logging, tasks, and HAR generation.\n * Configures terminal reporting, XLSX parsing, and HTTP archive recording.\n */\nexport const setupPlugins = (\n on: Cypress.PluginEvents,\n config: CypressPluginConfig,\n logWriter: Formatter,\n installHarGenerator: (on: Cypress.PluginEvents) => void\n) => {\n /* ---- BEGIN: Logging setup ---- */\n // Read options https://github.com/archfz/cypress-terminal-report\n const options = {\n printLogsToFile: \"always\", // Ensures logs are always printed to a file\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n collectTestLogs: (context: any, logs: any) => {\n const testName = fileNameBuilder(context.test, context.state);\n\n createLogFile(config.nxRoot, config.logsFolder, testName, logs, logWriter);\n },\n };\n\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require(\"cypress-terminal-report/src/installLogsPrinter\")(on, options);\n /* ---- END: Logging setup ---- */\n\n /* ---- BEGIN: Task setup ---- */\n on(\"task\", {\n parseXlsx(filePath: string) {\n return new Promise((resolve, reject) => {\n try {\n const jsonData = parse(readFileSync(filePath));\n resolve(jsonData);\n } catch (e) {\n reject(e);\n }\n });\n },\n fileExists(filename: string): boolean {\n return existsSync(filename);\n },\n });\n /* ---- END: Task setup ---- */\n\n /* ---- BEGIN: codeowner setup ---- */\n const codeowner = toShortTeamName(getCodeowner(config.projectRoot, config.nxRoot));\n config.env.codeowner = codeowner;\n /* ---- END: codeowner setup ---- */\n\n /* ---- BEGIN: HAR setup ---- */\n // Installing the HAR geneartor should happen last according to the documentation\n // https://github.com/NeuraLegion/cypress-har-generator?tab=readme-ov-file#setting-up-the-plugin\n installHarGenerator(on);\n /* ---- END: HAR setup ---- */\n return config;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nxPreset.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/plugins/nxPreset.ts"],"names":[],"mappings":";;AA4BA,wCASC;AArCD,uEAAiE;AACjE,wFAA0E;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC7C,OAAO,IAAA,4BAAW,EAAC,QAAQ,EAAE;QAC3B,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,SAAS;QACrB,mBAAmB,EAAE;YACnB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,CAAC,IAAA,wCAAa,GAAE,CAAC;SAC3B;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { nxE2EPreset } from \"@nx/cypress/plugins/cypress-preset\";\nimport { nxViteTsPaths } from \"@nx/vite/plugins/nx-tsconfig-paths.plugin\";\n\n/**\n * Creates the standard NX E2E preset configuration for Cypress.\n * This wraps the @nx/cypress preset with our default Vite configuration.\n *\n * @param filename - Pass `__filename` from the calling cypress.config.ts\n * @example\n * ```ts\n * import { createNxPreset, CypressPluginConfig, defaultCypressConfig, setupPlugins } from \"@trackunit/iris-app-e2e\";\n * import { defineConfig } from \"cypress\";\n *\n * const nxPreset = createNxPreset(__filename);\n *\n * export default defineConfig({\n * chromeWebSecurity: false,\n * e2e: {\n * ...nxPreset,\n * ...defaultCypressConfig(__dirname),\n * async setupNodeEvents(on, config: CypressPluginConfig) {\n * await nxPreset.setupNodeEvents?.(on, config);\n * return setupPlugins(on, config, formatter, installHarGenerator);\n * },\n * },\n * });\n * ```\n */\nexport function createNxPreset(filename: string): ReturnType<typeof nxE2EPreset> {\n return nxE2EPreset(filename, {\n bundler: \"vite\",\n cypressDir: \"cypress\",\n viteConfigOverrides: {\n configFile: false,\n plugins: [nxViteTsPaths()],\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeFileWithPrettier.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/plugins/writeFileWithPrettier.ts"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,2BAAqD;AACrD,mDAA6B;AAQ7B;;;GAGG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAc,EACd,QAAgB,EAChB,OAAe,EACf,eAAiC,EAAE,QAAQ,EAAE,OAAO,EAAE,EACtD,MAAiB,EACjB,EAAE;IACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,MAAM,MAAM;SACzB,aAAa,CAAC,kBAAkB,CAAC;SACjC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC;IAChC,CAAC;IACD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxD,IAAA,kBAAa,EAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC;AA1BW,QAAA,qBAAqB,yBA0BhC","sourcesContent":["/* eslint-disable no-console */\nimport { WriteFileOptions, writeFileSync } from \"fs\";\nimport * as path from \"path\";\nimport { format, resolveConfig } from \"prettier\";\n\nexport type Formatter = {\n resolveConfig: typeof resolveConfig;\n format: typeof format;\n};\n\n/**\n * Writes a file with Prettier formatting applied.\n * Automatically detects parser based on file extension.\n */\nexport const writeFileWithPrettier = async (\n nxRoot: string,\n filePath: string,\n content: string,\n writeOptions: WriteFileOptions = { encoding: \"utf-8\" },\n writer: Formatter\n) => {\n const prettierConfigPath = path.join(nxRoot, \".prettierrc\");\n const options = await writer\n .resolveConfig(prettierConfigPath)\n .catch(error => console.log(\"Prettier config error: \", error));\n if (!options) {\n throw new Error(\"Could not find prettier config\");\n }\n\n if (filePath.endsWith(\"json\")) {\n options.parser = \"json\";\n } else {\n options.parser = \"typescript\";\n }\n try {\n const prettySrc = await writer.format(content, options);\n writeFileSync(filePath, prettySrc, writeOptions);\n } catch (error) {\n console.error(\"Error in prettier.format:\", error);\n }\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultE2ESetup.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/setup/defaultE2ESetup.ts"],"names":[],"mappings":";;AAMA,4BAgBC;;AAtBD,oHAAoF;AACpF,2DAAwD;AAExD;;GAEG;AACH,SAAgB,QAAQ;IACtB,IAAA,qCAAiB,GAAE,CAAC;IACpB,IAAA,8BAAoB,EAAC;QACnB,GAAG,EAAE;YACH,eAAe,EAAE,IAAI;YACrB,gBAAgB,EAAE,IAAI;SACvB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAU,EAAE,EAAE;QAC9C,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;QACnC,6CAA6C;QAC7C,mBAAmB;QACnB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,QAAQ,CAAC;AAE7C,uEAAuE;AACvE,IAAI,gBAAgB,EAAE,CAAC;IACrB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;QAChD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,CAAC,CAAC;IACF,SAAS,eAAe,CAAC,KAAa,EAAE,EAAsC;QAC5E,OAAO,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,eAAe,CAAC,IAAI,GAAG,CAAC,KAAa,EAAE,EAAsC,EAAE,EAAE;QAC/E,OAAO,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC;IACF,eAAe,CAAC,IAAI,GAAG,CAAC,KAAa,EAAE,EAAsC,EAAE,EAAE;QAC/E,OAAO,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC;IAEF,8DAA8D;IAC7D,UAAkB,CAAC,QAAQ,GAAG,eAAe,CAAC;AACjD,CAAC","sourcesContent":["import installLogsCollector from \"cypress-terminal-report/src/installLogsCollector\";\nimport { setupHarRecording } from \"./setupHarRecording\";\n\n/**\n * Sets up the E2E testing environment with HAR recording and terminal logging.\n */\nexport function setupE2E() {\n setupHarRecording();\n installLogsCollector({\n xhr: {\n printHeaderData: true,\n printRequestData: true,\n },\n });\n\n Cypress.on(\"uncaught:exception\", (err: Error) => {\n // eslint-disable-next-line no-console\n console.log(\"Caught Error: \", err);\n // returning false here prevents Cypress from\n // failing the test\n return false;\n });\n}\n\nconst originalDescribe = globalThis.describe;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nif (originalDescribe) {\n const codeowner = Cypress.env(\"codeowner\");\n const addOwnerToTitle = (title: string): string => {\n return codeowner ? title + ` [${codeowner}]` : title;\n };\n function patchedDescribe(title: string, fn: (this: Mocha.Suite | void) => void): Mocha.Suite | void {\n return originalDescribe(addOwnerToTitle(title), fn);\n }\n patchedDescribe.only = (title: string, fn: (this: Mocha.Suite | void) => void) => {\n return originalDescribe.only(addOwnerToTitle(title), fn);\n };\n patchedDescribe.skip = (title: string, fn: (this: Mocha.Suite | void) => void) => {\n return originalDescribe.skip(addOwnerToTitle(title), fn);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (globalThis as any).describe = patchedDescribe;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupHarRecording.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/setup/setupHarRecording.ts"],"names":[],"mappings":";AAAA,uDAAuD;;AASvD,8CAiBC;AAxBD,uDAAqD;AACrD,8DAA2D;AAE3D;;;GAGG;AACH,SAAgB,iBAAiB;IAC/B,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC1C,EAAU,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC;QACR,IAAK,IAAY,CAAC,WAAW,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACjD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,IAAA,iCAAe,EAC9B,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,EACpE,QAAQ,EACR,OAAO,CAAC,YAAY,CACrB,CAAC;YACD,EAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport \"@neuralegion/cypress-har-generator/commands\";\nimport { fileNameBuilder } from \"../utils/fileNameBuilder\";\n\n/**\n * Sets up HAR (HTTP Archive) recording for E2E tests.\n * Records network activity and saves HAR files for failed tests.\n */\nexport function setupHarRecording() {\n beforeEach(() => {\n const harDir = Cypress.env(\"hars_folders\");\n (cy as any).recordHar({ rootDir: harDir });\n });\n\n afterEach(function () {\n if ((this as any).currentTest.state === \"failed\") {\n const harDir = Cypress.env(\"hars_folders\");\n const testName = fileNameBuilder(\n `${Cypress.currentTest.titlePath[0]} - ${Cypress.currentTest.title}`,\n \"failed\",\n Cypress.currentRetry\n );\n (cy as any).saveHar({ outDir: harDir, fileName: testName });\n }\n });\n}\n"]}
|
package/src/support.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-e2e/src/support.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;AAE7C;;;;GAIG;AAEH,qEAA2C;AAC3C,kEAAwC;AACxC,oEAA0C","sourcesContent":["/// <reference path=\"./types/cypress.d.ts\" />\n\n/**\n * Browser-only exports for Cypress support files.\n * These modules depend on the Cypress global and must only be imported\n * in Cypress support files, NOT in cypress.config.ts or other Node.js contexts.\n */\n\nexport * from \"./commands/defaultCommands\";\nexport * from \"./setup/defaultE2ESetup\";\nexport * from \"./setup/setupHarRecording\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Codeowner.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/utils/Codeowner.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AACpB,wDAAwB;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,eAAe,GAAG,CAAC,KAAoB,EAA0B,EAAE;IAC9E,MAA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;QACR,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAxCW,QAAA,YAAY,gBAwCvB","sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\n\n/**\n * Parses lines from a CODEOWNERS‐style file into a mapping of patterns → owners.\n * Skips blank lines and comments (lines beginning with `#`).\n *\n * @param {string[]} lines - Each element is a line from your CODEOWNERS file.\n * @returns {Record<string, string>} An object whose keys are normalized path patterns (no leading/trailing slashes)\n * and whose values are the owner (e.g. a GitHub team handle).\n * @example\n * ```ts\n * const lines = [\n * \"# Our CODEOWNERS\",\n * \"/src @team/backend\",\n * \"README.md @team/docs\",\n * \"\", // blank lines ignored\n * \"# end of file\"\n * ];\n * const owners = parseCodeowners(lines);\n * // → { \"src\": \"@team/backend\", \"README.md\": \"@team/docs\" }\n * ```\n */\nexport const parseCodeowners = (lines: Array<string>): Record<string, string> => {\n const patterns: Record<string, string> = {};\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) {\n continue;\n }\n const [pattern, owner] = trimmed.split(/\\s+/, 2);\n if (pattern && owner) {\n const normalizedPattern = pattern.replace(/^\\/+|\\/+$/g, \"\");\n patterns[normalizedPattern] = owner;\n }\n }\n return patterns;\n};\n\n/**\n * Converts a full team handle (potentially namespaced and with platform suffix)\n * into its “short” team name.\n *\n * - Strips any leading `@org/` prefix\n * - Removes `-be` or `-fe` suffix if present\n *\n * @param {string} teamName - e.g. `\"@trackunit/backend-be\"` or `\"@trackunit/frontend-fe\"`\n * @returns {string} e.g. `\"backend\"` or `\"frontend\"`\n * @example\n * ```ts\n * toShortTeamName(\"@trackunit/backend-be\"); // → \"backend\"\n * toShortTeamName(\"@trackunit/frontend-fe\"); // → \"frontend\"\n * toShortTeamName(\"infra\"); // → \"infra\"\n * ```\n */\nexport const toShortTeamName = (teamName?: string): string | undefined => {\n if (!teamName) {\n return undefined;\n }\n let shortName = teamName;\n if (teamName.startsWith(\"@\")) {\n shortName = shortName.slice(shortName.indexOf(\"/\") + 1);\n }\n if (shortName.endsWith(\"-be\") || shortName.endsWith(\"-fe\")) {\n shortName = shortName.slice(0, shortName.lastIndexOf(\"-\"));\n }\n return shortName;\n};\n\n/**\n * Recursively looks up the CODEOWNER for a given file or directory path\n * by reading your workspace’s CODEOWNERS file.\n *\n * Walks up the directory tree until it finds a matching pattern. If no\n * deeper match is found but there is a `\".\"` entry, returns that.\n *\n * @param {string} currentPath - Absolute path to the file/directory you’re querying.\n * @param {string} workspaceRoot - Absolute path to your repo/workspace root.\n * @param {string} [codeownersFileName=\"TEAM_CODEOWNERS\"] - Filename to read at the root.\n * @returns {string|undefined} The owner handle (e.g. `\"@team/backend\"`) or `undefined` if none found.\n * @example\n * ```ts\n * // Suppose your repo root has a TEAM_CODEOWNERS file containing:\n * // src @team/backend\n * // src/utils @team/utils\n * // . @team/root\n *\n * const owner1 = getCodeowner(\n * \"/Users/alice/project/src/utils/helpers.ts\",\n * \"/Users/alice/project\"\n * );\n * // → \"@team/utils\"\n *\n * const owner2 = getCodeowner(\n * \"/Users/alice/project/other/file.txt\",\n * \"/Users/alice/project\"\n * );\n * // → \"@team/root\" (falls back to the \".\" entry)\n * ```\n */\nexport const getCodeowner = (\n currentPath: string,\n workspaceRoot: string,\n codeownersFileName = \"TEAM_CODEOWNERS\"\n): string | undefined => {\n if (!workspaceRoot) {\n return undefined;\n }\n\n const codeownersPath = path.join(workspaceRoot, codeownersFileName);\n if (!fs.existsSync(codeownersPath)) {\n return undefined;\n }\n\n const codeownersLines = fs.readFileSync(codeownersPath, \"utf8\").split(\"\\n\");\n const codeowners = parseCodeowners(codeownersLines);\n\n let relPath = path\n .relative(workspaceRoot, currentPath)\n .replace(/\\\\/g, \"/\")\n .replace(/^\\/+|\\/+$/g, \"\");\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const codeowner = codeowners[relPath];\n if (codeowner) {\n return codeowner;\n }\n\n const parent = path.posix.dirname(relPath);\n if ((parent === relPath || parent === \".\") && codeowners[\".\"]) {\n return codeowners[\".\"];\n }\n if (parent === relPath || parent === \".\") {\n break;\n }\n relPath = parent;\n }\n\n return undefined;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileNameBuilder.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/utils/fileNameBuilder.ts"],"names":[],"mappings":";;AAOA,kDAMC;AAiBD,0CAGC;AAjCD;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,OAAO,GAAG;SACP,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC,yCAAyC;SAClF,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,qCAAqC;SACzD,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,oCAAoC;SACzD,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,gCAAgC;AAC5D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,eAAe,CAAC,QAAgB,EAAE,KAAa,EAAE,YAAqB;IACpF,MAAM,QAAQ,GAAG,GAAG,QAAQ,IAAI,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC;IAC7H,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/**\n * Sanitizes a string to be safe for use in filenames.\n * Removes special characters and truncates if too long.\n *\n * @param str - The string to sanitize (e.g., test suite or test name)\n * @returns {string} Sanitized string safe for filesystem use\n */\nexport function sanitizeForFilename(str: string): string {\n return str\n .replace(/[^a-zA-Z0-9-_\\s\\[\\]\\(\\)]/g, \"\") // Remove special chars - with exceptions\n .replace(/-+/g, \"-\") // Collapse multiple hyphens into one\n .replace(/\\s+/g, \" \") // Collapse multiple spaces into one\n .replace(/^-|-$/g, \"\"); // Trim leading/trailing hyphens\n}\n\n/**\n * Builds a standardized filename for test artifacts (e.g., HAR files, screenshots).\n * Combines test name, state, and attempt number into a readable filename.\n *\n * @param testName - The name of the test (will be sanitized)\n * @param state - The test state (e.g., 'passed', 'failed')\n * @param currentRetry - The current retry attempt number (0-based)\n * @returns {string} A sanitized filename in the format: \"testName (state) (attempt N)\"\n * @example\n * fileNameBuilder(\"Login Flow\", \"failed\", 0)\n * // Returns: \"Login Flow (failed) (attempt 1)\"\n * @example\n * fileNameBuilder(\"Test: with -> special chars\", \"passed\", 2)\n * // Returns: \"Test with - special chars (passed) (attempt 3)\"\n */\nexport function fileNameBuilder(testName: string, state: string, currentRetry?: number): string {\n const fileName = `${testName} ${currentRetry !== undefined ? `(Attempt ${currentRetry + 1})` : \"\"} (${state.toLowerCase()})`;\n return sanitizeForFilename(fileName);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileUpdater.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-e2e/src/utils/fileUpdater.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,IAAY,EAAE,OAAwC,EAAE,EAAE;IACrG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpC,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,gBAAgB,oBAc3B;AAEF;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,IAAY,EAAE,EAAE;IAC3D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,uDAAuD;QACvD,OAAO;IACT,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B","sourcesContent":["import { Tree } from \"@nx/devkit\";\n\n/**\n *\n * @param tree File system tree\n * @param path Path to source file in the Tree\n * @param updater Function that maps the current file content to a new to be written to the Tree\n */\nexport const updateFileInTree = (tree: Tree, path: string, updater: (fileContent: string) => string) => {\n if (!tree.exists(path)) {\n throw new Error(\"File not found: \" + path);\n }\n\n const fileContent = tree.read(path, \"utf-8\");\n if (!fileContent) {\n throw new Error(\"File is empty: \" + path);\n }\n const result = updater(fileContent);\n\n if (result !== fileContent) {\n tree.write(path, result);\n }\n};\n\n/**\n *\n * @param tree File system tree\n * @param path Path to source file in the Tree\n */\nexport const deleteFileInTree = (tree: Tree, path: string) => {\n if (!tree.exists(path)) {\n // File doesn't exist, nothing to delete - this is fine\n return;\n }\n\n tree.delete(path);\n};\n"]}
|