Skip to content

IntegrationTests

Matus Backor edited this page Nov 25, 2019 · 5 revisions

Kentico Kontent Docs - Integration tests

Overview

The integration tests have been written to verify that the Kentico Kontent documentation portal and its integrations with other services such as Kentico Kontent, Algolia or GitHub work correctly.

Specification

Triggers

The tests can be run locally by running yarn test in the console. To ensure the correctness of the whole system automatically, the tests are run once a day as a CRON job on the Travis CI service. If the tests fail, developers are notified through a Teams channel.

How it works

The integration tests are designed to test various scenarios that can occur when content developers work with the Kentico Kontent documentation portal. The test suite consists of tests testing one simple scenario and tests that include complex use cases.

The test environment uses its own Kentico Kontent project, development instances of the Azure function services and a separate index on Algolia. Before the tests are run, a clean environment is prepared: all leftover content items, content types, and taxonomies are deleted from the Kentico Kontent test project and afterwards, content types and taxonomies are copied from the live Kentico Kontent project. This ensures that the tests are run against the most recent version of the content types and taxonomies.

The Kentico Kontent Docs test website used in the integration tests needs several content items to be published in Kentico Kontent to display the content correctly. The required items by the web are:

  • author
  • footer
  • topic
  • scenario
  • navigation_item
  • home
  • ui_messages

The simple tests follow similar scenario:

  1. Upsert a content item to Kentico Kontent.
  2. Upsert a content language variant with specific content and insert it into parent item (topic/navigation item).
  3. Publish every related item.
  4. Check the specific content in Algolia's index through Algolia's API.
  5. Using Selenium type specific content into search input on the test version of the Kentico Kontent documentation website and click on the search result.
  6. Check the search suggestion text, the current URL, content on the page and the heading of the article.

The more advanced tests differ in the more complex workflow scenario in Kentico Kontent, e.g.:

  1. An article content item is created with some content and published - some tests utilize the Publisher service by setting the item to cascade publish or scheduled to publish workflow step; afterwards, the Publisher service is triggered to run the service immediately.
  2. The content is checked on Algolia and website.
  3. The article is unpublished in Kentico Kontent and checked if it has been deleted also from Algolia and can't be searched on the website.
  4. The content of the article is then updated and again published.
  5. The updated content is searched on Algolia and the website.
Clone this wiki locally