+
{{ form_widget(option, {
attr: {
'data-controller': 'condition',
diff --git a/tests/e2e/pages/regulation_order.page.js b/tests/e2e/pages/regulation_order.page.js
index 1adc98a1b..a1ff599c0 100644
--- a/tests/e2e/pages/regulation_order.page.js
+++ b/tests/e2e/pages/regulation_order.page.js
@@ -62,7 +62,7 @@ export class RegulationOrderPage {
await this.page.getByLabel('Voie ou ville').fill(address);
await this.page.getByLabel('Type de restriction').selectOption({ label: restrictionType });
- await this.page.getByText('Tous les véhicules', { exact: true }).check({ force: true });
+ await this.page.getByTestId('allVehicles-0-yes').click();
await this.saveBtn.click();
this.addedLocationTitles.push(expectedTitle);
return this.getLocationByTitle(expectedTitle);
@@ -96,7 +96,7 @@ export class RegulationOrderPage {
const restrictionTypeField = measure.getByRole('combobox', { name: 'Type de restriction' });
expect(await restrictionTypeField.getAttribute('name')).toBe(`location_form[measures][${expectedIndex}][type]`);
await restrictionTypeField.selectOption({ label: restrictionType });
- await measure.getByText('Tous les véhicules', { exact: true }).check();
+ await this.page.getByTestId(`allVehicles-${expectedIndex}-yes`).click();
// Advanced vehicles options are not shown
await expect(measure.getByLabel('Types de véhicules concernés', { exact: true })).not.toBeVisible(); // Restricted
@@ -149,7 +149,7 @@ export class RegulationOrderPage {
// Define restricted vehicles
const restrictedVehiclesFieldset = measure.getByRole('radiogroup', { name: 'Véhicules concernés' });
- await restrictedVehiclesFieldset.getByText('Certains véhicules', { exact: true }).click();
+ await restrictedVehiclesFieldset.getByTestId(`allVehicles-${measureIndex}-no`).click();
for (const vehicleType of restrictedVehicleTypes) {
await restrictedVehiclesFieldset.getByLabel('Types de véhicules concernés').getByLabel(vehicleType, { exact: true }).click();
}