Files
unisono/tests/e2e/verify-copy-link-button-functionality.e2e.test.ts
2025-10-29 15:45:00 +02:00

26 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Copy Link Feature', () => {
test('Verify Copy Link Button Functionality', async ({ page }) => {
// Ensure a session has been successfully created and the user is on the active session page.
await page.goto('https://unisono.aglink.duckdns.org/login');
await page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
await page.getByRole('button', { name: 'Enter' }).click();
await page.waitForURL(/.*\/session\/.*/);
await page.getByRole('textbox', { name: 'Topic' }).fill('Test Session for Copy Link');
await page.getByRole('textbox', { name: 'Details (Optional)' }).fill('Testing the copy link feature');
await page.getByRole('spinbutton', { name: 'Number of Expected Responses' }).fill('2');
await page.getByRole('button', { name: 'Start Session' }).click();
await page.waitForURL(/.*\/session\/.*/);
// 2. Click the "Copy Link" button.
await page.getByRole('button', { name: 'Copy Link' }).click();
// Expected Results:
// - A success message (e.g., "Link copied to clipboard!") is displayed.
await expect(page.getByText('Link copied to clipboard!')).toBeVisible();
});
});