deflake 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/cli.js +11 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -734,6 +734,9 @@ async function analyzeFailures(artifacts, fullLog, client) {
734
734
  }
735
735
 
736
736
  const framework = artifacts.length > 0 && artifacts[0].htmlPath?.includes('cypress') ? 'Cypress' : 'Playwright';
737
+ const results = [];
738
+ const processLimit = Math.min(artifacts.length, limit);
739
+ const batchArtifacts = artifacts.slice(0, processLimit);
737
740
 
738
741
  console.log(`🔍 Analyzing ${batchArtifacts.length} failure(s)...`);
739
742
 
@@ -797,9 +800,12 @@ async function analyzeFailures(artifacts, fullLog, client) {
797
800
  const key = `${locId}|${fixCode.trim()}`;
798
801
 
799
802
  if (!groups[key]) {
800
- groups[key] = { ...res, count: 0 };
803
+ groups[key] = { ...res, count: 0, locations: [] };
801
804
  }
802
805
  groups[key].count++;
806
+ if (res.location) {
807
+ groups[key].locations.push(res.location);
808
+ }
803
809
  }
804
810
 
805
811
  const finalGroups = Object.values(groups);
@@ -808,9 +814,11 @@ async function analyzeFailures(artifacts, fullLog, client) {
808
814
  console.log(`${C.GRAY}â„šī¸ Suggested for ${group.count} similar failures:${C.RESET}`);
809
815
  }
810
816
 
811
- // APPLY FIX (Only once per deduplicated group)
817
+ // APPLY FIX (To all instances in the group)
812
818
  if (argv.fix) {
813
- await applySelfHealing(group);
819
+ for (const loc of group.locations) {
820
+ await applySelfHealing({ ...group, location: loc });
821
+ }
814
822
  }
815
823
 
816
824
  printDetailedFix(group.fix, group.location, group.source_code, argv.fix);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {