mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
test(connector): [Authorizedotnet] Add UI test for Authorizedotnet Payment methods (#1736)
Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
This commit is contained in:
@ -69,7 +69,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
connector:
|
connector:
|
||||||
# do not use more than 2 runners, try to group less time taking connectors together
|
# do not use more than 2 runners, try to group less time taking connectors together
|
||||||
- stripe,airwallex,bluesnap,checkout,trustpay_3ds,payu
|
- stripe,airwallex,bluesnap,checkout,trustpay_3ds,payu,authorizedotnet,
|
||||||
- adyen_uk,shift4,worldline,multisafepay,paypal,mollie,aci
|
- adyen_uk,shift4,worldline,multisafepay,paypal,mollie,aci
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
57
crates/router/tests/connectors/authorizedotnet_ui.rs
Normal file
57
crates/router/tests/connectors/authorizedotnet_ui.rs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
use rand::Rng;
|
||||||
|
use serial_test::serial;
|
||||||
|
use thirtyfour::{prelude::*, WebDriver};
|
||||||
|
|
||||||
|
use crate::{selenium::*, tester};
|
||||||
|
|
||||||
|
struct AuthorizedotnetSeleniumTest;
|
||||||
|
|
||||||
|
impl SeleniumTest for AuthorizedotnetSeleniumTest {
|
||||||
|
fn get_connector_name(&self) -> String {
|
||||||
|
"authorizedotnet".to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn should_make_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
|
||||||
|
let conn = AuthorizedotnetSeleniumTest {};
|
||||||
|
let amount = rand::thread_rng().gen_range(1..1000); //This connector detects it as fradulent payment if the same amount is used for multiple payments so random amount is passed for testing
|
||||||
|
let pub_key = conn
|
||||||
|
.get_configs()
|
||||||
|
.automation_configs
|
||||||
|
.unwrap()
|
||||||
|
.authorizedotnet_gateway_merchant_id
|
||||||
|
.unwrap();
|
||||||
|
conn.make_gpay_payment(web_driver,
|
||||||
|
&format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=authorizenet&gatewaymerchantid={pub_key}&amount={amount}&country=US¤cy=USD"),
|
||||||
|
vec![
|
||||||
|
Event::Assert(Assert::IsPresent("status")),
|
||||||
|
Event::Assert(Assert::IsPresent("processing")), // This connector status will be processing for one day
|
||||||
|
]).await?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn should_make_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
|
||||||
|
let conn = AuthorizedotnetSeleniumTest {};
|
||||||
|
conn.make_paypal_payment(
|
||||||
|
web_driver,
|
||||||
|
&format!("{CHEKOUT_BASE_URL}/saved/156"),
|
||||||
|
vec![
|
||||||
|
Event::Assert(Assert::IsPresent("status")),
|
||||||
|
Event::Assert(Assert::IsPresent("processing")), // This connector status will be processing for one day
|
||||||
|
],
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn should_make_gpay_payment_test() {
|
||||||
|
tester!(should_make_gpay_payment);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn should_make_paypal_payment_test() {
|
||||||
|
tester!(should_make_paypal_payment);
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ mod adyen_uk_ui;
|
|||||||
mod airwallex;
|
mod airwallex;
|
||||||
mod airwallex_ui;
|
mod airwallex_ui;
|
||||||
mod authorizedotnet;
|
mod authorizedotnet;
|
||||||
|
mod authorizedotnet_ui;
|
||||||
mod bambora;
|
mod bambora;
|
||||||
mod bambora_ui;
|
mod bambora_ui;
|
||||||
mod bitpay;
|
mod bitpay;
|
||||||
|
|||||||
@ -257,6 +257,7 @@ pub struct AutomationConfigs {
|
|||||||
pub testcases_path: Option<String>,
|
pub testcases_path: Option<String>,
|
||||||
pub bluesnap_gateway_merchant_id: Option<String>,
|
pub bluesnap_gateway_merchant_id: Option<String>,
|
||||||
pub globalpay_gateway_merchant_id: Option<String>,
|
pub globalpay_gateway_merchant_id: Option<String>,
|
||||||
|
pub authorizedotnet_gateway_merchant_id: Option<String>,
|
||||||
pub run_minimum_steps: Option<bool>,
|
pub run_minimum_steps: Option<bool>,
|
||||||
pub airwallex_merchant_name: Option<String>,
|
pub airwallex_merchant_name: Option<String>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user