@@ -87,7 +92,7 @@ Once your project is active, retrieve your `Project Token` from the application.
projectToken = "123456#1234abcd-****-****-****-************"
```
-## Step 2: Integrating PDFs via API
+## Option 1: Integrating PDFs via API
After setting up your SmartUI Project, you can upload your local PDF files to your project. This will automatically generate a build by capturing snapshots of every page.
@@ -100,13 +105,101 @@ Here's how you can upload your PDFs:
| Variable | Type | Description | Required? |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------- |
| projectToken | string | This token is required to upload PDF files and validate your project.
Example: `projectToken:123456#1234abcd-****-****-****-************` | Yes |
-| pathToFiles | array | Add the path to the PDFs that will be uploaded.
Example: `pathToFiles : [ "path/to/pdf-1", "path/to/pdf-2"]` | Yes |
-| buildName | string | Assign a name of your choice to the build comprising the uploaded PDFs.
Example: `buildName : #<Build_Name> | No |
+| pathToFiles | array | Add the path to the PDFs that will be uploaded.
Example: `pathToFiles : [ "path/to/pdf-1", "path/to/pdf-2"]` | Yes |
+| buildName | string | Assign a name of your choice to the build comprising the uploaded PDFs.
Example: `buildName : #
` | No |
:::note
Only files in `.pdf` format are compatible with this feature.
:::
+## Option 2: Uploading PDFs via SmartUI CLI (Alternative Method)
+
+For users who prefer command-line tools, SmartUI provides a CLI to easily upload PDFs and fetch test results.
+
+### Step 1: Install the SmartUI CLI
+
+Install the CLI globally using npm:
+
+```bash
+npm install -g @lambdatest/smartui-cli
+```
+### Step 2: Setup your credentials
+
+
+
+
+
+
+
+ {`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
+export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"
+export PROJECT_TOKEN="123456#1234abcd-****-****-****-************"`}
+
+
+
+
+
+
+
+
+
+ {`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
+set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"
+set PROJECT_TOKEN="123456#1234abcd-****-****-****-************"`}
+
+
+
+
+
+
+
+
+
+ {`$Env:LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
+$Env:LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"
+$Env:PROJECT_TOKEN="123456#1234abcd-****-****-****-************"`}
+
+
+
+
+
+
+
+
+
+
+
+### Step 3: Upload PDFs Using CLI
+
+Use the `upload-pdf` command to upload one or multiple PDF files from a directory:
+
+```bash
+smartui upload-pdf [options]
+```
+
+#### Arguments:
+- `directory_or_filename`: Path to a single PDF file or a directory containing multiple PDFs.
+
+#### Options:
+- `--fetch-results [filename]`: Fetch test results after upload. Optionally specify an output file (e.g., `results.json`).
+- `--buildName `: Assign a custom name to the build.
+
+#### Example Usage:
+
+Upload all PDFs from a folder and name the build:
+
+```bash
+smartui upload-pdf ./pdfs/ --buildName "Release-v2.1"
+```
+
+Fetch results and save to a file:
+
+```bash
+smartui upload-pdf ./spec.pdf --fetch-results results.json
+```
+
+This CLI method streamlines PDF uploads and result retrieval, making it ideal for CI/CD pipelines and automated workflows.
+
## Use Cases of Smart PDF Comparison
1. **Software Documentation**: In software development, PDF comparison can be utilized to ensure the accuracy and consistency of user manuals, system documentation, and more. It can help in tracking changes made in the document across different software versions or updates.