@jptissot could we have a starter docs for how to functional test OC using Cypress, I'm impressed by your demo on last standup, but seems I miss something to make the tests run
cd .\test\Functional\
npm install
npm run cms:setup // careful... this will delete your App_Data
The tests assume you the root tenant is setup as a SaaS tenant, the cms:setup command sets this up for you.
cd .\test\Functional\
// Builds the code
npm run cms:build
// Hosts oc in release mode
npm run cms:host
cd .\test\Functional\
npm run cms:cypress
Then, you can run the unit tests as much as you want.
Is this required OC instance up & running?
npm run cms:setup will delete your OrchardCore.Cms.Web/App_Data folder and set a default tenant to be the SaaS tenant.
Wow!! finally it works .. thanks a lot Jean Phillipe, I will keep this open for documentation, if you want to start this or I will do it in your behalf
@agriffard where shall we add this?
I had this issue opened: https://github.com/OrchardCMS/OrchardCore/issues/7534
So closing this ;)
@jptissot
this will delete your App_Data
Is it possible to run the app in another working directory? So that a new App_Data is created elsewhere
As we do when running our web app through some unit tests
Yes that should be easy, all the testing framework needs is a running app. Nothing more.