Skip to content

Commit 9987b27

Browse files
committed
Tests: Added footer test + adjusted other tests
1 parent 0dee3ac commit 9987b27

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

layouts/partials/footer-v2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="footer-layout">
2-
<div class="footer-f5-trademark">
2+
<div class="footer-f5-trademark" data-testid="footer-f5-trademark">
33
<img class="f5-logo-footer" src="{{ "/images/icons/Logo_F5.svg" | absURL }}" alt="F5 logo">
44
<p>©2025 F5, Inc. All rights reserved. NGINX is a registered trademark of F5, Inc.</p>
55
</div>
6-
<div class="footer-useful-links">
6+
<div class="footer-useful-links" data-testid="footer-useful-links">
77
<a
88
href="https://www.f5.com/company/policies/trademarks"
99
rel="noopener"

layouts/partials/sidebar-v2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{{ $productName := index $productMap $productIdentifier }}
2323

2424
<div class="sidebar__container">
25-
<div class="sidebar__header">
25+
<div class="sidebar__header" data-testid="sidebar__header">
2626
<div>
2727
<a href="{{ .Site.BaseURL | relLangURL }}" alt="NGINX Docs Home">
2828
<img class="sidebar__img" src="{{ "/images/icons/NGINX-Docs-horiz-black-type.svg" | absURL }}" alt="NGINX Docs">

tests/src/footer.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Smoke test for footer', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/');
6+
});
7+
8+
test('should test footer renders', async ({ page }) => {
9+
await expect(
10+
await page.locator('data-testid=footer-f5-trademark').count()
11+
).toBeTruthy();
12+
await expect(
13+
await page.locator('data-testid=footer-useful-links').count()
14+
).toBeTruthy();
15+
});
16+
});
File renamed without changes.

tests/src/product-landing-smoke.spec.js renamed to tests/src/product-landing.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
22
import { runSmokeTestOnPage } from './util';
33

44
test.describe('Smoke test for landing page', () => {
5-
test('should test each product landing page renders', async ({ page }) => {
5+
test('should test product landing page renders', async ({ page }) => {
66
const products = ['test-product', 'nginx'];
77

88
for (const product of products) {

tests/src/sidebar-smoke.spec.js renamed to tests/src/sidebar.spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test } from '@playwright/test';
1+
import { test, expect } from '@playwright/test';
22
import { runSmokeTestOnPage } from './util';
33

44
async function openPage(page, sidebarPage) {
@@ -46,6 +46,15 @@ test.describe('Smoke test for sidebar', () => {
4646
await page.goto(`/test-product/`);
4747
});
4848

49+
test('should test sidebar renders', async ({ page }) => {
50+
await expect(
51+
await page.locator('data-testid=sidebar__header').count()
52+
).toBeTruthy();
53+
await expect(
54+
await page.locator('data-testid=sidebar__content').count()
55+
).toBeTruthy();
56+
});
57+
4958
test('should test each section page on sidebar renders', async ({ page }) => {
5059
/* Click on each link */
5160
const sidebarPages = await page.locator('data-testid=sidebar__page').all();

0 commit comments

Comments
 (0)