set system properties manually

System properties were being read from the config file previously, but not set using system.setproperty as they are expected by the selenium package later. This fixes that by setting them before control is handed over to selenium
This commit is contained in:
Sohaib Baig authored and GitHub committed 2025-10-09 10:42:09 +02:00
1 parent 4126e85a47
commit 726e8faeea
1 file changed
+4 -1
@@ -33,6 +33,9 @@ public class SeleniumTestInvocationProvider implements TestTemplateInvocationCon
@Override
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
TestEnvironmentConfiguration config = TestEnvironmentConfiguration.getInstance();
for (Entry<String, String> e : config.getSystemProperties().entrySet()) {
System.setProperty(e.getKey(), e.getValue());
}
return config.getDriverDefinitions().stream().map(driverDef -> {
return new SeleniumTestContext(driverDef);
});
@@ -55,4 +58,4 @@ public class SeleniumTestInvocationProvider implements TestTemplateInvocationCon
return Arrays.asList(new SeleniumTestEnvironmentInjector(driverDefinition));
}
}
}
}