Add a feature to allow the user to manage tenants, integrating UI testing into Orchard Core - This week in Orchard (18/11/2022)

Gábor Domonkos's avatar
Admin UI, Multi-tenancy, Announcement, This week in Orchard

Let's continue checking out the newest features and editions of the 1.5.0 release of Orchard Core and see a demo about integrating UI testing into Orchard Core! Oh, and did you know that Orchard Core was presented at this year's .NET Conf too?

Orchard Core updates

Add a feature to allow the user to manage tenants

Let's say you have an Orchard Core site set up with the Software as a Service recipe. This recipe allows you to easily create multiple tenants by enabling the necessary features.

The new Features button on the tenant's list

Here you can see that we have already created two additional tenants called Agency and Blog. We still need to set up the Agency one, but the Blog tenant is ready to go. And here you may notice a new button near the Blog tenant, called Features.

By clicking on this button, you will be redirected to a page that allows you to manage the feature of the tenant called Blog.

So, if you have a SaaS environment now, you can manage the tenant's features from the host by allowing to accept {tenant?} in the route. This tenant value is only evaluated if the request is running on the host. When a tenant value is present, we'll execute the code in the scope of the given tenant.

Manage tenant features from the host

SqlParser & SqlGrammar subquery support

The issue was that the SQL parser did not allow subqueries in the FROM clause. Try to run the following SQL Query, which can be done via Search -> Queries -> Run SQL Query on the admin page of Orchard Core.

   SELECT Id FROM Document
) AS Temp

The query should run, but instead of that, you encountered an error: Syntax error, expected: id_simple at line:0, col:15.

And this has been fixed in Orchard Core 1.5. So, if you run the query with the latest release, you will see that the query was executed successfully.

SqlParser and SqlGrammar subquery support

Update YesSql to 3.2.0

A new version of YesSql comes with the latest release of Orchard Core. YesSql now has version number 3.2.0, which provides several improvements and fixes since the latest version shipped with Orchard Core 1.4. Don't forget to take a look at the changes!

YesSql 3.2.0


Integrating UI testing into Orchard Core

We would like to show some updates related to integrating UI testing into Orchard Core. This was not the first time, we already talked about this a while ago in this post. And now it's taking shape, so we would like to have some feedback and finish it up together!

In this demo, we will talk about this pull request which introduces UI testing to Orchard Core in .NET with Selenium with our library called UI Testing Toolbox. There's already UI testing in Orchard Core with Cypress, this is a bit different, these are not written in JavaScript but in .NET. They use other underlying libraries for browser automation and what will be tested here is a little bit different as well.

We implemented everything that was in Cypress before, and there's a lot more now. If you are interested in the progress, you can find it in the PR as well.

Integrating UI testing remaining tasks

Now let's see the current progress of the integration! There's a new folder in the Orchard Core solution called OrchardCore.Tests.UI and also an OrchardCore.Tests.UI.Mvc. The Mvc one is just testing an MVC launch, there is no CMS functionality or anything like that and the Tests.UI tests the whole of the Orchard Core feature set.

The main goal was to have some decent coverage. So, we are not waiting for an hour to wait for all the UI tests to finish but still, we can be fairly confident that if these pass, then we haven't messed up anything too badly.

For example, we have tests for all the built-in recipes (AgencyRecipeTests.cs, BlogRecipeTests.cs, HeadlessRecipeTests.cs, etc.). The most complete one is under the BlogRecipeTests, which runs the whole setup and checks out the basic features of Orchard Core, like login, logout, registration, basic content operations, turning features on and off, etc.

Testing the Blog recipe

If you are interested in how to run these tests or what these tests actually do in action, check out this recording on YouTube!

News from the community

Orchard Core at .NET Conf 2022

.NET Conf is the biggest .NET virtual event and this year we were celebrating the release of .NET 7. And there was a talk called Build websites with a modern ASP.NET Core CMS – Orchard Core by Zoltán Lehóczky from Lombiq Technologies. In this session, we'll do a quick dive into working with the modern ASP.NET Core framework and web content management system (CMS) Orchard Core. We'll see what Orchard can provide you, how it goes beyond simple content management, and why you'd want to join such a cutting-edge open-source community. You can check out the recording of this session on YouTube!

Orchard Harvest 2023

For those who are too young to remember, we had Orchard conferences, called Orchard Harvest. And the conference website was available under, but unfortunately, it's not anymore. The last one was in 2017 in New York. So, having another get-together is very much overdue. If you would like to see or get a feeling of how this looked like before, we have a couple of mood videos on the Orchard YouTube channel, like this one from the first conference.

The point is that we should really think about organizing the next one, and we at Lombiq can take part in that or provide an organizing role with anybody who wants to take part. If you have any feedback or you are looking forward to having a Harvest again, please share your opinion with us by filling out this survey about the upcoming Orchard Harvest!

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 381 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.

Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

No Comments

Add a Comment