-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor Accessibility Scan Tools with Enhanced Progress Updates and Local Report Download #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…r implementations
Sync with main
…rror handling in tests
…sing functionality
sync with main
TBD on pageURL to get multiple urls or single |
try { | ||
const statusResp = await this.pollStatus(scanId, scanRunId); | ||
const status = statusResp.data!.status; | ||
const progress = status === "completed" ? 100 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since total timeout is of 5 minutes, and this setInterval runs every 5 seconds, we can increase progress by 5 seconds/5 minutes
amount everytime
/** How many JSON-chars max per “page” (default 10000) */ | ||
maxCharacterLength?: number; | ||
/** Character offset to start from (default 0) */ | ||
nextPage?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this ? this is never set, always 0, how will this be used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it, so it can be reused to fetch the next set of issues later.
Since we have a 10K character limit, this setup allows the user to request the next chunk if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thinking was to write this function , so it can be extended for new tool getNextAccessibilityIssues args -> project_name and next_page_token. We will get the url from local inmemory cache from key : project_name and return next(10K chars) results
This PR introduces a major refactor of the Accessibility Scan tool. Key changes include:
Replaced
accessibility.ts
logic with a modular structure:AccessibilityScanner
for scan orchestration and polling.AccessibilityReportFetcher
for report link retrieval and download.Improved progress notification handling with better fallbacks for missing tokens.
Reports are now downloaded locally to
~/.browserstack/reports/
.Clear error messages and scan status updates sent via
context.sendNotification
.Testing:
Tested on the following environments:
✅ No timeouts observed
✅ CSV report successfully downloaded and visible in final tool output