-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for headers and redirects
- Loading branch information
Dennis Li
committed
Oct 8, 2024
1 parent
5ff742f
commit 58b5b64
Showing
5 changed files
with
175 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = { | ||
name: 'Headers', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: 'Response headers test for Helix BACOM', | ||
path: [ | ||
'/', | ||
'/au/', | ||
'/uk/', | ||
'/de/', | ||
'/fr/', | ||
'/jp/', | ||
'/sitemap.xml', | ||
], | ||
tags: '@headers @responseHeaders @bacom @bacomSmoke @regression @akamai', | ||
}, | ||
{ | ||
tcid: '1', | ||
name: 'Response headers test for AEM dx', | ||
path: [ | ||
// Event pages | ||
'/de/events/experience-makers-germany-2023-on-demand.html', | ||
'/ch_de/events/experience-makers-zurich-2023-on-demand.html', | ||
'/it/events/experience-makers-milan-2023-on-demand.html', | ||
'/nl/events/experience-makers-amsterdam-2023-on-demand.html', | ||
'/se/events/experience-makers-stockholm-2023-on-demand.html', | ||
'/fr/events/experience-makers-paris-2023-on-demand.html', | ||
'/uk/events/experience-makers-london-2023-on-demand.html', | ||
|
||
// Product Demo pages | ||
'/product-demos/assets-essentials/interactive-tour.html', | ||
'/de/product-demos/assets-essentials/interactive-tour.html', | ||
'/fr/product-demos/assets-essentials/interactive-tour.html', | ||
'/au/product-demos/assets-essentials/interactive-tour.html', | ||
'/uk/product-demos/assets-essentials/interactive-tour.html', | ||
'/jp/product-demos/assets-essentials/interactive-tour.html', | ||
|
||
// Summit pages | ||
'/summit/adobe-summit.html', | ||
'/summit/2024/speakers.html', | ||
'/summit/2024/sessions.html', | ||
'/summit/2024/faq.html', | ||
'/summit/2024/sessions/opening-keynote-gs1.html', | ||
], | ||
tags: '@headers @responseHeaders @bacom @bacomSmoke @regression @akamai', | ||
}, | ||
], | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module.exports = { | ||
name: 'Redirects', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: 'Bacom redirects for URLs without trailing slashes', | ||
path: [ | ||
'/', | ||
'/au', | ||
'/uk', | ||
'/de', | ||
'/fr', | ||
'/jp', | ||
'/blog', | ||
'/au/blog', | ||
'/uk/blog', | ||
'/de/blog', | ||
'/fr/blog', | ||
'/jp/blog', | ||
'/kr/blog', | ||
], | ||
tags: '@redirects @bacom @bacomSmoke @regression', | ||
}, | ||
{ | ||
tcid: '1', | ||
name: 'Checking URLs that should get .html appended', | ||
path: [ | ||
'/customer-success-stories/', | ||
'/customer-success-stories', | ||
'/resources/', | ||
'/resources/main', | ||
'/request-consultation/experience-cloud/', | ||
'/products/genstudio', | ||
'/products/experience-manager/sites/aem-sites', | ||
'/products/real-time-customer-data-platform/rtcdp', | ||
'/resources/holiday-shopping-report', | ||
'/products/pricing', | ||
'/products/marketo/marketo-measure', | ||
'/au/products/real-time-customer-data-platform/rtcdp', | ||
'/uk/resources/real-time-cdp', | ||
'/de/request-consultation/experience-cloud', | ||
'/fr/resources/', | ||
'/jp/request-consultation/experience-cloud', | ||
], | ||
tags: '@redirects @bacom @bacomSmoke @regression', | ||
}, | ||
], | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from '../../features/bacom/headers.spec.js'; | ||
import { WebUtil } from '../../libs/webutil.js'; | ||
|
||
const [bacomHelixPages, aemDxPages] = features; | ||
|
||
test.describe('BACOM Headers tests', () => { | ||
bacomHelixPages.path.forEach((path) => { | ||
test(`Checking the response header X-Adobe-Content for ${path} tags: ${bacomHelixPages.tags}`, async () => { | ||
const testPage = `https://business.adobe.com${path}`; | ||
const response = await WebUtil.getRequest(testPage); | ||
|
||
expect(response.status()).toBe(200); | ||
expect(response.headers()['x-adobe-content']).toBe('Helix BACOM'); | ||
}); | ||
}); | ||
|
||
aemDxPages.path.forEach((path) => { | ||
test(`Checking the response header X-Adobe-Content for ${path} tags: ${aemDxPages.tags}`, async () => { | ||
const testPage = `https://business.adobe.com${path}`; | ||
const response = await WebUtil.getRequest(testPage); | ||
|
||
expect(response.status()).toBe(200); | ||
expect(response.headers()['x-adobe-content']).toBe('AEM-dx'); | ||
}); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from '../../features/bacom/redirects.spec.js'; | ||
import { WebUtil } from '../../libs/webutil.js'; | ||
|
||
const [test1, test2] = features; | ||
|
||
test.describe('BACOM Redirects tests', () => { | ||
test1.path.forEach((path) => { | ||
test( | ||
`Verifying redirects for URLs without trailing slashes, path: ${path} tags: ${test1.tags}`, | ||
async () => { | ||
const pathWithoutTrailingSlash = path.endsWith('/') ? path.slice(0, -1) : path; | ||
const testPage = `https://business.adobe.com${pathWithoutTrailingSlash}`; | ||
const response = await WebUtil.getRequest(testPage); | ||
|
||
expect(response.url().slice(-1)).toBe('/'); | ||
expect(response.status()).toBe(200); | ||
}, | ||
); | ||
}); | ||
|
||
test2.path.forEach((path) => { | ||
test( | ||
`Verifying URLs get .html appended, path: ${path} tags: ${test1.tags}`, | ||
async () => { | ||
const pathWithoutHtml = path.endsWith('.html') ? path.slice(0, -5) : path; | ||
console.log(`pathWithoutHtml: ${pathWithoutHtml}`); | ||
const testPage = `https://business.adobe.com${pathWithoutHtml}`; | ||
const response = await WebUtil.getRequest(testPage); | ||
|
||
expect(response.url().slice(-5)).toBe('.html'); | ||
expect(response.status()).toBe(200); | ||
}, | ||
); | ||
}); | ||
}); |