Orchardcore: Cypress Docs

Created on 13 Nov 2020  路  9Comments  路  Source: OrchardCMS/OrchardCore

@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

documentation

All 9 comments

Run once:

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.

Build & Run OC in a console:

cd .\test\Functional\
// Builds the code
npm run cms:build
// Hosts oc in release mode
npm run cms:host

In another console, run cypress UI:

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:build
// Hosts oc in release mode
npm run cms:host

this will build and host the CMS site. Yes

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?

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.

Was this page helpful?
0 / 5 - 0 ratings