Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.49 KB

readme.md

File metadata and controls

39 lines (27 loc) · 1.49 KB

Test Examples for Umbraco implementors

Schema

You'll want a schema for most of your tests.
There are several options:

  • Using Builders
    • Most of the tests in this repo has setup methods using builders
  • Importing uSync files
    • [TODO] Import your website usync files in one go

See the Creating_Content test for an example.

Services

Most of the Umbraco services work out of the box with UmbracoIntegrationTest.
All tests in this example repo use a database with schema per fixture.

SurfaceControllers

A lot of Umbraco implementations utilize SurfaceController to process form posts.
Very often they interact with the "current page".
The setup and extensions used in the CTA_Form example is all you need to set up a "current page". When that's done, you can use CurrentPage, RedirectToCurrentPage etc.

Data editors

You'll want to test your editors with JSON from your client code.
The best way to fully test an editor is to inherit UmbracoTestServerTestBase.
See the DataEditor_Via_Hosted_Controller tests for an example.

Rendering

Rendering is the slowest integration test you can do, but works "OOTB" with UmbracoTestServerTestBase.
See the Rendring_Page_Via_Hosted_Url tests for an example.