1import{j as e,a as s,a4 as v,ag as u,fN as I,fO as _,b8 as k,gI as l,gN as m,gL as i,cM as r,gK as h,gM as N,gP as C}from"./index-BFa3nKuT.js";import{a as R}from"./datepicker-CN3oO0F6.js";import"./visx-o561FtCw.js";import"./framerMotion-KnKeNhwd.js";import"./charts-BEfaN6Tb.js";import"./apollo-B9xYJgZj.js";import"./shiki-DSW_v8w1.js";import"./betterAuth-wecmey9t.js";import"./tanstack-82Oensom.js";import"./virtuoso-_8EeKo1c.js";import"./sentry-BM1d0HPc.js";import"./forms-BE_8TKCw.js";import"./amplitude-rTYtQKJT.js";import"./amplify-FijOe782.js";import"./qrcode-CMNUHY9J.js";import"./dnd-BjCurfON.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"01e610d75577dcaf5e5c9af84e79c9458f58a767"},t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=(function(c){for(var o=1;o<arguments.length;o++){var n=arguments[o];if(n!=null)for(var p in n)n.hasOwnProperty(p)&&(c[p]=n[p])}return c})({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:currents-dashboard":!0});var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="e9458387-a296-4de3-8c01-24fc68d43258",t._sentryDebugIdIdentifier="sentry-dbid-e9458387-a296-4de3-8c01-24fc68d43258")}catch{}})();const E=t=>`Your task is to update Cypress setup to report test results to Currents.dev 2 31. Install "cypress-cloud" package: 4 5- as a development dependency 6- using the project's package manager (npm, pnpm, yarn, etc...) 7 82. Create a "currents.config.js" file in your project root next to cypress.config.js|ts|mjs: 9 10\`\`\`javascript 11module.exports = { 12 projectId: '${t}', 13 recordKey: process.env.CURRENTS_RECORD_KEY 14} 15\`\`\` 16 173. Update the Cypress configuration file (cypress.config.ts|js|mjs): 18 19 - add cypress-cloud plugin and set video: true: 20 21 \`\`\` 22 import { defineConfig } from "cypress"; 23 import { cloudPlugin } from "cypress-cloud/plugin"; 24 25 export default defineConfig({ 26 video: true, 27 e2e: { 28 async setupNodeEvents(on, config) { 29 const result = await cloudPlugin(on, config); 30 return result; 31 }, 32 }, 33 }); 34 \`\`\` 35 364. Install cypress-cloud support file: 37 38 - Add this import to your cypress/support/e2e.ts (or e2e.js) file: 39 40 \`\`\` 41 import "cypress-cloud/support"; 42 \`\`\` 43 445. Install alternative Cypress binaries: 45 46\`\`\`bash 47CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force 48\`\`\` 49 50Note: Currents is limiting Cypress framework support. Learn more at https://currents.dev/posts/v13-blocking 51`,G=({aiMode:t,recordKey:a,projectId:c,apiUrl:o})=>{const[n,p]=R.useState(!1),[g,b]=R.useState(!1),y=(f=!1)=>{const d=f?a:C(a);return`module.exports = { 52 projectId: '${c}', 53 recordKey: '${d}' 54}`},x=(f=!1)=>{const d=f?a:C(a);return o?`CURRENTS_ENFORCE_IS_CURRENTS=1 CURRENTS_API_URL=${o} npx cypress-cloud run --parallel --record --key ${d} --ci-build-id \`date +%s\``:`npx cypress-cloud run --parallel --record --key ${d} --ci-build-id hello-currents`};return e("div",{className:"space-y-ui-v2-4",children:[s(k,{type:"warning",fullWidth:!0,description:e(v,{children:["We are limiting Cypress framework support."," ",s(u,{icon:!0,color:!1,target:"_blank",href:"https://currents.dev/posts/v13-blocking",onClick:()=>I(_.ONBOARDING_CYPRESS_BLOCKING_CLICKED),children:"Read more"}),"."]})}),t&&e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:1}),"Share those instructions with your AI assistant to have it update your Cypress setup."]}),s("div",{className:"ml-8",children:s(m,{code:E(c),language:"markdown",filename:"Prompt",maxHeight:"max-h-[180px]",collapsible:!0,wrap:!0,children:s(i,{})})})]}),e("div",{className:"flex flex-col gap-8",children:[!t&&e(v,{children:[e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:1}),e("span",{children:["Install ",s(r,{children:"cypress-cloud"})," npm package."]})]}),e("div",{className:"ml-8",children:[s(h,{code:"npm install -D cypress-cloud",language:"bash",children:s(i,{})}),e("span",{className:"text-sm text-theme-secondary",children:["Requirements: Cypress ",s(r,{children:"10.0.0+"})," and NodeJS"," ",s(r,{children:"14.7.0+"})]})]})]}),e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:2}),e("span",{children:["Create ",s(r,{children:"currents.config.js"})," in your project root."]})]}),e("div",{className:"ml-8",children:[e(m,{code:y(n),copyValue:y(!0),language:"javascript",filename:"currents.config.js",wrap:!0,children:[s(i,{}),s(N,{isRevealed:n,onToggle:()=>p(!n)})]}),e("span",{className:"text-sm text-theme-secondary",children:["Save the file next to ",s(r,{children:"cypress.config.js|ts|mjs"})]})]})]}),e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:3}),e("span",{children:["Install ",s(r,{children:"cypress-cloud/plugin"})," plugin and add"," ",s(r,{children:"video: true"})," property."]})]}),e("div",{className:"ml-8",children:[s(m,{code:`import { defineConfig } from "cypress"; 55import { cloudPlugin } from "cypress-cloud/plugin"; 56 57export default defineConfig({ 58 video: true, 59 e2e: { 60 async setupNodeEvents(on, config) { 61 const result = await cloudPlugin(on, config); 62 return result; 63 }, 64 }, 65});`,language:"typescript",filename:"cypress.config.ts",wrap:!0,children:s(i,{})}),e("span",{className:"text-sm text-theme-secondary",children:["Have existing plugins? Check out our detailed"," ",s(u,{color:!1,icon:!0,href:"https://github.com/currents-dev/cypress-cloud#setup-with-existing-plugins",target:"_blank",children:"Existing Plugins Guide"}),"."]})]})]}),e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:4}),e("span",{children:["Install ",s(r,{children:"cypress-cloud/support"})," support file."]})]}),e("div",{className:"ml-8",children:[s(m,{code:'import "cypress-cloud/support";',language:"typescript",filename:"cypress/support/e2e.ts",wrap:!0,children:s(i,{})}),e("span",{className:"text-sm text-theme-secondary",children:["Learn more about"," ",s(u,{color:!1,icon:!0,href:"https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Support-file",target:"_blank",children:"Cypress Support Files"}),". Install the support file for e2e and components support or just e2e support."]}
65)]})]}),e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:5}),"Install the alternative cypress binaries."]}),e("div",{className:"ml-8",children:[s(h,{code:"CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force",language:"bash",children:s(i,{})}),e("span",{className:"text-sm text-theme-secondary",children:["Explore how to download"," ",s(u,{color:!1,icon:!0,target:"_blank",href:"https://currents.dev/readme/integration-with-cypress/alternative-cypress-binaries",children:"alternative Cypress binaries"})," ","in CI."]})]})]})]}),e("div",{className:"flex flex-col gap-ui-v2-4",children:[e("span",{className:"text-sm flex items-center gap-2",children:[s(l,{step:t?2:6}),"Run the tests using the command below."]}),e("div",{className:"ml-8",children:[e(h,{code:x(g),copyValue:x(!0),language:"bash",children:[s(i,{}),s(N,{isRevealed:g,onToggle:()=>b(!g)})]}),e("span",{className:"text-sm text-theme-secondary",children:["Run ",s(r,{children:"cypress-cloud --help"})," to explore all the options."]})]})]})]})]})};export{G as CypressInstructions,G as default}; 66//# sourceMappingURL=cypressInstructions-BllDpqr2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.