OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.41k forks source link

OrchardCore Testing #11865

Open MichaelPetrinolis opened 2 years ago

MichaelPetrinolis commented 2 years ago

Is your feature request related to a problem? Please describe.

When developing an Orchard Core module/app it would be nice to have a Testing Library to get you started with unit and integration testing in OrchardCore terms

Describe the solution you'd like

Create an OrchardCore.Testing library by extracting reusable code from OrchardCore.Tests

rjpowers10 commented 2 years ago

I haven't used it myself but you may be interested in https://github.com/Lombiq/UI-Testing-Toolbox

MichaelPetrinolis commented 2 years ago

Thanx @rjpowers10 , my point here is to reuse the objects in OrchardCore.Tests and provide a Testing library specific for OrchardCore, so devs can use the same logic - as in OrchardCore source - to test their own modules.

hishamco commented 2 years ago

@MichaelPetrinolis believe it or no I was planned to working on something similar because I'm interesting in Software Testing, It's great to see your input

I need to look into your PR soon, If you need help on this I can handle it or at least contribute as much as I can

MichaelPetrinolis commented 2 years ago

@hishamco thanx! Looking forward for your feedback/suggestions.

hishamco commented 2 years ago

Hi @MichaelPetrinolis I'm thinking to organize the testing projects as the following:

BTW we already have a unit tests and some functional tests, I need to dig into Cypress to check if these tests are functional or user acceptance tests or UI

For UI tests we already have a test suite from Lombiq that can fit nicely here

Our current tests need to be organized in terms of namespaces and group them accoding to the source:

I can work hard in this are if the team agree, the PR that @MichaelPetrinolis is created is a very good start to refactor and move the common thing into a place, so they can be reusable

Also we need a set of built-in testing APIs infrastructure, that simplify testsing APIs & modules, instead of repeating the code or do everything from scratch