DOT-5874: Add pdf upload support in SmartUI-CLI#349
Merged
Conversation
Release PR Version `4.1.28` Exit code throwing at end of cli process
sushobhit-lt
reviewed
Sep 8, 2025
| let ctx: Context = ctxInit(command.optsWithGlobals()); | ||
|
|
||
| if (!fs.existsSync(directory)) { | ||
| console.log(`Error: The provided directory ${directory} not found.`); |
sushobhit-lt
reviewed
Sep 8, 2025
| startPdfPolling(ctx); | ||
| } | ||
| } catch (error) { | ||
| console.log('\nRefer docs: https://www.lambdatest.com/support/docs/smart-visual-regression-testing/'); |
sushobhit-lt
reviewed
Sep 8, 2025
| accessKey: string; | ||
|
|
||
| private handleHttpError(error: any, log: Logger): never { | ||
| if (error.response) { |
Collaborator
There was a problem hiding this comment.
Use (error && error.response)
sushobhit-lt
approved these changes
Sep 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pdfinuploadPdf.tsto 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.tswithstartPdfPolling, 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.tswith methodsuploadPdfandfetchPdfResultsto 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_URLto the environment configuration inenv.tsand updated theEnvandContexttypes accordingly. [1] [2] [3]