When using ExperienceFragments, adapting from a Page to an ExperienceFragment or ExperienceFragmentVariation will return null by default. A workaround for this is to register the AdapterFactory manually:
It would be an improvement to have these Services/Factories registered by default.
thanks for the proposal - i'll have a look at it.
the classes ExperienceFragmentsServiceFactoryImpl and ExperienceFragmentsAdapaterFactory your mention are not part of the public AEM API and are not exported by the bundle com.adobe.cq.cq-experience-fragments.
can you come up with a PR with a suitable mock implementation of the adapter factory and the related interfaces ExperienceFragment, ExperienceFragmentVariation, and - if required - ExperienceFragmentsServiceFactory, ExperienceFragmentsService.