Repository navigation
test(docs-infra): fix double-slash in URL of aio_monitoring test
#25641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import { browser, by, element, ExpectedConditions } from 'protractor'; | ||
|
|
||
| export class SitePage { | ||
| /** The base URL with the trailing `/` stripped off (if any). */ | ||
| baseUrl = browser.baseUrl.replace(/\/$/, ''); | ||
|
|
||
| /** All URLs found in the app's `sitemap.xml` (i.e. valid URLs tha should not be redirected). */ | ||
| sitemapUrls: string[] = browser.params.sitemapUrls; | ||
|
|
||
|
|
@@ -44,7 +47,7 @@ export class SitePage { | |
| .then(regs => Promise.all(regs.map(reg => reg.unregister()))) | ||
| .then(cb); | ||
|
|
||
| await browser.get(url || browser.baseUrl); | ||
| await browser.get(url || this.baseUrl); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So accessing the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but I want to be consistent 😁 |
||
| await browser.executeScript('document.body.classList.add(\'no-animations\')'); | ||
| await browser.executeAsyncScript(unregisterServiceWorker); | ||
| await browser.waitForAngular(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ export function loadLocalSitemapUrls() { | |
| } | ||
|
|
||
| export async function loadRemoteSitemapUrls(host: string) { | ||
| host = host.replace(/\/$/, ''); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could just use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| const urlToSiteMap = `${host}/generated/sitemap.xml`; | ||
| const get = /^https:/.test(host) ? httpsGet : httpGet; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we not use
path.join(page.baseUrl, url)here? That would prevent double slashes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we used
canonical-path(to avoidhttp:\\foo\bar),path.join()would normalizehttp://footohttp:/foo😁