filmov
tv
Karate Beginner Tutorials 9 | Config File Demo | karate-config.js

Показать описание
Today we will learn:
How to create
How to use
Multi environment testing
Can be used to
Store global variables
Configure execution environment, base URLs, Timeouts etc
Karate reads this file before executing any scenario
Step 1 - Create a new file in src/test/java
Step 3 - Create JavaScript function and add configuration
The Key Values defined in the JSON object are available to all feature files
function fn() {
var config = {
name : "test123",
}
if(env == 'qa'){
}
else if(env == 'dev'){
}
else{
}
return config;
}
No need to call, it is called by default
Must keep the file under src/test/java
The value for configurations can be passed from
TestRunner
Command Line
TestRunner Example:
@BeforeClass
public static void before() {
}
Command-line Example:
mvn test -Denv=qa
#KarateAPITesting
Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can.
________ ONLINE COURSES TO LEARN ________
------------ UI TESTING ------------
------------ API TESTING ------------
------------ MOBILE TESTING ------------
------------ CI | CD | DEVOPS ------------
-------------VIRTUALISATION-------------
------------ VERSION CONTROL SYSTEM ------------
------------ PERFORMANCE TESTING ------------
------------ PROGRAMMING ------------
------------ IDE ------------
------------ BUILD TOOLS ------------
------------ OTHERS ------------
----------- Connect with Raghav ------------
Never Stop Learning
Raghav
How to create
How to use
Multi environment testing
Can be used to
Store global variables
Configure execution environment, base URLs, Timeouts etc
Karate reads this file before executing any scenario
Step 1 - Create a new file in src/test/java
Step 3 - Create JavaScript function and add configuration
The Key Values defined in the JSON object are available to all feature files
function fn() {
var config = {
name : "test123",
}
if(env == 'qa'){
}
else if(env == 'dev'){
}
else{
}
return config;
}
No need to call, it is called by default
Must keep the file under src/test/java
The value for configurations can be passed from
TestRunner
Command Line
TestRunner Example:
@BeforeClass
public static void before() {
}
Command-line Example:
mvn test -Denv=qa
#KarateAPITesting
Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can.
________ ONLINE COURSES TO LEARN ________
------------ UI TESTING ------------
------------ API TESTING ------------
------------ MOBILE TESTING ------------
------------ CI | CD | DEVOPS ------------
-------------VIRTUALISATION-------------
------------ VERSION CONTROL SYSTEM ------------
------------ PERFORMANCE TESTING ------------
------------ PROGRAMMING ------------
------------ IDE ------------
------------ BUILD TOOLS ------------
------------ OTHERS ------------
----------- Connect with Raghav ------------
Never Stop Learning
Raghav
Комментарии