Skip to content

Commit

Permalink
feat: add test for viewing device details and validating screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
elikoga committed Dec 22, 2024
1 parent db840ad commit 089e1e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions frontend/tests/screencaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,22 @@ test('explores more pages', async ({ page }) => {
await externalReposNav.click();
await expect(page).toHaveScreenshot();
});

test('view device details', async ({ page }) => {
// Navigate to Devices page
await page.goto('/devices');

// Click on "View Details" button
const viewDetailsButton = page
.locator('a', { hasText: 'View Details' })
.locator('visible=true')
.first();
await viewDetailsButton.click();

// Validate the Device Details page
// await expect(page.locator('h1')).toHaveText('Device Details');
await expect(page).toHaveScreenshot();

// Optionally, navigate back to Devices page
await page.goBack();
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 089e1e0

Please sign in to comment.