@immense/vue-pom-generator 1.0.39 → 1.0.40

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/RELEASE_NOTES.md CHANGED
@@ -1,28 +1,24 @@
1
- ● # Release Notes: v1.0.39
1
+ ● # Release Notes - v1.0.40
2
2
 
3
3
  ## Highlights
4
4
 
5
- - **Flattened helper attachments**: New capability in class generation for handling helper
6
- attachments in a flattened structure
7
- - **Extensive documentation updates**: README expanded with over 1,100 new lines of
8
- documentation
9
- - **Enhanced test coverage**: Added 89 lines of new tests for generated TypeScript compilation
10
- - **PR automation**: Added release notes preview comments on pull requests
5
+ - Fixed keyed POM deduplication logic
6
+ - Fixed C# navigation return handling
7
+ - Added PR release-notes preview comment automation
8
+ - Improved test coverage with new test cases for class generation and utilities
11
9
 
12
10
  ## Changes
13
11
 
14
- ### Features
15
- - Add flattened helper attachments support in class generation (`class-generation/index.ts`)
16
-
17
- ### Documentation
18
- - Significantly expanded README with detailed documentation (+1,118 lines)
12
+ **Bug Fixes**
13
+ - Fixed keyed POM dedupe logic in utils
14
+ - Corrected C# navigation return handling in class generation
19
15
 
20
- ### Testing
21
- - Enhanced `tests/generated-tsc.test.ts` with additional test cases (+89 lines)
16
+ **Tooling & Automation**
17
+ - Added automated PR release-notes preview comments
22
18
 
23
- ### Tooling
24
- - Added PR release-notes preview comment automation
25
- - Minor updates to plugin type definitions and support files
19
+ **Testing**
20
+ - Added 60+ new test cases for class generation coverage
21
+ - Added 50+ new test cases for utilities coverage
26
22
 
27
23
  ## Breaking Changes
28
24
 
@@ -30,11 +26,13 @@
30
26
 
31
27
  ## Pull Requests Included
32
28
 
29
+ - #4 Fix keyed POM dedupe and C# navigation returns
30
+ (https://github.com/immense/vue-pom-generator/pull/4) by @dkattan
33
31
  - #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
34
32
  by @dkattan
35
33
 
36
34
  ## Testing
37
35
 
38
- Tests updated and expanded to cover new flattened helper attachments functionality. Added 89
39
- lines of test coverage in `tests/generated-tsc.test.ts`.
36
+ Added comprehensive test coverage with 110+ new test cases across class generation and utility
37
+ functions.
40
38
 
@@ -855,6 +855,7 @@ function generateAggregatedCSharpFiles(
855
855
  chunks.push(" {");
856
856
  if (pom.formattedDataTestId.includes("${") || allTestIds.length <= 1) {
857
857
  chunks.push(` await ${locatorName}${pom.formattedDataTestId.includes("${") ? `(${args})` : ""}.ClickAsync();`);
858
+ chunks.push(` return new ${target}(Page);`);
858
859
  }
859
860
  else {
860
861
  chunks.push(" Exception? lastError = null;");
@@ -876,7 +877,6 @@ function generateAggregatedCSharpFiles(
876
877
  chunks.push(" }");
877
878
  chunks.push(" throw lastError ?? new System.Exception(\"[pom] Failed to navigate using any candidate test id.\");");
878
879
  }
879
- chunks.push(` return new ${target}(Page);`);
880
880
  chunks.push(" }");
881
881
  chunks.push("");
882
882
  continue;
package/dist/index.cjs CHANGED
@@ -2095,9 +2095,6 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2095
2095
  })();
2096
2096
  const tryMergeWithExistingPrimary = (candidateActionName) => {
2097
2097
  const mergeKey = (args.pomMergeKey ?? "").trim();
2098
- if (isKeyed) {
2099
- return false;
2100
- }
2101
2098
  const existingEntry = primaryByActionName.get(candidateActionName);
2102
2099
  const existingPom = existingEntry?.pom;
2103
2100
  if (!existingEntry || !existingPom) {
@@ -2108,6 +2105,9 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2108
2105
  ...existingPom.alternateFormattedDataTestIds ?? []
2109
2106
  ];
2110
2107
  const sharesSelectorIdentity = existingSelectors.includes(formattedDataTestIdForPom);
2108
+ if (isKeyed && !sharesSelectorIdentity) {
2109
+ return false;
2110
+ }
2111
2111
  if (!mergeKey && !sharesSelectorIdentity) {
2112
2112
  return false;
2113
2113
  }
@@ -2154,6 +2154,11 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2154
2154
  conflicts = false;
2155
2155
  }
2156
2156
  }
2157
+ if (conflicts && nameCollisionBehavior === "error" && tryMergeWithExistingPrimary(actionName)) {
2158
+ methodName = candidate;
2159
+ mergedIntoExisting = true;
2160
+ break;
2161
+ }
2157
2162
  if (conflicts && nameCollisionBehavior === "error") {
2158
2163
  const roleSuffix = upperFirst(normalizedRole || "Element");
2159
2164
  const baseNameUpper = upperFirst(baseWithSuffix);
@@ -2200,11 +2205,6 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2200
2205
  reservedMembers.add(actionName);
2201
2206
  break;
2202
2207
  }
2203
- if (nameCollisionBehavior === "error" && tryMergeWithExistingPrimary(actionName)) {
2204
- methodName = candidate;
2205
- mergedIntoExisting = true;
2206
- break;
2207
- }
2208
2208
  if (!collisionDetails) {
2209
2209
  collisionDetails = { getterName: chosenGetterName, actionName };
2210
2210
  collisionHint = hint || (args.semanticNameHint ?? "").trim() || null;
@@ -3781,6 +3781,7 @@ function generateAggregatedCSharpFiles(componentHierarchyMap, outDir, options =
3781
3781
  chunks.push(" {");
3782
3782
  if (pom.formattedDataTestId.includes("${") || allTestIds.length <= 1) {
3783
3783
  chunks.push(` await ${locatorName}${pom.formattedDataTestId.includes("${") ? `(${args})` : ""}.ClickAsync();`);
3784
+ chunks.push(` return new ${target}(Page);`);
3784
3785
  } else {
3785
3786
  chunks.push(" Exception? lastError = null;");
3786
3787
  chunks.push(` foreach (var testId in new[] { ${allTestIds.map(toCSharpTestIdExpression).join(", ")} })`);
@@ -3801,7 +3802,6 @@ function generateAggregatedCSharpFiles(componentHierarchyMap, outDir, options =
3801
3802
  chunks.push(" }");
3802
3803
  chunks.push(' throw lastError ?? new System.Exception("[pom] Failed to navigate using any candidate test id.");');
3803
3804
  }
3804
- chunks.push(` return new ${target}(Page);`);
3805
3805
  chunks.push(" }");
3806
3806
  chunks.push("");
3807
3807
  continue;