BrowserStackCE / percy-pdf

This `percy-pdf` code repository provides an approach to compare your Portable Document Format (PDF) files using Percy for Visual Testing Requirements, across multiple application releases.
https://github.com/BrowserStackCE/percy-pdf
Apache License 2.0
1 stars 6 forks source link

percy snapshot approach #4

Closed samirans89 closed 1 year ago

shaikhalid commented 1 year ago

Initial Setup was very easy. It worked without any problems.

  1. Add a step in read me to enable only 1 Browser in Percy
  2. The first page for some reason doesn't have number assigned to it Screenshot 2023-05-19 at 8 01 08 PM
  3. Some of the screenshots are coming blank when the PDF is graphic intensive https://percy.io/9560f98d/percy-pdf/builds/27551595/changed/1532747505?browser=edge&browser_ids=36%2C38%2C39%2C40&subcategories=unreviewed%2Cchanges_requested&viewLayout=side-by-side&viewMode=new&width=1440&widths=1440
samirans89 commented 1 year ago

@shaikhalid -

1 - Let's add.

2 - Yes, That's intentional since I'm using the suffix param which is only allowed under additionalSnapshots. With the current logic, if we add | Page 1 to the first page name, then all subsequent pages will show up as <PDF Name> | Page 1 | Page <X>. Any way to get this done built-in by Percy config file itself (and avoiding any external logic)?

3 - What's will the solution look like? Percy config file allows waitForTimeout - An amount of time to wait before capturing a snapshot. For graphic intensive PDF's, do we allow users to specify a waitForTimeout in the pdf-docs-run-info-config file which we apply to all pages in the Percy config file?

shaikhalid commented 1 year ago
  1. I will add
  2. I will need to check the code for this. I think one way is to use the API and check the number snapshots and the number accordingly so we avoid extra logic.
  3. I have an interesting solution for this. Like Percy sensitivity we can allow the user to set the PDF time to three level or custom i. only text ii. Moderate graphics iii. Graphic intensive

We can do some research and code corresponding waits accordingly

samirans89 commented 1 year ago
  1. I will add
  2. I will need to check the code for this. I think one way is to use the API and check the number snapshots and the number accordingly so we avoid extra logic.
  3. I have an interesting solution for this. Like Percy sensitivity we can allow the user to set the PDF time to three level or custom i. only text ii. Moderate graphics iii. Graphic intensive

We can do some research and code corresponding waits accordingly

Aligned with #1 and #3. Need to understand #2 better.

samirans89 commented 1 year ago
  1. I will add
  2. I will need to check the code for this. I think one way is to use the API and check the number snapshots and the number accordingly so we avoid extra logic.
  3. I have an interesting solution for this. Like Percy sensitivity we can allow the user to set the PDF time to three level or custom i. only text ii. Moderate graphics iii. Graphic intensive

We can do some research and code corresponding waits accordingly

Aligned with #1 and #3. Need to understand #2 better.

Hey @shaikhalid - I'm merging this PR for now, since we have an external call today. It's okay to add PR to enhance / optimise the working further. I'll try to schedule a meeting with Product too to go over this implementation.