Test cases should be handled in the same way as source code, and the state-of-the-art method for storing source code is Git. Connect your Git repository to Botium and use it for versioning your test cases. In this article, we describe the recommended Botium structure for test case development.
Local Repository vs Linked Repository
-
Local: Botium comes with an integrated local repository: test case scripts and excel files are stored within the Botium database.
-
Linked: Botium also allows you to connect to linked repositories. Test case scripts and excel files are stored in a remote location linked to the Botium. Currently supported linked repositories are:
-
Git Repositories, for example Bitbucket, Gitlab or Github
-
Shared Folders connected to the Botium server
-
Download Links to retrieve test case content from an external HTTP server or Google Sheets
Tip: You should always keep the test cases in a linked repository (preferred is Git), as the local repository doesn't have many options for making backups, versioning etc. We will follow best practices from software development:-
There is a development environment which will be used for developing the test cases
-
There is a production environment which will be used for running the finished and approved test cases
-
Snapshots of the test cases will be transferred from development to production environment on certain events (end of sprint, before go-live, …)
-
-
Preparing the Test Case Development Process
-
You are using the Live Chat, the Botium Crawler or the Convo Editor for composing your test cases
-
There is a Git repository for holding the test cases
-
First Test Set | Development: This test set is intended for development:
-
Create Test Set: Create a test set and ensure you select
'Use Test Cases from Botium only' in the Content
Selection Type within the Test Set Configuration.
-
Connect your Git Repository: Navigate to
Botium Tools & Settings > Test Sets > Your Test Set > Configuration > External Connections > NEW
, and connect your Git repository.Note: You should point to your Git main branch here. Later you can choose to not directly commit your test case scripts to the master branch but to separate feature branches. - Create Project: Create a new Test Project that points to your Development Chatbot and this Development Test Set with Botium Repository Test Set.
-
Create Test Set: Create a test set and ensure you select
'Use Test Cases from Botium only' in the Content
Selection Type within the Test Set Configuration.
-
Second Test Set | Ready2Test :
-
Create Test Set: Create a second test set, and this time
ensure you select 'Use Test Cases from External Connections
only' in the Content Selection Type within the Test Set
Configuration.
-
Connect your Git Repository: Again, navigate to
Botium Tools & Settings > Test Sets > Your Test Set > Configuration > External Connections > NEW
, and connect your Git repository. - Create Project: Create a new Test Project that points to your Development Chatbot and this Ready2Test Test Set.
-
Create Test Set: Create a second test set, and this time
ensure you select 'Use Test Cases from External Connections
only' in the Content Selection Type within the Test Set
Configuration.
Implementing the Test Case Development Process
As usual, this development process is running in cycles - you can and should repeat it as often as required.
-
Working on Test Cases: In the Development test set, you can use all Botium tools to create and edit your test cases, you can even combine all of them.
-
Use the Convo Editor or the Script Editor to manually compose your test cases step by step
-
Use the Live Chat to record your conversations with your chatbot and save it as test case
-
Use the Botium Crawler to automatically detect your conversation branches
Tip: Using Botium Excel Sheets for setting up this process is not suggested, as Git features like version tracking and pull requests work best on plain text files. -
-
Verifying Test Cases: You can use the Development test project to run test sessions against your development chatbot to verify that the test set itself is complete and working. As you selected 'Use Local Repository only' above for this test set, only the local repository with your own test set will be used for the test session, not the test cases in the linked Git repository.As soon as you consider your test set to be complete, it is time to publish it to Git.Note: You can consider the Development test set as the sandbox where the unpublished test case scripts are placed, before they are committed to Git and published to other project members.
-
Export Snapshot to Git Repository: Use the Export function and select 'to Git Repository' to export a snapshot of your test set to the Git repository now.
Navigate to
Botium Tools & Settings > Test Sets > Your Tests Set > Test Cases > Export > to Git Repository
The Git check-in screen will look familiar to software developers:-
You can choose a branch to commit your test cases to (and your Git credentials if required)
-
There should be a check-in comment describing the changes you have done
Tip: We recommend avoiding direct pushes to the main branch. Instead, push to a feature or development branch and follow the established Git workflows of Pull Request, Review, and Merge to integrate test cases into the main branchWarning: The test case scripts will be exported to the Git repository as files, overwriting any existing test case scripts. -
Setup Continuous Testing Pipeline
You are now ready to use this test set in your Continuous Testing pipeline. Botium will automatically pull all test case changes from Git during each test execution.