tests/git-scm.spec.js: loosen book redirect assertions#1898
Closed
ttaylorr wants to merge 1 commit intogit:gh-pagesfrom
Closed
tests/git-scm.spec.js: loosen book redirect assertions#1898ttaylorr wants to merge 1 commit intogit:gh-pagesfrom
ttaylorr wants to merge 1 commit intogit:gh-pagesfrom
Conversation
In 8781699 (tests: verify that the book URL redirects work, 2024-09-26), there were a couple of assertions that were added to the Playwright test suite that look like the following: await page.goto(`${url}book/`) await expect(page).toHaveURL(`${url}book/en/v2`) Or, in other words, expecting that going to the `/book` path relative to the site's base URL would result in a redirect to `/book/env/v2`. But this test breaks when the hosted site is configured to redirect HTTP requests to HTTPS ones, like in this[1] example. Loosen this assertion to just assert on the path component of the URL in an identical fashion to other similar assertions in this test. Note that a 'git grep toHaveURL' on the pre-image of this patch yields all but two assertions which only look at the path component. The two that don't are the ones which we modify here. This should allow us to successfully run the Playwright tests in forks whose deployment configuration is similar to the above. [1]: https://github.com/ttaylorr/git-scm.com/actions/runs/11185173194/artifacts/2017238933 Signed-off-by: Taylor Blau <me@ttaylorr.com>
Member
Author
dscho
reviewed
Oct 7, 2024
Member
Author
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.
In 8781699 (tests: verify that the book URL redirects work, 2024-09-26), there were a couple of assertions that were added to the Playwright test suite that look like the following:
Or, in other words, expecting that going to the
/bookpath relative to the site's base URL would result in a redirect to/book/env/v2.But this test breaks when the hosted site is configured to redirect HTTP requests to HTTPS ones, like in this[1] example.
Loosen this assertion to just assert on the path component of the URL in an identical fashion to other similar assertions in this test. Note that a 'git grep toHaveURL' on the pre-image of this patch yields all but two assertions which only look at the path component. The two that don't are the ones which we modify here.
This should allow us to successfully run the Playwright tests in forks whose deployment configuration is similar to the above.
[1]: https://github.com/ttaylorr/git-scm.com/actions/runs/11185173194/artifacts/2017238933
/cc @dscho