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): [Nexinets] Add UI test for Nexinets Payment methods (#1784)

chikke srujanbf62a7c9ad8e
diff --git a/.github/workflows/connector-ui-sanity-tests.yml b/.github/workflows/connector-ui-sanity-tests.yml
index 407687c9de..7a991437fc 100644
--- a/.github/workflows/connector-ui-sanity-tests.yml
+++ b/.github/workflows/connector-ui-sanity-tests.yml
@@ -70,7 +70,7 @@ jobs:
connector:
# do not use more than 2 runners, try to group less time taking connectors together
- stripe,airwallex,bluesnap,checkout,trustpay_3ds,payu,authorizedotnet,aci,noon
- - adyen_uk,shift4,worldline,multisafepay,paypal,mollie
+ - adyen_uk,shift4,worldline,multisafepay,paypal,mollie,nexinets
steps:
diff --git a/.typos.toml b/.typos.toml
index 85e4b5f996..2a102ed908 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -17,6 +17,7 @@ SOM = "SOM" # Somalia country code
THA = "THA" # Thailand country code
ZAR = "ZAR" # South African Rand currency code
passord = "passord" # name of a css class for adyen ui test
+bottm = "bottm" # name of a css class for nexinets ui test
klick = "klick" # Swedish word for clicks
optin = "optin" # Boku preflow name
optin_id = "optin_id" # Boku's id for optin flow
diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs
index 948552bdc8..c4225dbedd 100644
--- a/crates/router/tests/connectors/main.rs
+++ b/crates/router/tests/connectors/main.rs
@@ -40,6 +40,7 @@ mod mollie_ui;
mod multisafepay;
mod multisafepay_ui;
mod nexinets;
+mod nexinets_ui;
mod nmi;
mod noon;
mod noon_ui;
diff --git a/crates/router/tests/connectors/nexinets_ui.rs b/crates/router/tests/connectors/nexinets_ui.rs
new file mode 100644
index 0000000000..fd80d3a4ae
--- /dev/null
+++ b/crates/router/tests/connectors/nexinets_ui.rs
@@ -0,0 +1,91 @@
+use serial_test::serial;
+use thirtyfour::{prelude::*, WebDriver};
+
+use crate::{selenium::*, tester};
+
+struct NexinetsSeleniumTest;
+
+impl SeleniumTest for NexinetsSeleniumTest {
+ fn get_connector_name(&self) -> String {
+ "nexinets".to_string()
+ }
+}
+
+async fn should_make_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
+ let conn = NexinetsSeleniumTest {};
+ conn.make_redirection_payment(
+ web_driver,
+ vec![
+ Event::Trigger(Trigger::Goto(&format!("{CHEKOUT_BASE_URL}/saved/220"))),
+ Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
+ Event::Trigger(Trigger::Click(By::Css(
+ "a.btn.btn-primary.btn-block.margin-bottm-15",
+ ))),
+ Event::Assert(Assert::ContainsAny(
+ Selector::QueryParamStr,
+ vec!["status=succeeded", "status=processing"],
+ )),
+ ],
+ )
+ .await?;
+ Ok(())
+}
+
+async fn should_make_3ds_card_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
+ let conn = NexinetsSeleniumTest {};
+ conn.make_redirection_payment(
+ web_driver,
+ vec![
+ Event::Trigger(Trigger::Goto(&format!("{CHEKOUT_BASE_URL}/saved/221"))),
+ Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
+ Event::Trigger(Trigger::SwitchFrame(By::Id("threeDSCReqIframe"))),
+ Event::Trigger(Trigger::SendKeys(By::Id("otp"), "1234")),
+ Event::Trigger(Trigger::Click(By::Css("button#sendOtp"))),
+ Event::Assert(Assert::IsPresent("Google")),
+ Event::Assert(Assert::ContainsAny(
+ Selector::QueryParamStr,
+ vec!["status=succeeded", "status=processing"],
+ )),
+ ],
+ )
+ .await?;
+ Ok(())
+}
+
+async fn should_make_ideal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
+ let conn = NexinetsSeleniumTest {};
+ conn.make_redirection_payment(
+ web_driver,
+ vec![
+ Event::Trigger(Trigger::Goto(&format!("{CHEKOUT_BASE_URL}/saved/222"))),
+ Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
+ Event::Trigger(Trigger::Click(By::Css(
+ "a.btn.btn-primary.btn-block.margin-bottm-15",
+ ))),
+ Event::Assert(Assert::ContainsAny(
+ Selector::QueryParamStr,
+ vec!["status=succeeded", "status=processing"],
+ )),
+ ],
+ )
+ .await?;
+ Ok(())
+}
+
+#[test]
+#[serial]
+fn should_make_paypal_payment_test() {
+ tester!(should_make_paypal_payment);
+}
+
+#[test]
+#[serial]
+fn should_make_3ds_card_payment_test() {
+ tester!(should_make_3ds_card_payment);
+}
+
+#[test]
+#[serial]
+fn should_make_ideal_payment_test() {
+ tester!(should_make_ideal_payment);
+}