diff --git a/frontend/tests/playwright/auth-state.json b/frontend/tests/playwright/auth-state.json index 3aa12bc6a..0cfde8474 100644 --- a/frontend/tests/playwright/auth-state.json +++ b/frontend/tests/playwright/auth-state.json @@ -17,8 +17,12 @@ "value": "light" }, { - "name": "__$global-destinationPath$__", - "value": "/" + "name": "__$user-gettingStarted$__", + "value": "{\"steps\":[{\"title\":\"🛠️ Install OpenReplay\",\"status\":\"completed\"},{\"title\":\"🕵️ Identify Users\",\"status\":\"completed\"},{\"title\":\"🧑‍💻 Invite Team Members\",\"status\":\"completed\"},{\"title\":\"🔌 Integrations\",\"status\":\"completed\"}],\"status\":\"completed\"}" + }, + { + "name": "___$or_spotToken$___", + "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDEzOTg2LCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMzM4NiwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.8HHG8bNovaBgLZz1iIZpD-WHR8ke-ue6VukID5vxW0IuvySL21sPu8D-sFFZSn-ON_EIMW14Pu_qYVJoib5lMQ" }, { "name": "__$session-timezone$__", @@ -28,13 +32,33 @@ "name": "__$session-mouseTrail$__", "value": "true" }, + { + "name": "__openreplay_health_status", + "value": "1748013396460" + }, + { + "name": "__$user-siteId$__", + "value": "65" + }, + { + "name": "__or__langBannerClosed", + "value": "0" + }, { "name": "AuthStore", - "value": "{\"authDetails\":\"{\\\"tenants\\\":true,\\\"sso\\\":null,\\\"ssoProvider\\\":null,\\\"enforceSSO\\\":null,\\\"edition\\\":\\\"foss\\\"}\",\"__mps__\":{\"expireInTimestamp\":1748009041183}}" + "value": "{\"authDetails\":\"{\\\"tenants\\\":true,\\\"sso\\\":null,\\\"ssoProvider\\\":null,\\\"enforceSSO\\\":null,\\\"edition\\\":\\\"foss\\\"}\",\"__mps__\":{\"expireInTimestamp\":1748016995020}}" }, { "name": "UserStore", - "value": "{\"siteId\":null,\"tenants\":[],\"jwt\":null,\"spotJwt\":null,\"scopeState\":null,\"onboarding\":false,\"account\":\"{}\"}" + "value": "{\"siteId\":null,\"tenants\":[],\"jwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDk5Nzg2LCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMzM4NiwiYXVkIjoiZnJvbnQ6T3BlblJlcGxheSJ9.614ybiDIepo4OHWWMb-yDGBI6rAHb0UMr5Hxbi0lgvhnxmIQwC32KDyE1E39y47nQaqgkrr-GarIlBmCF_A0Ow\",\"spotJwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDEzOTg2LCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMzM4NiwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.8HHG8bNovaBgLZz1iIZpD-WHR8ke-ue6VukID5vxW0IuvySL21sPu8D-sFFZSn-ON_EIMW14Pu_qYVJoib5lMQ\",\"scopeState\":2,\"onboarding\":false,\"account\":\"{\\\"id\\\":58,\\\"email\\\":\\\"andrei@openreplay.com\\\",\\\"smtp\\\":false,\\\"expirationDate\\\":-1,\\\"permissions\\\":[],\\\"settings\\\":{\\\"modules\\\":[\\\"usability-tests\\\",\\\"feature-flags\\\"]},\\\"iceServers\\\":[],\\\"hasPassword\\\":true,\\\"apiKey\\\":\\\"48Vph82zUEWHmfPSUbgG\\\",\\\"edition\\\":\\\"foss\\\",\\\"optOut\\\":false,\\\"versionNumber\\\":\\\"1.17.0\\\",\\\"name\\\":\\\"Andrei\\\",\\\"createdAt\\\":1652690354756,\\\"admin\\\":true,\\\"superAdmin\\\":false}\"}" + }, + { + "name": "__openreplay_health_response", + "value": "{\"overallHealth\":true,\"healthMap\":{\"databases\":{\"name\":\"Databases\",\"healthOk\":true,\"subservices\":{\"postgres\":{\"health\":true,\"details\":{}}},\"serviceName\":\"databases\"},\"ingestionPipeline\":{\"name\":\"Ingestion Pipeline\",\"healthOk\":true,\"subservices\":{\"redis\":{\"health\":true,\"details\":{}}},\"serviceName\":\"ingestionPipeline\"},\"backendServices\":{\"name\":\"Backend Services\",\"healthOk\":true,\"subservices\":{\"alerts\":{\"health\":true,\"details\":{}},\"assets\":{\"health\":true,\"details\":{}},\"assist\":{\"health\":true,\"details\":{}},\"chalice\":{\"health\":true,\"details\":{}},\"db\":{\"health\":true,\"details\":{}},\"ender\":{\"health\":true,\"details\":{}},\"frontend\":{\"health\":true,\"details\":{}},\"heuristics\":{\"health\":true,\"details\":{}},\"http\":{\"health\":true,\"details\":{}},\"ingress-nginx\":{\"health\":true,\"details\":{}},\"integrations\":{\"health\":true,\"details\":{}},\"sink\":{\"health\":true,\"details\":{}},\"sourcemapreader\":{\"health\":true,\"details\":{}},\"storage\":{\"health\":true,\"details\":{}}},\"serviceName\":\"backendServices\"}},\"details\":{\"numberOfSessionsCaptured\":214690,\"numberOfEventCaptured\":1816886}}" + }, + { + "name": "__$session-filter$__", + "value": "{\"name\":\"\",\"events\":[],\"custom\":{},\"rangeValue\":\"LAST_30_DAYS\",\"startDate\":1745422200000,\"endDate\":1748014200000,\"groupByUser\":false,\"sort\":\"startTs\",\"order\":\"desc\",\"strict\":false,\"eventsOrder\":\"then\",\"limit\":10,\"rangeName\":\"LAST_30_DAYS\",\"page\":1,\"perPage\":10,\"tab\":\"sessions\",\"filters\":[{\"type\":\"location\",\"isEvent\":true,\"value\":[\"\"],\"operator\":\"isAny\",\"source\":\"\",\"sourceOperator\":\"\",\"filters\":[]}]}" } ] } diff --git a/frontend/tests/playwright/dashboards.spec.ts b/frontend/tests/playwright/dashboards.spec.ts new file mode 100644 index 000000000..0185e33de --- /dev/null +++ b/frontend/tests/playwright/dashboards.spec.ts @@ -0,0 +1,13 @@ +import { test, expect } from '@playwright/test'; + +test('check if dashboards exist', async ({ page }) => { + await page.goto('http://localhost:3333/login'); + await page.locator('[data-test-id="login"]').click(); + await page.locator('[data-test-id="login"]').fill('andrei@openreplay.com'); + await page.locator('[data-test-id="password"]').click(); + await page.locator('[data-test-id="password"]').fill('Andrey123!'); + await page.locator('[data-test-id="log-button"]').click(); + await page.getByText('Dashboards').click(); + await page.getByText('Renamed One').click(); + await expect(page.getByRole('heading', { name: 'Renamed One' })).toBeVisible(); +}); \ No newline at end of file diff --git a/frontend/tests/playwright/session-list.spec.ts b/frontend/tests/playwright/session-list.spec.ts deleted file mode 100644 index efad033fc..000000000 --- a/frontend/tests/playwright/session-list.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { test, expect } from '@playwright/test'; -import { testUseAuthState } from './helpers'; - -testUseAuthState(); - -test('test', async ({ page }) => { - await page.goto('/'); - await page.getByRole('button', { name: 'OpenReplay Documentation Site' }).click(); - await page.getByRole('menuitem', { name: 'Android' }).locator('div').click(); - await page.getByRole('button', { name: 'Android caret-down' }).click(); - await page.getByText('OpenReplay Documentation Site').click(); - await page.locator('#session-item').first().click(); - await expect(page.locator('#session-item')).toBeVisible(); -}); \ No newline at end of file diff --git a/frontend/tests/playwright/sessionList.spec copy.ts b/frontend/tests/playwright/sessionList.spec copy.ts new file mode 100644 index 000000000..c61626d02 --- /dev/null +++ b/frontend/tests/playwright/sessionList.spec copy.ts @@ -0,0 +1,15 @@ +import { test, expect } from '@playwright/test'; +import { testUseAuthState } from './helpers'; + +testUseAuthState(); + +test('check session list after change period', async ({ page }) => { + await page.goto('http://localhost:3333/login'); + await page.locator('[data-test-id="login"]').click(); + await page.locator('[data-test-id="login"]').fill('andrei@openreplay.com'); + await page.locator('[data-test-id="password"]').click(); + await page.locator('[data-test-id="password"]').fill('Andrey123!'); + await page.locator('[data-test-id="log-button"]').click(); + + +}); \ No newline at end of file diff --git a/frontend/tests/playwright/sessionList.spec.ts b/frontend/tests/playwright/sessionList.spec.ts index ee2663581..bf090c380 100644 --- a/frontend/tests/playwright/sessionList.spec.ts +++ b/frontend/tests/playwright/sessionList.spec.ts @@ -1,4 +1,7 @@ import { test, expect } from '@playwright/test'; +import { testUseAuthState } from './helpers'; + +testUseAuthState(); test('check session list after change period', async ({ page }) => { await page.goto('http://localhost:3333/login'); diff --git a/frontend/tests/playwright/test-1.spec.ts b/frontend/tests/playwright/test-1.spec.ts new file mode 100644 index 000000000..abedcae07 --- /dev/null +++ b/frontend/tests/playwright/test-1.spec.ts @@ -0,0 +1,30 @@ +import { test, expect } from '@playwright/test'; + +test('test', async ({ page }) => { + await page.goto('http://localhost:3333/login'); + await page.locator('[data-test-id="login"]').fill('andrei@openreplay.com'); + await page.locator('[data-test-id="password"]').click(); + await page.locator('[data-test-id="password"]').fill('Andrey123!'); + await page.locator('[data-test-id="log-button"]').click(); + await page.getByTitle('Past 24 Hours').click(); + await page.getByText('Past 30 Days').click(); + await page.getByRole('button', { name: 'Android caret-down' }).click(); + await page.getByText('OpenReplay Documentation Site').click(); + await page.locator('.group').first().click(); + await page + .locator('div') + .filter({ + hasText: /^Anonymous UserMay 21, 03:48pm··Edge, Mac OS X, Desktop·More$/, + }) + .first() + .click({ + button: 'right', + }); + const iframeElement = await page + .locator('iframe[class^="screen-module__iframe"]') + .first(); + const frameHandle = await iframeElement.elementHandle(); + const frame = await frameHandle?.contentFrame(); + const hasBody = await frame?.evaluate(() => !!document.body); + expect(hasBody).toBeTruthy(); +}); diff --git a/tests/playwright/auth-state.json b/tests/playwright/auth-state.json index 638f34b8c..48f43358e 100644 --- a/tests/playwright/auth-state.json +++ b/tests/playwright/auth-state.json @@ -26,7 +26,7 @@ }, { "name": "___$or_spotToken$___", - "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDEwODYxLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMDI2MSwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.bsy2jTsazqZ3g5y1sHS0UwXn6lTi2B6eO-LufIhNwCa9F9-XaJdbfavFxq47Eprq222vGw73MGdS8Ii0Et0htQ" + "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDE2NDcwLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxNTg3MCwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.iCpJO-SSL8nmHhNGPXcSBTXd3L9Tn57sBS5Zhia500pqWcdfuR0RiRQ_zN8DkOh0Wcnx6IygdvBAAdZj-auvJQ" }, { "name": "__$session-timezone$__", @@ -38,7 +38,7 @@ }, { "name": "__openreplay_health_status", - "value": "1748010271110" + "value": "1748015880384" }, { "name": "__$user-siteId$__", @@ -50,11 +50,11 @@ }, { "name": "AuthStore", - "value": "{\"authDetails\":\"{\\\"tenants\\\":true,\\\"sso\\\":null,\\\"ssoProvider\\\":null,\\\"enforceSSO\\\":null,\\\"edition\\\":\\\"foss\\\"}\",\"__mps__\":{\"expireInTimestamp\":1748013869571}}" + "value": "{\"authDetails\":\"{\\\"tenants\\\":true,\\\"sso\\\":null,\\\"ssoProvider\\\":null,\\\"enforceSSO\\\":null,\\\"edition\\\":\\\"foss\\\"}\",\"__mps__\":{\"expireInTimestamp\":1748019478752}}" }, { "name": "UserStore", - "value": "{\"siteId\":null,\"tenants\":[],\"jwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDk2NjYxLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMDI2MSwiYXVkIjoiZnJvbnQ6T3BlblJlcGxheSJ9.OySkuNZoEbekRhm6D5zr1cN6NUCuditF_wy5docowyGT5Q4uUDfBoRLIKgIpOmHxhBuszyPQiDJBGJiNfo6Vlw\",\"spotJwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDEwODYxLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMDI2MSwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.bsy2jTsazqZ3g5y1sHS0UwXn6lTi2B6eO-LufIhNwCa9F9-XaJdbfavFxq47Eprq222vGw73MGdS8Ii0Et0htQ\",\"scopeState\":2,\"onboarding\":false,\"account\":\"{\\\"id\\\":58,\\\"email\\\":\\\"andrei@openreplay.com\\\",\\\"smtp\\\":false,\\\"expirationDate\\\":-1,\\\"permissions\\\":[],\\\"settings\\\":{\\\"modules\\\":[\\\"usability-tests\\\",\\\"feature-flags\\\"]},\\\"iceServers\\\":[],\\\"hasPassword\\\":true,\\\"apiKey\\\":\\\"48Vph82zUEWHmfPSUbgG\\\",\\\"edition\\\":\\\"foss\\\",\\\"optOut\\\":false,\\\"versionNumber\\\":\\\"1.17.0\\\",\\\"name\\\":\\\"Andrei\\\",\\\"createdAt\\\":1652690354756,\\\"admin\\\":true,\\\"superAdmin\\\":false}\"}" + "value": "{\"siteId\":null,\"tenants\":[],\"jwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MTAyMjcwLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxNTg3MCwiYXVkIjoiZnJvbnQ6T3BlblJlcGxheSJ9.YwXb8jcPEegspmIUlQV4DImo0SJ6SP0jO9MLLyX-F7W6w4imTQjJfhhi9mkdf0TijnTAifni6XFmW7rPbdNObQ\",\"spotJwt\":\"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDE2NDcwLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxNTg3MCwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.iCpJO-SSL8nmHhNGPXcSBTXd3L9Tn57sBS5Zhia500pqWcdfuR0RiRQ_zN8DkOh0Wcnx6IygdvBAAdZj-auvJQ\",\"scopeState\":2,\"onboarding\":false,\"account\":\"{\\\"id\\\":58,\\\"email\\\":\\\"andrei@openreplay.com\\\",\\\"smtp\\\":false,\\\"expirationDate\\\":-1,\\\"permissions\\\":[],\\\"settings\\\":{\\\"modules\\\":[\\\"usability-tests\\\",\\\"feature-flags\\\"]},\\\"iceServers\\\":[],\\\"hasPassword\\\":true,\\\"apiKey\\\":\\\"48Vph82zUEWHmfPSUbgG\\\",\\\"edition\\\":\\\"foss\\\",\\\"optOut\\\":false,\\\"versionNumber\\\":\\\"1.17.0\\\",\\\"name\\\":\\\"Andrei\\\",\\\"createdAt\\\":1652690354756,\\\"admin\\\":true,\\\"superAdmin\\\":false}\"}" }, { "name": "__openreplay_health_response",