-
Notifications
You must be signed in to change notification settings - Fork 35
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 7, 2024
1 parent
5ff742f
commit af9ba43
Showing
5 changed files
with
140 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,25 @@ | ||
module.exports = { | ||
name: 'Redirects', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: 'Bacom redirects', | ||
path: [ | ||
'/', | ||
'/au', | ||
'/uk', | ||
'/de', | ||
'/fr', | ||
'/jp', | ||
'/blog', | ||
'/au/blog', | ||
'/uk/blog', | ||
'/de/blog', | ||
'/fr/blog', | ||
'/jp/blog', | ||
'/kr/blog', | ||
], | ||
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,29 @@ | ||
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}`; | ||
console.log(`[Test Page]: ${testPage}`); | ||
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}`; | ||
console.log(`[Test Page]: ${testPage}`); | ||
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,22 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from '../../features/bacom/redirects.spec.js'; | ||
import { WebUtil } from '../../libs/webutil.js'; | ||
|
||
const [test1] = 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}`; | ||
console.log(`[Test Page]: ${testPage}`); | ||
const response = await WebUtil.getRequest(testPage); | ||
|
||
expect(response.url().slice(-1)).toBe('/'); | ||
expect(response.status()).toBe(200); | ||
}, | ||
); | ||
}); | ||
}); |