fix(ci): e2e - fixtures copiees dans le container (docker cp) + 2 tests obsolètes mis a jour
- ci.yml e2e : les bind mounts C:\dev\git\python\ObsiGate sont vides en docker-in-docker (chemin du job container inexistant sur l hote) -> docker create + docker cp des fixtures + docker start - obsigate.spec.ts : placeholder de recherche attendu mis a jour (Rechercher dans toutes les vaults...) - obsigate.spec.ts : theme par defaut accepte defaut-obsigate (moteur themes.js) en plus de dark (ui.js legacy)
This commit is contained in:
+10
-4
@@ -125,7 +125,7 @@ jobs:
|
|||||||
- name: Start ObsiGate
|
- name: Start ObsiGate
|
||||||
run: |
|
run: |
|
||||||
docker rm -f obsigate-e2e 2>/dev/null || true
|
docker rm -f obsigate-e2e 2>/dev/null || true
|
||||||
docker run -d --name obsigate-e2e -p 2029:8080 \
|
docker create --name obsigate-e2e -p 2029:8080 \
|
||||||
-v $(pwd)/test_vault:/vaults/TestVault \
|
-v $(pwd)/test_vault:/vaults/TestVault \
|
||||||
-v $(pwd)/test_dir:/vaults/TestDir \
|
-v $(pwd)/test_dir:/vaults/TestDir \
|
||||||
-e VAULT_1_NAME=TestVault \
|
-e VAULT_1_NAME=TestVault \
|
||||||
@@ -134,9 +134,15 @@ jobs:
|
|||||||
-e DIR_1_PATH=/vaults/TestDir \
|
-e DIR_1_PATH=/vaults/TestDir \
|
||||||
-e OBSIGATE_AUTH_ENABLED=false \
|
-e OBSIGATE_AUTH_ENABLED=false \
|
||||||
obsigate:ci
|
obsigate:ci
|
||||||
# Docker-in-docker : le port publié est joignable via l'IP de la
|
# Docker-in-docker : le bind mount $(pwd)/... pointe sur un chemin
|
||||||
# passerelle (localhost dans le job container ne voit pas le port
|
# du job container, inexistant sur l'hôte → montage vide. Les -v
|
||||||
# publié sur l'hôte).
|
# créent quand même /vaults/* dans le container ; on y copie les
|
||||||
|
# fixtures avant le démarrage (l'indexeur scanne au démarrage).
|
||||||
|
docker cp test_vault/. obsigate-e2e:/vaults/TestVault
|
||||||
|
docker cp test_dir/. obsigate-e2e:/vaults/TestDir
|
||||||
|
docker start obsigate-e2e
|
||||||
|
# Le port publié est joignable via l'IP de la passerelle (localhost
|
||||||
|
# du job container ne voit pas le port publié sur l'hôte).
|
||||||
GW=$(ip route show default | awk '{print $3}' || echo 172.17.0.1)
|
GW=$(ip route show default | awk '{print $3}' || echo 172.17.0.1)
|
||||||
echo "Gateway IP: $GW"
|
echo "Gateway IP: $GW"
|
||||||
# Wait for health check
|
# Wait for health check
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ test.describe('Dashboard & Navigation', () => {
|
|||||||
test('should show search bar in header', async ({ page }) => {
|
test('should show search bar in header', async ({ page }) => {
|
||||||
await goHome(page);
|
await goHome(page);
|
||||||
await expect(page.locator('#search-input')).toBeVisible();
|
await expect(page.locator('#search-input')).toBeVisible();
|
||||||
await expect(page.locator('#search-input')).toHaveAttribute('placeholder', 'Rechercher ...');
|
await expect(page.locator('#search-input')).toHaveAttribute('placeholder', 'Rechercher dans toutes les vaults...');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should show floating results bar when searching', async ({ page }) => {
|
test('should show floating results bar when searching', async ({ page }) => {
|
||||||
@@ -386,8 +386,9 @@ test.describe('Dark Mode', () => {
|
|||||||
await goHome(page);
|
await goHome(page);
|
||||||
const html = page.locator('html');
|
const html = page.locator('html');
|
||||||
const theme = await html.getAttribute('data-theme');
|
const theme = await html.getAttribute('data-theme');
|
||||||
// Should default to dark
|
// Le thème par défaut est sombre : 'dark' (ui.js legacy) ou
|
||||||
expect(theme).toBe('dark');
|
// 'defaut-obsigate' (moteur de thèmes themes.js, mode dark par défaut)
|
||||||
|
expect(['dark', 'defaut-obsigate']).toContain(theme);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should toggle theme and persist', async ({ page }) => {
|
test('should toggle theme and persist', async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user