According to the documentation (https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/junit/jupiter/EnabledIf.html#expression--) you
Try that with an extra apostrophe to wrap property when used in SpEL:
@EnabledIf(value = "#{'${spring.profiles.active}' == 'test'}", loadContext = true)
I worked for me (finally!) when I tried to use custom property