Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

test(connector): [Trustpay] Add ui test for card 3ds (#1683)

Swangi Kumari3f756e59c32a
diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs
index 690e8f1dc0..b49ea68800 100644
--- a/crates/router/tests/connectors/main.rs
+++ b/crates/router/tests/connectors/main.rs
@@ -57,6 +57,7 @@ mod shift4_ui;
mod stripe;
mod stripe_ui;
mod trustpay;
+mod trustpay_3ds_ui;
mod utils;
mod worldline;
mod worldline_ui;
diff --git a/crates/router/tests/connectors/trustpay_3ds_ui.rs b/crates/router/tests/connectors/trustpay_3ds_ui.rs
new file mode 100644
index 0000000000..da929f28da
--- /dev/null
+++ b/crates/router/tests/connectors/trustpay_3ds_ui.rs
@@ -0,0 +1,40 @@
+use serial_test::serial;
+use thirtyfour::{prelude::*, WebDriver};
+
+use crate::{selenium::*, tester};
+
+struct TrustpaySeleniumTest;
+
+impl SeleniumTest for TrustpaySeleniumTest {
+ fn get_connector_name(&self) -> String {
+ "trustpay_3ds".to_string()
+ }
+}
+
+async fn should_make_trustpay_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
+ let conn = TrustpaySeleniumTest {};
+ conn.make_redirection_payment(
+ web_driver,
+ vec![
+ Event::Trigger(Trigger::Goto(&format!("{CHEKOUT_BASE_URL}/saved/206"))),
+ Event::Trigger(Trigger::Sleep(1)),
+ Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
+ Event::Trigger(Trigger::Click(By::Css(
+ "button.btn.btn-lg.btn-primary.btn-block",
+ ))),
+ Event::Assert(Assert::IsPresent("Google")),
+ Event::Assert(Assert::Contains(
+ Selector::QueryParamStr,
+ "status=succeeded",
+ )),
+ ],
+ )
+ .await?;
+ Ok(())
+}
+
+#[test]
+#[serial]
+fn should_make_trustpay_3ds_payment_test() {
+ tester!(should_make_trustpay_3ds_payment);
+}