snap-ally 0.2.2-beta → 0.2.4-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.
@@ -169,7 +169,6 @@ async function scanA11y(page, testInfo, options = {}) {
169
169
  pageUrl: page.url(),
170
170
  accessibilityScore: 0, // No longer used, derivation from Lighthouse removed
171
171
  a11yErrors: errors,
172
- video: 'a11y-scan-video.webm', // Reference name for reporter
173
172
  criticalColor: models_1.Severity.critical,
174
173
  seriousColor: models_1.Severity.serious,
175
174
  moderateColor: models_1.Severity.moderate,
@@ -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;
@@ -2,7 +2,7 @@ export interface ReportData {
2
2
  pageKey: string;
3
3
  pageUrl?: string;
4
4
  accessibilityScore: number;
5
- video: string;
5
+ video?: string;
6
6
  a11yErrors: A11yError[];
7
7
  criticalColor: string;
8
8
  seriousColor: string;
@@ -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
  }
@@ -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';
@@ -894,10 +900,15 @@ async function submitFinalBug() {
894
900
  let videoUrl = null;
895
901
  if (videoPath) {
896
902
  try {
897
- const videoBlob = await fetch(videoPath).then((res) => res.blob());
898
- videoUrl = await uploadAttachment(videoBlob, 'session-recording.webm');
903
+ const res = await fetch(videoPath);
904
+ if (res.ok) {
905
+ const videoBlob = await res.blob();
906
+ videoUrl = await uploadAttachment(videoBlob, 'session-recording.webm');
907
+ } else {
908
+ console.warn(`[SnapAlly] Video not found or access denied: ${videoPath}. Skipping video upload.`);
909
+ }
899
910
  } catch (e) {
900
- console.error('Failed to video upload', e);
911
+ console.warn(`[SnapAlly] Failed to load video: ${e.message}. Skipping video upload.`);
901
912
  }
902
913
  }
903
914
 
@@ -921,7 +932,7 @@ async function submitFinalBug() {
921
932
  value: `Found at URL / Resource: <a href="${safePageKey}">${safePageKey}</a>`,
922
933
  },
923
934
  { op: 'add', path: '/fields/Microsoft.VSTS.Common.Priority', value: priority },
924
- { op: 'add', path: '/fields/System.AreaPath', value: `${proj}\\\\${area}` },
935
+ { op: 'add', path: '/fields/System.AreaPath', value: area.startsWith(proj + '\\') || area === proj ? area : `${proj}\\${area}` },
925
936
  { op: 'add', path: '/fields/System.Tags', value: 'A11y;SnapAlly;UI-Test' },
926
937
  ];
927
938
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snap-ally",
3
- "version": "0.2.2-beta",
3
+ "version": "0.2.4-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",