[{"data":1,"prerenderedAt":196},["ShallowReactive",2],{"newsletter-running-cypress-tests-locally":3,"newsletter-surround-running-cypress-tests-locally":187},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"publishedAt":11,"slug":12,"image":13,"newsletter":14,"kitId":15,"readingTime":16,"body":21,"_type":181,"_id":182,"_source":183,"_file":184,"_stem":185,"_extension":186},"/newsletter/running-cypress-tests-locally","newsletter",false,"","Running Cypress tests locally","It took me some time to realize, but you actually can run your Cypress tests locally in parallel. This part is the most criticized one among Cypress users, and I can’t believe how easy it is...","2024-11-13","2024-11-13T10:26:39Z","running-cypress-tests-locally","https://embed.filekitcdn.com/e/7ZDF8HKDtDu5ZtF7YH7UBT/rFMRwJUokEZRGY6JFDGBCk/email",true,17242944,{"text":17,"minutes":18,"time":19,"words":20},"2 min read",1.015,60900,203,{"type":22,"children":23,"toc":175},"root",[24,32,45,76,89,94,98,105,119,126,129,138,143,152,155,163,170],{"type":25,"tag":26,"props":27,"children":28},"element","p",{},[29],{"type":30,"value":31},"text","Hello there,",{"type":25,"tag":26,"props":33,"children":34},{},[35,37,43],{"type":30,"value":36},"It took me some time to realize, but you actually ",{"type":25,"tag":38,"props":39,"children":40},"strong",{},[41],{"type":30,"value":42},"can",{"type":30,"value":44}," run your Cypress tests locally in parallel. This part is the most criticized one among Cypress users, and I can’t believe how easy it is actually to set up. All you need to do is to use these two packages:",{"type":25,"tag":26,"props":46,"children":47},{},[48,50,59,61,65,67,74],{"type":30,"value":49},"1. ",{"type":25,"tag":51,"props":52,"children":56},"a",{"href":53,"rel":54},"https://www.npmjs.com/package/concurrently",[55],"nofollow",[57],{"type":30,"value":58},"concurrently",{"type":30,"value":60}," - to run your tests in parallel",{"type":25,"tag":62,"props":63,"children":64},"br",{},[],{"type":30,"value":66},"\n2. ",{"type":25,"tag":51,"props":68,"children":71},{"href":69,"rel":70},"https://www.npmjs.com/package/cypress-split",[55],[72],{"type":30,"value":73},"cypress-split",{"type":30,"value":75}," - to split your tests across processes",{"type":25,"tag":77,"props":78,"children":83},"pre",{"className":79,"code":81,"language":82,"meta":7},[80],"language-js","// package.json\n\"scripts\": {\n  \"cy:parallel\": \"npx concurrently\n  \\\"cypress run --env split=2,splitIndex=0\\\"\n  \\\"cypress run --env split=2,splitIndex=1\\\"\"\n},\n","js",[84],{"type":25,"tag":85,"props":86,"children":87},"code",{"__ignoreMap":7},[88],{"type":30,"value":81},{"type":25,"tag":26,"props":90,"children":91},{},[92],{"type":30,"value":93},"And that’s all there’s to it!",{"type":25,"tag":95,"props":96,"children":97},"hr",{},[],{"type":25,"tag":99,"props":100,"children":102},"h3",{"id":101},"new-cypress-course-progress",[103],{"type":30,"value":104},"New Cypress Course Progress",{"type":25,"tag":26,"props":106,"children":107},{},[108,110,117],{"type":30,"value":109},"I've been heads down over the weekend, pushing forward on my ",{"type":25,"tag":51,"props":111,"children":114},{"href":112,"rel":113},"https://www.linkedin.com/in/filip-hric?miniProfileUrn=urn%3Ali%3Afsd_profile%3AACoAAB8OXmYBqZj8pi336do3G55lVgeqmcna8Qc",[55],[115],{"type":30,"value":116},"upcoming Cypress course",{"type":30,"value":118},"! While I’m running a bit late, I did manage to sneak in a little creative break designing the course logo. It’s starting to come together—can't wait to share more with you!",{"type":25,"tag":26,"props":120,"children":121},{},[122],{"type":25,"tag":123,"props":124,"children":125},"img",{"alt":7,"src":13},[],{"type":25,"tag":95,"props":127,"children":128},{},[],{"type":25,"tag":99,"props":130,"children":132},{"id":131},"advanced-cypress-intercepting",[133],{"type":25,"tag":38,"props":134,"children":135},{},[136],{"type":30,"value":137},"Advanced Cypress Intercepting",{"type":25,"tag":26,"props":139,"children":140},{},[141],{"type":30,"value":142},"I've discovered how to run Cypress tests in parallel locally using the cypress-split and concurrently packages—a game-changer for handling large test suites.",{"type":25,"tag":77,"props":144,"children":147},{"className":145,"code":146,"language":82,"meta":7},[80],"Cypress.Commands.add(\"waitAlias\", function (this: any, pattern: RegExp) {\n  return cy.wrap(null, { log: false }).then(function () {\n    const matchingAliases = Object.keys(this).filter(alias =>\n      pattern.test(alias),\n    );\n\n    if (matchingAliases.length === 0) {\n      throw new Error(`No aliases found matching pattern: ${pattern}`);\n    }\n\n    return cy.wait(\"@\" + matchingAliases[0]);\n  });\n});\n",[148],{"type":25,"tag":85,"props":149,"children":150},{"__ignoreMap":7},[151],{"type":30,"value":146},{"type":25,"tag":95,"props":153,"children":154},{},[],{"type":25,"tag":26,"props":156,"children":157},{},[158],{"type":25,"tag":38,"props":159,"children":160},{},[161],{"type":30,"value":162},"Meme of the week",{"type":25,"tag":26,"props":164,"children":165},{},[166],{"type":25,"tag":123,"props":167,"children":169},{"alt":7,"src":168},"https://embed.filekitcdn.com/e/7ZDF8HKDtDu5ZtF7YH7UBT/8hjAawu63G5e8WQBDgi44x/email",[],{"type":25,"tag":26,"props":171,"children":172},{},[173],{"type":30,"value":174},"Take care!",{"title":7,"searchDepth":176,"depth":176,"links":177},2,[178,180],{"id":101,"depth":179,"text":104},3,{"id":131,"depth":179,"text":137},"markdown","content:newsletter:running-cypress-tests-locally:index.md","content","newsletter/running-cypress-tests-locally/index.md","newsletter/running-cypress-tests-locally/index","md",[188,192],{"_path":189,"title":190,"slug":191},"/newsletter/tester-layoffs","Tester layoffs","tester-layoffs",{"_path":193,"title":194,"slug":195},"/newsletter/testing-as-an-entry-gate-to-the-world-of-it","Testing as an entry gate to the world of IT","testing-as-an-entry-gate-to-the-world-of-it",1796304107144]