General karate framework @ Nextens - NextensArelB/SwaggerGenerationTool GitHub Wiki
Introduction This page explains on Karate framework for both UI and API with examples from the framework that is being used in Nextens.
Main file structure:
API and UI folder share almost the same structure:
Notice the split between Features and Tests. The features should be setup dynamically and reusable to allow a great amount of testcases to put into Tests. Tests folder only executes created features. It is a collection of flows and their configurations. Test cases are giving arguments to the features in the Features folder. If an argument is not given, the feature will resolve to its default data provided by the InputData folder:
Notice the optional Paths folder. We can use such a folder to easily manage paths needed for a feature. For the UI version it is called Locators and is for UI mandatory.
Full structure for API and UI folders:
As an example; a structure for UI tests where we have tests on 'archiving clients' and using the 'search filter':
Locators holds key value combinations where the value is your locator used to identify your html element:
Configuration holds retry configurations and environment specific values like environment urls:
Shared contains default login script and places for json and custom javascript code:
Constants.json contains default strings to be used for either assertions or configurations:
Last we have the rootfolder including karate configs, the jar and powershell scripts for the pipelines:
Full example structure