✨ Accept sitemaps with the snapshot command!#516
Merged
Conversation
Robdel12
approved these changes
Aug 20, 2021
Contributor
Robdel12
left a comment
There was a problem hiding this comment.
🏁 super fun times! Great stuff
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.2.0 to 10.3.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@v10.2.0...v10.3.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?
This makes it possible to use
percy snapshot <sitemap-url>to take snapshots of all of the URLs listed by a sitemap.The changes in the PR leverage the existing
mapStaticSnapshotsutil, thus allowinginclude,exclude, andoverrides. Technically, this util also allows a couple of other static options, however those options (such as rewrites and base-url) are not necessary as URLs within a sitemap are typically canonical URLs.If a fetched sitemap is not an XML document, an error will be thrown. In the future, it's possible this can be relaxed a little since our regexp parser doesn't necessarily need valid XML to work (it simply matches URLs between XML
<loc>tags).I also discovered that some sitemaps list a URL twice, with and without a trailing forward slash (
/). This prompted a filter to remove such duplicate URLs.Not many tests were necessary for this since it leverages existing utils.