percy / cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
https://docs.percy.io/docs/cli-overview
70 stars 43 forks source link

Adding waitForTimeout/waitForSelector for assets discovery browser when JS is enabled #1715

Closed amandeepsingh333 closed 3 weeks ago

amandeepsingh333 commented 3 weeks ago

so now waitForTimeout and waitForSelector are at 2 places:

usage of both:

when it is passed at snapshot level => these options are used before a DOM snapshot is taken. The primary goal is to ensure that the page has fully loaded and any necessary DOM elements are present before capturing the state of the page. This mode is currently only supported when used with percy snapshot cli command.

when it is passed at discovery level and JS is enabled => in this phase, these options are used to wait for specific assets or network requests to be discovered and captured. The asset-discovery process often occurs during or after initial page load, and some resources may not be immediately available.

how client should use:

snapshot level => You should use these options at the snapshot level when you want to ensure the readiness of a page before it is captured. This ensures that no partial or incomplete content is included in the snapshot.

discovery level => You should use these options in the discovery level when you are facing issues with missing assets or incomplete network requests. By waiting for the selector or a set timeout, you give enough time for assets to load

this-is-shivamsingh commented 3 weeks ago
  1. Please Update the PR description and PR title as well
this-is-shivamsingh commented 3 weeks ago