import { test, expect } from '@playwright/test'; test('Controller updates Display score', async ({ context }) => { // 1. Create two pages (Controller and Display) const displayPage = await context.newPage(); const controllerPage = await context.newPage(); // 2. Open Display await displayPage.goto('http://localhost:3000'); await expect(displayPage).toHaveTitle(/Segnapunti/); // 3. Open Controller await controllerPage.goto('http://localhost:3001'); await expect(controllerPage).toHaveTitle(/Controller/); // 4. Check initial state (assuming reset) // Note: This depends on the specific IDs in your HTML. // You might need to adjust selectors based on your actual HTML structure. // Example: waiting for score element // await expect(displayPage.locator('#score-home')).toHaveText('0'); // 5. Action on Controller // await controllerPage.click('#btn-add-home'); // 6. Verify on Display // await expect(displayPage.locator('#score-home')).toHaveText('1'); });