Datasets:
File size: 13,386 Bytes
0e0e768 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | import { test, expect } from '@playwright/test';
const BASE = 'http://localhost:8100';
test.describe('Homepage visual layout', () => {
test('homepage has a header at the top of the page', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const header = page.locator('div').filter({ hasText: /STREAMORA/ }).first();
const box = await header.boundingBox();
expect(box).toBeTruthy();
expect(box!.y).toBeLessThan(200);
});
test('homepage logo image is displayed at reasonable size', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const logo = page.locator('img[alt="Streamora"]').first();
await expect(logo).toBeVisible();
const box = await logo.boundingBox();
expect(box).toBeTruthy();
expect(box!.width).toBeGreaterThan(20);
expect(box!.height).toBeGreaterThan(10);
});
test('homepage hero section is near the top', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const heroHeading = page.locator('h2', { hasText: 'CARRY YOUR MEDIA ANYWHERE WITH STREAMORA' });
const box = await heroHeading.boundingBox();
expect(box).toBeTruthy();
expect(box!.y).toBeLessThan(800);
});
test('homepage footer is below the main content', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const heroH2 = page.locator('h2', { hasText: 'CARRY YOUR MEDIA ANYWHERE' });
const heroBox = await heroH2.boundingBox();
const copyright = page.locator('text=© 2024 Streamora').first();
const footerBox = await copyright.boundingBox();
expect(heroBox).toBeTruthy();
expect(footerBox).toBeTruthy();
expect(footerBox!.y).toBeGreaterThan(heroBox!.y);
});
test('homepage nav items are horizontally arranged at desktop', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const aboutLink = page.locator('nav a', { hasText: 'ABOUT' });
const downloadLink = page.locator('nav a', { hasText: 'DOWNLOAD' });
const aboutBox = await aboutLink.boundingBox();
const downloadBox = await downloadLink.boundingBox();
expect(aboutBox).toBeTruthy();
expect(downloadBox).toBeTruthy();
expect(Math.abs(aboutBox!.y - downloadBox!.y)).toBeLessThan(30);
});
});
test.describe('About page visual layout', () => {
test('about page hero h1 is prominently displayed', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/about.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const h1 = page.locator('h1', { hasText: 'Your Media, Your Rules' });
await expect(h1).toBeVisible();
const box = await h1.boundingBox();
expect(box).toBeTruthy();
expect(box!.y).toBeLessThan(600);
});
test('about page feature boxes are visible', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/about.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const feature = page.locator('h4', { hasText: 'Your Media, Every Device' });
await expect(feature).toBeVisible();
});
test('about page manage library image is displayed', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/about.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const img = page.locator('img[alt="manage library"]');
if (await img.count() > 0) {
await expect(img).toBeVisible();
const box = await img.boundingBox();
expect(box).toBeTruthy();
expect(box!.width).toBeGreaterThan(100);
expect(box!.height).toBeGreaterThan(100);
}
});
});
test.describe('Download page visual layout', () => {
test('download page has two-column layout with server and apps sections', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/download.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const serverH2 = page.locator('h2').filter({ hasText: 'Streamora Server' }).first();
const appsH2 = page.locator('h2').filter({ hasText: 'Apps' });
const serverBox = await serverH2.boundingBox();
const appsBox = await appsH2.boundingBox();
expect(serverBox).toBeTruthy();
expect(appsBox).toBeTruthy();
});
test('download page h1 is at the top', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/download.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const h1 = page.locator('h1');
const box = await h1.boundingBox();
expect(box).toBeTruthy();
expect(box!.y).toBeLessThan(500);
});
});
test.describe('Premiere page visual layout', () => {
test('premiere page pricing tiers are displayed', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/premiere.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const monthly = page.locator('h3', { hasText: 'Monthly' }).first();
const yearly = page.locator('h3', { hasText: '1 Year' }).first();
const lifetime = page.locator('h3', { hasText: 'Lifetime' }).first();
await expect(monthly).toBeVisible();
await expect(yearly).toBeVisible();
await expect(lifetime).toBeVisible();
});
test('premiere page pricing tiers are arranged side by side', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/premiere.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const monthly = page.locator('h3', { hasText: 'Monthly' }).first();
const lifetime = page.locator('h3', { hasText: 'Lifetime' }).first();
const monthlyBox = await monthly.boundingBox();
const lifetimeBox = await lifetime.boundingBox();
expect(monthlyBox).toBeTruthy();
expect(lifetimeBox).toBeTruthy();
expect(Math.abs(monthlyBox!.y - lifetimeBox!.y)).toBeLessThan(50);
});
test('premiere page checkout images are displayed at reasonable size', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/premiere.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const checkoutImgs = page.locator('img[alt="Check out securely now"]');
const count = await checkoutImgs.count();
expect(count).toBeGreaterThan(0);
const box = await checkoutImgs.first().boundingBox();
expect(box).toBeTruthy();
expect(box!.width).toBeGreaterThan(10);
});
});
test.describe('Community pages visual layout', () => {
test('community forums page has forum sections listed vertically', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/community/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const generalSection = page.locator('h2', { hasText: 'General' }).first();
const serverSection = page.locator('h2', { hasText: 'Streamora Server' }).first();
const generalBox = await generalSection.boundingBox();
const serverBox = await serverSection.boundingBox();
expect(generalBox).toBeTruthy();
expect(serverBox).toBeTruthy();
expect(serverBox!.y).toBeGreaterThan(generalBox!.y);
});
test('community blogs page shows blog cards', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/community/blogs/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const blogTitles = page.locator('h2');
const count = await blogTitles.count();
expect(count).toBeGreaterThan(5);
});
test('staff page member sections are displayed', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/community/staff/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const admins = page.locator('h2', { hasText: 'Administrators' });
await expect(admins).toBeVisible();
const adminBox = await admins.boundingBox();
expect(adminBox).toBeTruthy();
});
});
test.describe('Device pages visual layout', () => {
test('Android TV page has content images displayed', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/streamora-for-android-tv.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const images = page.locator('img');
const count = await images.count();
expect(count).toBeGreaterThan(3);
});
test('Roku page screenshots are displayed at reasonable sizes', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/streamora-for-roku.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const screenshots = page.locator('img[alt="Screenshot"]');
const count = await screenshots.count();
expect(count).toBeGreaterThan(0);
const box = await screenshots.first().boundingBox();
expect(box).toBeTruthy();
expect(box!.width).toBeGreaterThan(50);
});
test('iOS page screenshot gallery images are visible', async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`${BASE}/streamora-for-ios.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const images = page.locator('img');
const count = await images.count();
expect(count).toBeGreaterThan(3);
});
});
test.describe('Mobile responsive layout tests', () => {
test('homepage at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(400);
});
test('about page at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/about.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(400);
});
test('download page at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/download.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(400);
});
test('premiere page at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/premiere.html`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(400);
});
test('community page at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/community/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(400);
});
test('homepage heading is visible at mobile width', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const h1 = page.locator('h1').first();
await expect(h1).toBeVisible();
});
test('support page at mobile width has no horizontal overflow', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto(`${BASE}/support/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const bodyWidth = await page.evaluate(() => document.body.scrollWidth);
expect(bodyWidth).toBeLessThanOrEqual(420);
});
});
|