-
Notifications
You must be signed in to change notification settings - Fork 27
DOT-5874: Add pdf upload support in SmartUI-CLI #349
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
Conversation
Release PR Version `4.1.28` Exit code throwing at end of cli process
let ctx: Context = ctxInit(command.optsWithGlobals()); | ||
|
||
if (!fs.existsSync(directory)) { | ||
console.log(`Error: The provided directory ${directory} not found.`); |
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.
add process.exit(1);
startPdfPolling(ctx); | ||
} | ||
} catch (error) { | ||
console.log('\nRefer docs: https://www.lambdatest.com/support/docs/smart-visual-regression-testing/'); |
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.
add process.exit(1);
src/lib/httpClient.ts
Outdated
accessKey: string; | ||
|
||
private handleHttpError(error: any, log: Logger): never { | ||
if (error.response) { |
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.
Use (error && error.response)
This pull request introduces a new feature for uploading PDFs and fetching their visual comparison results. It adds a new CLI command for PDF uploads, implements the backend logic for uploading and polling results, and updates environment configuration and types accordingly. The changes are grouped below by feature and infrastructure updates.
PDF Upload and Results Fetching Feature:
upload-pdf
inuploadPdf.ts
to upload PDFs for visual comparison, with options for specifying the build name and fetching results. The command is registered in the main commander program. [1] [2] [3]uploadPdfs.ts
, which handles uploading single or multiple PDF files and updates the build context after upload.utils.ts
withstartPdfPolling
, which repeatedly fetches and displays PDF comparison results, groups results by PDF, summarizes mismatches, and supports saving results to a file.Backend and API Integration:
httpClient.ts
with methodsuploadPdf
andfetchPdfResults
to support uploading PDFs and fetching their comparison results from the backend, including improved HTTP error handling. [1] [2] [3]Environment and Types Updates:
SMARTUI_UPLOAD_URL
to the environment configuration inenv.ts
and updated theEnv
andContext
types accordingly. [1] [2] [3]