snap-ally 0.2.3-beta → 0.2.5-beta

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.
@@ -20,6 +20,7 @@ export interface AccessibilityReporterOptions {
20
20
  ado?: {
21
21
  organization?: string;
22
22
  project?: string;
23
+ areaPath?: string;
23
24
  };
24
25
  }
25
26
  /**
@@ -200,9 +200,9 @@ class SnapAllyReporter {
200
200
  var _a, _b;
201
201
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
202
202
  const projectUse = ((_a = test.parent.project()) === null || _a === void 0 ? void 0 : _a.use) || {};
203
- return (((_b = test.parent.project()) === null || _b === void 0 ? void 0 : _b.name) ||
203
+ return (projectUse.defaultBrowserType ||
204
204
  projectUse.browserName ||
205
- projectUse.defaultBrowserType ||
205
+ ((_b = test.parent.project()) === null || _b === void 0 ? void 0 : _b.name) ||
206
206
  'chromium');
207
207
  }
208
208
  /** Converts Playwright error objects into HTML-safe strings. */
@@ -309,6 +309,9 @@ class SnapAllyReporter {
309
309
  reportData.adoOrganization =
310
310
  this.options.ado.organization || reportData.adoOrganization;
311
311
  reportData.adoProject = this.options.ado.project || reportData.adoProject;
312
+ if (this.options.ado.areaPath) {
313
+ reportData.adoAreaPath = this.options.ado.areaPath;
314
+ }
312
315
  }
313
316
  if (video) {
314
317
  reportData.video = video;
@@ -10,6 +10,7 @@ export interface ReportData {
10
10
  minorColor: string;
11
11
  adoOrganization?: string;
12
12
  adoProject?: string;
13
+ adoAreaPath?: string;
13
14
  adoPat?: string;
14
15
  timestamp?: string;
15
16
  }
@@ -315,7 +315,7 @@
315
315
  type="text"
316
316
  id="bugAreaInput"
317
317
  class="ado-form-input"
318
- value="Accessibility"
318
+ placeholder="Project\\Area"
319
319
  />
320
320
  </div>
321
321
  </div>
@@ -462,6 +462,12 @@ function renderAccessibilityReport(injectedData) {
462
462
  if (failedCountEl) failedCountEl.textContent = failedCount;
463
463
  }
464
464
 
465
+ // Set default area path if provided in data
466
+ const areaInput = document.getElementById('bugAreaInput');
467
+ if (areaInput && data.adoAreaPath) {
468
+ areaInput.value = data.adoAreaPath;
469
+ }
470
+
465
471
  // Render video section if exists
466
472
  if (videoPath) {
467
473
  document.getElementById('a11y-video-card').style.display = 'block';
@@ -874,7 +880,7 @@ async function submitFinalBug() {
874
880
 
875
881
  const title = document.getElementById('bugTitleInput').value;
876
882
  const severity = document.getElementById('bugSeverityInput').value;
877
- const area = document.getElementById('bugAreaInput').value || 'Accessibility';
883
+ const area = document.getElementById('bugAreaInput').value;
878
884
 
879
885
  let screenshotUrl = null;
880
886
  if (screenshotBase64) {
@@ -926,10 +932,18 @@ async function submitFinalBug() {
926
932
  value: `Found at URL / Resource: <a href="${safePageKey}">${safePageKey}</a>`,
927
933
  },
928
934
  { op: 'add', path: '/fields/Microsoft.VSTS.Common.Priority', value: priority },
929
- { op: 'add', path: '/fields/System.AreaPath', value: `${proj}\\\\${area}` },
930
- { op: 'add', path: '/fields/System.Tags', value: 'A11y;SnapAlly;UI-Test' },
931
935
  ];
932
936
 
937
+ if (area) {
938
+ payload.push({
939
+ op: 'add',
940
+ path: '/fields/System.AreaPath',
941
+ value: area.startsWith(proj + '\\') || area === proj ? area : `${proj}\\${area}`,
942
+ });
943
+ }
944
+
945
+ payload.push({ op: 'add', path: '/fields/System.Tags', value: 'A11y;SnapAlly;UI-Test' });
946
+
933
947
  if (screenshotUrl) {
934
948
  payload.push({
935
949
  op: 'add',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snap-ally",
3
- "version": "0.2.3-beta",
3
+ "version": "0.2.5-beta",
4
4
  "description": "A custom Playwright reporter for Accessibility testing using Axe, with HTML reporting and Azure DevOps integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",