test: добавить E2E-тест для множественных окружений и исправить синхронизацию AppState
This commit is contained in:
@@ -70,4 +70,39 @@ test.describe('Environment Management', () => {
|
||||
await expect(page.locator('#environments')).toBeVisible();
|
||||
await expect(page.locator('#environments option')).toHaveCount(2);
|
||||
});
|
||||
|
||||
test('should create multiple environments and switch between them', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.click('button:has-text("Create new")');
|
||||
|
||||
// Create env1
|
||||
page.once('dialog', async dialog => {
|
||||
await dialog.accept('env1');
|
||||
});
|
||||
await page.click('button.btn-success[title="Add environment"]');
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Create env2
|
||||
page.once('dialog', async dialog => {
|
||||
await dialog.accept('env2');
|
||||
});
|
||||
await page.click('button.btn-success[title="Add environment"]');
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify we have 3 envs (DEFAULT + env1 + env2)
|
||||
await expect(page.locator('#environments option')).toHaveCount(3);
|
||||
|
||||
// Switch to each env and verify page doesn't crash
|
||||
await page.locator('#environments').selectOption({ index: 0 });
|
||||
await page.waitForTimeout(200);
|
||||
await expect(page.locator('#environments')).toBeVisible();
|
||||
|
||||
await page.locator('#environments').selectOption('env1');
|
||||
await page.waitForTimeout(200);
|
||||
await expect(page.locator('#environments')).toBeVisible();
|
||||
|
||||
await page.locator('#environments').selectOption('env2');
|
||||
await page.waitForTimeout(200);
|
||||
await expect(page.locator('#environments')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user