Merged
Conversation
Robdel12
approved these changes
Jul 15, 2021
Contributor
Robdel12
left a comment
There was a problem hiding this comment.
🏁 I am in love. The network idle timeout & allowed hostnames validations are going to be so good going forward
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [cypress](https://github.com/cypress-io/cypress) from 8.4.1 to 8.5.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](cypress-io/cypress@v8.4.1...v8.5.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
What is this?
While working on #305, the decision was made to have the config schema for snapshot options included in
@percy/coresince that is where the options are consumed. Initially however, core only registered the schema while the snapshot command used it to validate snapshot listing options.With #406 refactoring the
mergeandvalidateutils, thegetSnapshotConfighelper can now be refactored to utilize their new features to better merge and now validate options! This brings config validation to all of the SDKs as warnings logged wheneverpercySnapshotis called with unrecognized or invalid options.Speaking of invalid options, this PR also adds more restrictions to existing config options:
widthsandminHeightoptions have min and max values. These values are derived from the upload command clamping, which itself was derived from our API restrictions.allowedHostnamesmust be actual hostnames, meaning no protocols and no paths. Including protocols and paths never worked and this validation will help clear up that confusion.networkIdleTimeoutshould never really be larger than 500ms, but is restricted to 750ms to give it some breathing room. This restriction is imposed because long timeouts cause slow tests and don't actually address the underlying network issues.concurrencyhas a minimum value of 1 because having a negative or zero value causes the queue to lock up.For new per-snapshot validations other restrictions are also imposed:
waitForSelector, when performing discovery for an existingdomSnapshot.waitForTimeoutoption must be between1msand30000ms.executeoption must be a string or function.additionalSnapshots, aname,prefix, orsuffixis required.additionalSnapshots, aprefixorsuffixcannot be provided with aname.Tests were updated accordingly and a couple things that were previously taken care of in the config helper are now taken care of where necessary, such as defaulting an additional snapshot name using a prefix/suffix.
This will close #389