mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
ci(postman): add users collection (#4897)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -7021,6 +7021,7 @@ dependencies = [
|
|||||||
name = "test_utils"
|
name = "test_utils"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.0",
|
"base64 0.22.0",
|
||||||
"clap",
|
"clap",
|
||||||
|
|||||||
@ -14,6 +14,7 @@ payouts = []
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-trait = "0.1.79"
|
async-trait = "0.1.79"
|
||||||
|
anyhow = "1.0.81"
|
||||||
base64 = "0.22.0"
|
base64 = "0.22.0"
|
||||||
clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] }
|
clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
|
|||||||
@ -76,6 +76,7 @@ pub struct ConnectorAuthentication {
|
|||||||
pub zen: Option<HeaderKey>,
|
pub zen: Option<HeaderKey>,
|
||||||
pub zsl: Option<BodyKey>,
|
pub zsl: Option<BodyKey>,
|
||||||
pub automation_configs: Option<AutomationConfigs>,
|
pub automation_configs: Option<AutomationConfigs>,
|
||||||
|
pub users: Option<UsersConfigs>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ConnectorAuthentication {
|
impl Default for ConnectorAuthentication {
|
||||||
@ -339,3 +340,12 @@ pub enum ConnectorAuthType {
|
|||||||
#[default]
|
#[default]
|
||||||
NoKey,
|
NoKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
pub struct UsersConfigs {
|
||||||
|
pub user_email: String,
|
||||||
|
pub user_password: String,
|
||||||
|
pub wrong_password: String,
|
||||||
|
pub user_base_email_for_signup: String,
|
||||||
|
pub user_domain_for_signup: String,
|
||||||
|
}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
use std::process::{exit, Command};
|
use std::process::{exit, Command};
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use test_utils::newman_runner;
|
use test_utils::newman_runner;
|
||||||
|
|
||||||
fn main() {
|
fn main() -> Result<()> {
|
||||||
let mut runner = newman_runner::generate_newman_command();
|
let mut runner = newman_runner::generate_runner()?;
|
||||||
|
|
||||||
// Execute the newman command
|
// Execute the newman command
|
||||||
let output = runner.newman_command.spawn();
|
let output = runner.newman_command.spawn();
|
||||||
|
|||||||
@ -6,14 +6,23 @@ use std::{
|
|||||||
process::{exit, Command},
|
process::{exit, Command},
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::{arg, command, Parser};
|
use anyhow::{Context, Result};
|
||||||
|
use clap::{arg, command, Parser, ValueEnum};
|
||||||
use masking::PeekInterface;
|
use masking::PeekInterface;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
use crate::connector_auth::{ConnectorAuthType, ConnectorAuthenticationMap};
|
use crate::connector_auth::{
|
||||||
|
ConnectorAuthType, ConnectorAuthentication, ConnectorAuthenticationMap,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(ValueEnum, Clone, Copy)]
|
||||||
|
pub enum Module {
|
||||||
|
Connector,
|
||||||
|
Users,
|
||||||
|
}
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(version, about = "Postman collection runner using newman!", long_about = None)]
|
#[command(version, about = "Postman collection runner using newman!", long_about = None)]
|
||||||
struct Args {
|
pub struct Args {
|
||||||
/// Admin API Key of the environment
|
/// Admin API Key of the environment
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
admin_api_key: String,
|
admin_api_key: String,
|
||||||
@ -22,7 +31,10 @@ struct Args {
|
|||||||
base_url: String,
|
base_url: String,
|
||||||
/// Name of the connector
|
/// Name of the connector
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
connector_name: String,
|
connector_name: Option<String>,
|
||||||
|
/// Name of the module
|
||||||
|
#[arg(short, long)]
|
||||||
|
module_name: Option<Module>,
|
||||||
/// Custom headers
|
/// Custom headers
|
||||||
#[arg(short = 'H', long = "header")]
|
#[arg(short = 'H', long = "header")]
|
||||||
custom_headers: Option<Vec<String>>,
|
custom_headers: Option<Vec<String>>,
|
||||||
@ -38,6 +50,13 @@ struct Args {
|
|||||||
verbose: bool,
|
verbose: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Args {
|
||||||
|
/// Getter for the `module_name` field
|
||||||
|
pub fn get_module_name(&self) -> Option<Module> {
|
||||||
|
self.module_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct ReturnArgs {
|
pub struct ReturnArgs {
|
||||||
pub newman_command: Command,
|
pub newman_command: Command,
|
||||||
pub modified_file_paths: Vec<Option<String>>,
|
pub modified_file_paths: Vec<Option<String>>,
|
||||||
@ -82,10 +101,93 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generate_newman_command() -> ReturnArgs {
|
// This function gives runner for connector or a module
|
||||||
|
pub fn generate_runner() -> Result<ReturnArgs> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let connector_name = args.connector_name;
|
match args.get_module_name() {
|
||||||
|
Some(Module::Users) => generate_newman_command_for_users(),
|
||||||
|
Some(Module::Connector) => generate_newman_command_for_connector(),
|
||||||
|
// Running connector tests when no module is passed to keep the previous test behavior same
|
||||||
|
None => generate_newman_command_for_connector(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_newman_command_for_users() -> Result<ReturnArgs> {
|
||||||
|
let args = Args::parse();
|
||||||
|
let base_url = args.base_url;
|
||||||
|
let admin_api_key = args.admin_api_key;
|
||||||
|
|
||||||
|
let path = env::var("CONNECTOR_AUTH_FILE_PATH")
|
||||||
|
.with_context(|| "connector authentication file path not set")?;
|
||||||
|
|
||||||
|
let authentication: ConnectorAuthentication = toml::from_str(
|
||||||
|
&fs::read_to_string(path)
|
||||||
|
.with_context(|| "connector authentication config file not found")?,
|
||||||
|
)
|
||||||
|
.with_context(|| "connector authentication file path not set")?;
|
||||||
|
|
||||||
|
let users_configs = authentication
|
||||||
|
.users
|
||||||
|
.with_context(|| "user configs not found in authentication file")?;
|
||||||
|
let collection_path = get_collection_path("users");
|
||||||
|
|
||||||
|
let mut newman_command = Command::new("newman");
|
||||||
|
newman_command.args(["run", &collection_path]);
|
||||||
|
newman_command.args(["--env-var", &format!("admin_api_key={admin_api_key}")]);
|
||||||
|
newman_command.args(["--env-var", &format!("baseUrl={base_url}")]);
|
||||||
|
newman_command.args([
|
||||||
|
"--env-var",
|
||||||
|
&format!("user_email={}", users_configs.user_email),
|
||||||
|
]);
|
||||||
|
newman_command.args([
|
||||||
|
"--env-var",
|
||||||
|
&format!(
|
||||||
|
"user_base_email_for_signup={}",
|
||||||
|
users_configs.user_base_email_for_signup
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
newman_command.args([
|
||||||
|
"--env-var",
|
||||||
|
&format!(
|
||||||
|
"user_domain_for_signup={}",
|
||||||
|
users_configs.user_domain_for_signup
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
newman_command.args([
|
||||||
|
"--env-var",
|
||||||
|
&format!("user_password={}", users_configs.user_password),
|
||||||
|
]);
|
||||||
|
newman_command.args([
|
||||||
|
"--env-var",
|
||||||
|
&format!("wrong_password={}", users_configs.wrong_password),
|
||||||
|
]);
|
||||||
|
|
||||||
|
newman_command.args([
|
||||||
|
"--delay-request",
|
||||||
|
format!("{}", &args.delay_request).as_str(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
newman_command.arg("--color").arg("on");
|
||||||
|
|
||||||
|
if args.verbose {
|
||||||
|
newman_command.arg("--verbose");
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(ReturnArgs {
|
||||||
|
newman_command,
|
||||||
|
modified_file_paths: vec![],
|
||||||
|
collection_path,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_newman_command_for_connector() -> Result<ReturnArgs> {
|
||||||
|
let args = Args::parse();
|
||||||
|
|
||||||
|
let connector_name = args
|
||||||
|
.connector_name
|
||||||
|
.with_context(|| "invalid parameters: connector/module name not found in arguments")?;
|
||||||
|
|
||||||
let base_url = args.base_url;
|
let base_url = args.base_url;
|
||||||
let admin_api_key = args.admin_api_key;
|
let admin_api_key = args.admin_api_key;
|
||||||
|
|
||||||
@ -216,11 +318,11 @@ pub fn generate_newman_command() -> ReturnArgs {
|
|||||||
newman_command.arg("--verbose");
|
newman_command.arg("--verbose");
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnArgs {
|
Ok(ReturnArgs {
|
||||||
newman_command,
|
newman_command,
|
||||||
modified_file_paths: vec![modified_collection_file_paths, custom_header_exist],
|
modified_file_paths: vec![modified_collection_file_paths, custom_header_exist],
|
||||||
collection_path,
|
collection_path,
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_for_custom_headers(headers: Option<Vec<String>>, path: &str) -> Option<String> {
|
pub fn check_for_custom_headers(headers: Option<Vec<String>>, path: &str) -> Option<String> {
|
||||||
|
|||||||
6
postman/collection-dir/users/.event.meta.json
Normal file
6
postman/collection-dir/users/.event.meta.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.prerequest.js",
|
||||||
|
"event.test.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
9
postman/collection-dir/users/.info.json
Normal file
9
postman/collection-dir/users/.info.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "b5b40c9a-7e58-42c7-8b89-0adb208c45c9",
|
||||||
|
"name": "users",
|
||||||
|
"description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [support@juspay.in](mailto:support@juspay.in)",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||||
|
"_exporter_id": "26710321"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
postman/collection-dir/users/.meta.json
Normal file
6
postman/collection-dir/users/.meta.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"childrenOrder": [
|
||||||
|
"Health check",
|
||||||
|
"Flow Testcases"
|
||||||
|
]
|
||||||
|
}
|
||||||
126
postman/collection-dir/users/.variable.json
Normal file
126
postman/collection-dir/users/.variable.json
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
{
|
||||||
|
"variable": [
|
||||||
|
{
|
||||||
|
"key": "baseUrl",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "admin_api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "merchant_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "customer_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "mandate_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_method_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "refund_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "merchant_connector_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "client_secret",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "publishable_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "api_key_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_token",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "gateway_merchant_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "certificate",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "certificate_keys",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_api_secret",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_key1",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_key2",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_email",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_password",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "wrong_password",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_base_email_for_signup",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_domain_for_signup",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
6
postman/collection-dir/users/Flow Testcases/.meta.json
Normal file
6
postman/collection-dir/users/Flow Testcases/.meta.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"childrenOrder": [
|
||||||
|
"Sign Up",
|
||||||
|
"Sign In"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"childrenOrder": [
|
||||||
|
"Signin",
|
||||||
|
"Signin Wrong",
|
||||||
|
"Signin Token Only",
|
||||||
|
"Signin Token Only Wrong"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
// Validate status 4xx
|
||||||
|
pm.test("[POST]::/user/v2/signin?token_only=true - Status code is 401", function () {
|
||||||
|
pm.response.to.have.status(401);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response header has matching content-type
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Content-Type is application/json", function () {
|
||||||
|
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||||
|
"application/json",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response has JSON Body
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Response has JSON Body", function () {
|
||||||
|
pm.response.to.have.jsonBody();
|
||||||
|
});
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw_json_formatted": {
|
||||||
|
"email": "{{user_email}}",
|
||||||
|
"password": "{{wrong_password}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin?token_only=true",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "token_only",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
// Validate status 2xx
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Status code is 2xx", function () {
|
||||||
|
pm.response.to.be.success;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response header has matching content-type
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Content-Type is application/json", function () {
|
||||||
|
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||||
|
"application/json",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response has JSON Body
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Response has JSON Body", function () {
|
||||||
|
pm.response.to.have.jsonBody();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate specific JSON response content
|
||||||
|
pm.test("[POST]::user/v2/signin?token_only=true - Response contains token", function () {
|
||||||
|
var jsonData = pm.response.json();
|
||||||
|
pm.expect(jsonData).to.have.property("token");
|
||||||
|
pm.expect(jsonData.token).to.be.a("string").and.to.not.be.empty;
|
||||||
|
});
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw_json_formatted": {
|
||||||
|
"email": "{{user_email}}",
|
||||||
|
"password": "{{user_password}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin?token_only=true",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "token_only",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
// Validate status code is 4xx Bad Request
|
||||||
|
pm.test("[POST]::/user/v2/signin - Status code is 401", function () {
|
||||||
|
pm.response.to.have.status(401);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response header has matching content-type
|
||||||
|
pm.test("[POST]::/user/v2/signin - Content-Type is application/json", function () {
|
||||||
|
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||||
|
"application/json",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response has JSON Body
|
||||||
|
pm.test("[POST]::/user/v2/signin - Response has JSON Body", function () {
|
||||||
|
pm.response.to.have.jsonBody();
|
||||||
|
});
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw_json_formatted": {
|
||||||
|
"email": "{{user_email}}",
|
||||||
|
"password": "{{wrong_password}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js",
|
||||||
|
"event.prerequest.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
// Validate status 2xx
|
||||||
|
pm.test("[POST]::/user/v2/signin - Status code is 2xx", function () {
|
||||||
|
pm.response.to.be.success;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response header has matching content-type
|
||||||
|
pm.test("[POST]::/user/v2/signin - Content-Type is application/json", function () {
|
||||||
|
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||||
|
"application/json",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response has JSON Body
|
||||||
|
pm.test("[POST]::/user/v2/signin - Response has JSON Body", function () {
|
||||||
|
pm.response.to.have.jsonBody();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate specific JSON response content
|
||||||
|
pm.test("[POST]::/user/v2/signin - Response contains token", function () {
|
||||||
|
var jsonData = pm.response.json();
|
||||||
|
pm.expect(jsonData).to.have.property("token");
|
||||||
|
pm.expect(jsonData.token).to.be.a("string").and.to.not.be.empty;
|
||||||
|
});
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw_json_formatted": {
|
||||||
|
"email": "{{user_email}}",
|
||||||
|
"password": "{{user_password}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"childrenOrder": [
|
||||||
|
"Connect Account"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js",
|
||||||
|
"event.prerequest.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
var baseEmail = pm.environment.get('user_base_email_for_signup');
|
||||||
|
var emailDomain = pm.environment.get("user_domain_for_signup");
|
||||||
|
|
||||||
|
// Generate a unique email address
|
||||||
|
var uniqueEmail = baseEmail + new Date().getTime() + emailDomain;
|
||||||
|
// Set the unique email address as an environment variable
|
||||||
|
pm.environment.set('unique_email', uniqueEmail);
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
// Validate status 2xx
|
||||||
|
pm.test("[POST]::/user/connect_account - Status code is 2xx", function () {
|
||||||
|
pm.response.to.be.success;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response header has matching content-type
|
||||||
|
pm.test("[POST]::/user/connect_account - Content-Type is application/json", function () {
|
||||||
|
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||||
|
"application/json",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate if response has JSON Body
|
||||||
|
pm.test("[POST]::/user/connect_account - Response has JSON Body", function () {
|
||||||
|
pm.response.to.have.jsonBody();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Validate specific JSON response content
|
||||||
|
pm.test("[POST]::/user/connect_account - Response contains is_email_sent", function () {
|
||||||
|
var jsonData = pm.response.json();
|
||||||
|
pm.expect(jsonData).to.have.property("is_email_sent");
|
||||||
|
pm.expect(jsonData.is_email_sent).to.be.true;
|
||||||
|
});
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw_json_formatted": {
|
||||||
|
"email": "{{unique_email}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/connect_account",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"connect_account"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
5
postman/collection-dir/users/Health check/.meta.json
Normal file
5
postman/collection-dir/users/Health check/.meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"childrenOrder": [
|
||||||
|
"New Request"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"eventOrder": [
|
||||||
|
"event.test.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
// Validate status 2xx
|
||||||
|
pm.test("[POST]::/health - Status code is 2xx", function () {
|
||||||
|
pm.response.to.be.success;
|
||||||
|
});
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/health",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"health"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
0
postman/collection-dir/users/event.prerequest.js
Normal file
0
postman/collection-dir/users/event.prerequest.js
Normal file
0
postman/collection-dir/users/event.test.js
Normal file
0
postman/collection-dir/users/event.test.js
Normal file
556
postman/collection-json/users.postman_collection.json
Normal file
556
postman/collection-json/users.postman_collection.json
Normal file
@ -0,0 +1,556 @@
|
|||||||
|
{
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Health check",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "New Request",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status 2xx",
|
||||||
|
"pm.test(\"[POST]::/health - Status code is 2xx\", function () {",
|
||||||
|
" pm.response.to.be.success;",
|
||||||
|
"});",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/health",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"health"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Flow Testcases",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Sign Up",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Connect Account",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status 2xx",
|
||||||
|
"pm.test(\"[POST]::/user/connect_account - Status code is 2xx\", function () {",
|
||||||
|
" pm.response.to.be.success;",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response header has matching content-type",
|
||||||
|
"pm.test(\"[POST]::/user/connect_account - Content-Type is application/json\", function () {",
|
||||||
|
" pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
|
||||||
|
" \"application/json\",",
|
||||||
|
" );",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response has JSON Body",
|
||||||
|
"pm.test(\"[POST]::/user/connect_account - Response has JSON Body\", function () {",
|
||||||
|
" pm.response.to.have.jsonBody();",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate specific JSON response content",
|
||||||
|
"pm.test(\"[POST]::/user/connect_account - Response contains is_email_sent\", function () {",
|
||||||
|
" var jsonData = pm.response.json();",
|
||||||
|
" pm.expect(jsonData).to.have.property(\"is_email_sent\");",
|
||||||
|
" pm.expect(jsonData.is_email_sent).to.be.true;",
|
||||||
|
"});",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"",
|
||||||
|
"var baseEmail = pm.environment.get('user_base_email_for_signup');",
|
||||||
|
"var emailDomain = pm.environment.get(\"user_domain_for_signup\");",
|
||||||
|
"",
|
||||||
|
"// Generate a unique email address",
|
||||||
|
"var uniqueEmail = baseEmail + new Date().getTime() + emailDomain;",
|
||||||
|
"// Set the unique email address as an environment variable",
|
||||||
|
"pm.environment.set('unique_email', uniqueEmail);",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"email\":\"{{unique_email}}\"}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/connect_account",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"connect_account"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sign In",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Signin",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status 2xx",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Status code is 2xx\", function () {",
|
||||||
|
" pm.response.to.be.success;",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response header has matching content-type",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
|
||||||
|
" pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
|
||||||
|
" \"application/json\",",
|
||||||
|
" );",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response has JSON Body",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
|
||||||
|
" pm.response.to.have.jsonBody();",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate specific JSON response content",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Response contains token\", function () {",
|
||||||
|
" var jsonData = pm.response.json();",
|
||||||
|
" pm.expect(jsonData).to.have.property(\"token\");",
|
||||||
|
" pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{user_password}}\"}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Signin Wrong",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status code is 4xx Bad Request",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Status code is 401\", function () {",
|
||||||
|
" pm.response.to.have.status(401);",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response header has matching content-type",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
|
||||||
|
" pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
|
||||||
|
" \"application/json\",",
|
||||||
|
" );",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response has JSON Body",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
|
||||||
|
" pm.response.to.have.jsonBody();",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{wrong_password}}\"}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Signin Token Only",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status 2xx",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Status code is 2xx\", function () {",
|
||||||
|
" pm.response.to.be.success;",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response header has matching content-type",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
|
||||||
|
" pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
|
||||||
|
" \"application/json\",",
|
||||||
|
" );",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response has JSON Body",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
|
||||||
|
" pm.response.to.have.jsonBody();",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate specific JSON response content",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Response contains token\", function () {",
|
||||||
|
" var jsonData = pm.response.json();",
|
||||||
|
" pm.expect(jsonData).to.have.property(\"token\");",
|
||||||
|
" pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{user_password}}\"}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin?token_only=true",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "token_only",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Signin Token Only Wrong",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Validate status 4xx",
|
||||||
|
"pm.test(\"[POST]::/user/v2/signin?token_only=true - Status code is 401\", function () {",
|
||||||
|
" pm.response.to.have.status(401);",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response header has matching content-type",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
|
||||||
|
" pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
|
||||||
|
" \"application/json\",",
|
||||||
|
" );",
|
||||||
|
"});",
|
||||||
|
"",
|
||||||
|
"// Validate if response has JSON Body",
|
||||||
|
"pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
|
||||||
|
" pm.response.to.have.jsonBody();",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cookie",
|
||||||
|
"value": "Cookie_1=value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{wrong_password}}\"}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{baseUrl}}/user/v2/signin?token_only=true",
|
||||||
|
"host": [
|
||||||
|
"{{baseUrl}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"v2",
|
||||||
|
"signin"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "token_only",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "b5b40c9a-7e58-42c7-8b89-0adb208c45c9",
|
||||||
|
"name": "users",
|
||||||
|
"description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [support@juspay.in](mailto:support@juspay.in)",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||||
|
"_exporter_id": "26710321"
|
||||||
|
},
|
||||||
|
"variable": [
|
||||||
|
{
|
||||||
|
"key": "baseUrl",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "admin_api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "merchant_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "customer_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "mandate_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_method_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "refund_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "merchant_connector_id",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "client_secret",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_api_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "publishable_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "api_key_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "payment_token",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "gateway_merchant_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "certificate",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "certificate_keys",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_api_secret",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_key1",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "connector_key2",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_email",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_password",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "wrong_password",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_base_email_for_signup",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user_domain_for_signup",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user