import { Page, TestInfo } from '@playwright/test';

export async function attachGeoLocation(page: Page, testInfo: TestInfo) {
    const geoResponse = await page.request.get('https://ipapi.co/json');
    const geo = await geoResponse.json();

    await testInfo.attach('geo-location.json', {
        body: JSON.stringify(geo, null, 2),
        contentType: 'application/json'
    });
}