Merge pull request #178 from scub-france/fix/e2e-rechunk-feature-flag

fix(e2e): replace fragile index-based toggle selection with dedicated selectors
This commit is contained in:
Pier-Jean Malandrino 2026-04-12 10:16:46 +02:00 committed by GitHub
commit 6f008ec262
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 14 deletions

View file

@ -51,10 +51,9 @@ Feature: UI — Pipeline configuration options
* select('[data-e2e=config-select]', 'fast') * select('[data-e2e=config-select]', 'fast')
# Switch to Verify mode and back # Switch to Verify mode and back
* def toggleBtns = locateAll('[data-e2e=toggle-btn]') * click('[data-e2e~=verify-btn]')
* toggleBtns[1].click() * waitFor('[data-e2e~=verify-btn].active')
* waitFor('[data-e2e=toggle-btn].active') * click('[data-e2e~=configure-btn]')
* toggleBtns[0].click()
* waitFor('[data-e2e=config-select]') * waitFor('[data-e2e=config-select]')
# Verify table mode is still fast # Verify table mode is still fast

View file

@ -25,9 +25,9 @@ Feature: UI — Rechunk an analysis with different parameters
* call read('classpath:common/helpers/ui-wait-analysis.feature') * call read('classpath:common/helpers/ui-wait-analysis.feature')
* waitFor('[data-e2e=result-tabs]') * waitFor('[data-e2e=result-tabs]')
# Now Préparer toggle should be enabled — click the last one # Switch to Prepare tab — use dedicated selector (avoids race with feature flag load)
* def toggleBtns = locateAll('[data-e2e=toggle-btn]') * waitFor('[data-e2e~=prepare-btn]')
* toggleBtns[karate.sizeOf(toggleBtns) - 1].click() * click('[data-e2e~=prepare-btn]')
# Wait for chunk panel to load # Wait for chunk panel to load
* waitFor('[data-e2e=chunk-panel]') * waitFor('[data-e2e=chunk-panel]')

View file

@ -46,8 +46,8 @@ Feature: UI — Full happy path via browser
* match text('[data-e2e=raw-content]') != '' * match text('[data-e2e=raw-content]') != ''
# Step 9: Switch to Préparer mode and rechunk # Step 9: Switch to Préparer mode and rechunk
* def toggleBtns = locateAll('[data-e2e=toggle-btn]') * waitFor('[data-e2e~=prepare-btn]')
* toggleBtns[karate.sizeOf(toggleBtns) - 1].click() * click('[data-e2e~=prepare-btn]')
* waitFor('[data-e2e=chunk-panel]') * waitFor('[data-e2e=chunk-panel]')
# Expand config if needed # Expand config if needed
@ -66,8 +66,7 @@ Feature: UI — Full happy path via browser
* assert karate.sizeOf(locateAll('[data-e2e=chunk-card]')) > 0 * assert karate.sizeOf(locateAll('[data-e2e=chunk-card]')) > 0
# Step 10: Delete the document via UI # Step 10: Delete the document via UI
* def toggleBtns2 = locateAll('[data-e2e=toggle-btn]') * click('[data-e2e~=configure-btn]')
* toggleBtns2[0].click()
* waitFor('[data-e2e=doc-item]') * waitFor('[data-e2e=doc-item]')
# Hover and delete # Hover and delete

View file

@ -22,7 +22,7 @@
<div class="mode-toggle"> <div class="mode-toggle">
<button <button
class="toggle-btn" class="toggle-btn"
data-e2e="toggle-btn" data-e2e="toggle-btn configure-btn"
:class="{ active: mode === 'configure' }" :class="{ active: mode === 'configure' }"
@click="mode = 'configure'" @click="mode = 'configure'"
> >
@ -37,7 +37,7 @@
</button> </button>
<button <button
class="toggle-btn" class="toggle-btn"
data-e2e="toggle-btn" data-e2e="toggle-btn verify-btn"
:class="{ active: mode === 'verify' }" :class="{ active: mode === 'verify' }"
@click="mode = 'verify'" @click="mode = 'verify'"
:disabled="!analysisStore.currentAnalysis" :disabled="!analysisStore.currentAnalysis"
@ -54,7 +54,7 @@
<button <button
v-if="chunkingEnabled" v-if="chunkingEnabled"
class="toggle-btn" class="toggle-btn"
data-e2e="toggle-btn" data-e2e="toggle-btn prepare-btn"
:class="{ active: mode === 'prepare' }" :class="{ active: mode === 'prepare' }"
@click="mode = 'prepare'" @click="mode = 'prepare'"
:disabled="!analysisStore.currentAnalysis" :disabled="!analysisStore.currentAnalysis"