add e2e test

This commit is contained in:
Андрей Бабушкин 2025-05-26 09:52:42 +02:00
parent 0bd44d680c
commit 849ce60d56
7 changed files with 93 additions and 22 deletions

View file

@ -17,8 +17,12 @@
"value": "light" "value": "light"
}, },
{ {
"name": "__$global-destinationPath$__", "name": "__$user-gettingStarted$__",
"value": "/" "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$__", "name": "__$session-timezone$__",
@ -28,13 +32,33 @@
"name": "__$session-mouseTrail$__", "name": "__$session-mouseTrail$__",
"value": "true" "value": "true"
}, },
{
"name": "__openreplay_health_status",
"value": "1748013396460"
},
{
"name": "__$user-siteId$__",
"value": "65"
},
{
"name": "__or__langBannerClosed",
"value": "0"
},
{ {
"name": "AuthStore", "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", "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\":[]}]}"
} }
] ]
} }

View file

@ -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();
});

View file

@ -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();
});

View file

@ -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();
});

View file

@ -1,4 +1,7 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { testUseAuthState } from './helpers';
testUseAuthState();
test('check session list after change period', async ({ page }) => { test('check session list after change period', async ({ page }) => {
await page.goto('http://localhost:3333/login'); await page.goto('http://localhost:3333/login');

View file

@ -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();
});

View file

@ -26,7 +26,7 @@
}, },
{ {
"name": "___$or_spotToken$___", "name": "___$or_spotToken$___",
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDEwODYxLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxMDI2MSwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.bsy2jTsazqZ3g5y1sHS0UwXn6lTi2B6eO-LufIhNwCa9F9-XaJdbfavFxq47Eprq222vGw73MGdS8Ii0Et0htQ" "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjU4LCJ0ZW5hbnRJZCI6MSwiZXhwIjoxNzQ4MDE2NDcwLCJpc3MiOiJPcGVuUmVwbGF5LW9zcyIsImlhdCI6MTc0ODAxNTg3MCwiYXVkIjoic3BvdDpPcGVuUmVwbGF5In0.iCpJO-SSL8nmHhNGPXcSBTXd3L9Tn57sBS5Zhia500pqWcdfuR0RiRQ_zN8DkOh0Wcnx6IygdvBAAdZj-auvJQ"
}, },
{ {
"name": "__$session-timezone$__", "name": "__$session-timezone$__",
@ -38,7 +38,7 @@
}, },
{ {
"name": "__openreplay_health_status", "name": "__openreplay_health_status",
"value": "1748010271110" "value": "1748015880384"
}, },
{ {
"name": "__$user-siteId$__", "name": "__$user-siteId$__",
@ -50,11 +50,11 @@
}, },
{ {
"name": "AuthStore", "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", "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", "name": "__openreplay_health_response",