Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/stripe_wh_ui.rs
================================================================================
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct StripeSeleniumTest;

impl SeleniumTest for StripeSeleniumTest {
    fn get_connector_name(&self) -> String {
        "stripe".to_string()
    }
}

async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = StripeSeleniumTest {};
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/16"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
        10,
        "succeeded",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}

Tests: crates/test_utils/tests/connectors/stripe_wh_ui.rs
================================================================================
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct StripeSeleniumTest;

impl SeleniumTest for StripeSeleniumTest {
    fn get_connector_name(&self) -> String {
        "stripe".to_string()
    }
}

async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = StripeSeleniumTest {};
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/16"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
        10,
        "succeeded",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/multisafepay_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct MultisafepaySeleniumTest;

impl SeleniumTest for MultisafepaySeleniumTest {
    fn get_connector_name(&self) -> String {
        "multisafepay".to_string()
    }
}

async fn should_make_multisafepay_3ds_payment_success(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/207"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_multisafepay_3ds_payment_failed(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/93"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("failed")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/153"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("button[class='btn btn-default']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/154"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='btn btn-msp-success btn-block']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_multisafepay_3ds_payment_success_test() {
    tester!(should_make_multisafepay_3ds_payment_success);
}

#[test]
#[serial]
fn should_make_multisafepay_3ds_payment_failed_test() {
    tester!(should_make_multisafepay_3ds_payment_failed);
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_paypal_payment_test() {
    tester!(should_make_paypal_payment);
}

Tests: crates/test_utils/tests/connectors/multisafepay_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct MultisafepaySeleniumTest;

impl SeleniumTest for MultisafepaySeleniumTest {
    fn get_connector_name(&self) -> String {
        "multisafepay".to_string()
    }
}

async fn should_make_multisafepay_3ds_payment_success(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/207"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_multisafepay_3ds_payment_failed(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/93"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("failed")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/153"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("button[class='btn btn-default']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MultisafepaySeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/154"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='btn btn-msp-success btn-block']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_multisafepay_3ds_payment_success_test() {
    tester!(should_make_multisafepay_3ds_payment_success);
}

#[test]
#[serial]
fn should_make_multisafepay_3ds_payment_failed_test() {
    tester!(should_make_multisafepay_3ds_payment_failed);
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_paypal_payment_test() {
    tester!(should_make_paypal_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/payu_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct PayUSeleniumTest;

impl SeleniumTest for PayUSeleniumTest {
    fn get_connector_name(&self) -> String {
        "payu".to_string()
    }
}

async fn should_make_no_3ds_card_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = PayUSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/72"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Sleep(1)),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = PayUSeleniumTest {};
    conn.make_gpay_payment(web_driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?gatewayname=payu&gatewaymerchantid=459551&amount=70.00&country=US&currency=PLN"),
        vec![
        Event::Assert(Assert::IsPresent("Status")),
        Event::Assert(Assert::IsPresent("processing")),
    ]).await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_no_3ds_card_payment_test() {
    tester!(should_make_no_3ds_card_payment);
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

Tests: crates/test_utils/tests/connectors/payu_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct PayUSeleniumTest;

impl SeleniumTest for PayUSeleniumTest {
    fn get_connector_name(&self) -> String {
        "payu".to_string()
    }
}

async fn should_make_no_3ds_card_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = PayUSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/72"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Sleep(1)),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = PayUSeleniumTest {};
    conn.make_gpay_payment(web_driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?gatewayname=payu&gatewaymerchantid=459551&amount=70.00&country=US&currency=PLN"),
        vec![
        Event::Assert(Assert::IsPresent("Status")),
        Event::Assert(Assert::IsPresent("processing")),
    ]).await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_no_3ds_card_payment_test() {
    tester!(should_make_no_3ds_card_payment);
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/aci_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct AciSeleniumTest;

impl SeleniumTest for AciSeleniumTest {
    fn get_connector_name(&self) -> String {
        "aci".to_string()
    }
}

async fn should_make_aci_card_mandate_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/180"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_alipay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/213"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Id("submit-success"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_interac_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/14"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input[value='Continue payment']"))),
            Event::Trigger(Trigger::Click(By::Css("input[value='Confirm']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_eps_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/208"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-middle"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_ideal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/211"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input.pps-button"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_sofort_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/212"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_giropay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/209"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SendKeys(By::Name("sc"), "10")),
            Event::Trigger(Trigger::SendKeys(By::Name("extensionSc"), "4000")),
            Event::Trigger(Trigger::SendKeys(By::Name("customerName1"), "Hopper")),
            Event::Trigger(Trigger::Click(By::Css("input[value='Absenden']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_trustly_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/13"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Sleep(2)),
            Event::Trigger(Trigger::Click(By::XPath(
                r#"//*[@id="app"]/div[1]/div/div[2]/div/ul/div[4]/div/div[1]/div[2]/div[1]/span"#,
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "123456789",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "783213",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::Click(By::Css("div.sc-jJMGnK.laKGqb"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "355508",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_przelewy24_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/12"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Id("pf31"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.btn.btn-lg.btn-info.btn-block",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.btn.btn-success.btn-lg.accept-button",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_aci_card_mandate_payment_test() {
    tester!(should_make_aci_card_mandate_payment);
}

#[test]
#[serial]
fn should_make_aci_alipay_payment_test() {
    tester!(should_make_aci_alipay_payment);
}

#[test]
#[serial]
fn should_make_aci_interac_payment_test() {
    tester!(should_make_aci_interac_payment);
}

#[test]
#[serial]
fn should_make_aci_eps_payment_test() {
    tester!(should_make_aci_eps_payment);
}

#[test]
#[serial]
fn should_make_aci_ideal_payment_test() {
    tester!(should_make_aci_ideal_payment);
}

#[test]
#[serial]
fn should_make_aci_sofort_payment_test() {
    tester!(should_make_aci_sofort_payment);
}

#[test]
#[serial]
fn should_make_aci_giropay_payment_test() {
    tester!(should_make_aci_giropay_payment);
}

#[test]
#[serial]
fn should_make_aci_trustly_payment_test() {
    tester!(should_make_aci_trustly_payment);
}

#[test]
#[serial]
fn should_make_aci_przelewy24_payment_test() {
    tester!(should_make_aci_przelewy24_payment);
}

Tests: crates/test_utils/tests/connectors/aci_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct AciSeleniumTest;

impl SeleniumTest for AciSeleniumTest {
    fn get_connector_name(&self) -> String {
        "aci".to_string()
    }
}

async fn should_make_aci_card_mandate_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/180"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_alipay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/213"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Id("submit-success"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_interac_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/14"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input[value='Continue payment']"))),
            Event::Trigger(Trigger::Click(By::Css("input[value='Confirm']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_eps_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/208"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-short"))),
            Event::Trigger(Trigger::Click(By::Css("input.button-body.button-middle"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_ideal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/211"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css("input.pps-button"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_sofort_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/212"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.large.button.primary.expand.form-submitter",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_giropay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/209"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SendKeys(By::Name("sc"), "10")),
            Event::Trigger(Trigger::SendKeys(By::Name("extensionSc"), "4000")),
            Event::Trigger(Trigger::SendKeys(By::Name("customerName1"), "Hopper")),
            Event::Trigger(Trigger::Click(By::Css("input[value='Absenden']"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_trustly_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/13"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Sleep(2)),
            Event::Trigger(Trigger::Click(By::XPath(
                r#"//*[@id="app"]/div[1]/div/div[2]/div/ul/div[4]/div/div[1]/div[2]/div[1]/span"#,
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "123456789",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "783213",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::Click(By::Css("div.sc-jJMGnK.laKGqb"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Trigger(Trigger::SendKeys(
                By::Css("input.sc-fXgAZx.hkChHq"),
                "355508",
            )),
            Event::Trigger(Trigger::Click(By::Css(
                "button.sc-eJocfa.sc-oeezt.cDgdS.bptgBT",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_aci_przelewy24_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AciSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/12"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Click(By::Id("pf31"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.btn.btn-lg.btn-info.btn-block",
            ))),
            Event::Trigger(Trigger::Click(By::Css(
                "button.btn.btn-success.btn-lg.accept-button",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_aci_card_mandate_payment_test() {
    tester!(should_make_aci_card_mandate_payment);
}

#[test]
#[serial]
fn should_make_aci_alipay_payment_test() {
    tester!(should_make_aci_alipay_payment);
}

#[test]
#[serial]
fn should_make_aci_interac_payment_test() {
    tester!(should_make_aci_interac_payment);
}

#[test]
#[serial]
fn should_make_aci_eps_payment_test() {
    tester!(should_make_aci_eps_payment);
}

#[test]
#[serial]
fn should_make_aci_ideal_payment_test() {
    tester!(should_make_aci_ideal_payment);
}

#[test]
#[serial]
fn should_make_aci_sofort_payment_test() {
    tester!(should_make_aci_sofort_payment);
}

#[test]
#[serial]
fn should_make_aci_giropay_payment_test() {
    tester!(should_make_aci_giropay_payment);
}

#[test]
#[serial]
fn should_make_aci_trustly_payment_test() {
    tester!(should_make_aci_trustly_payment);
}

#[test]
#[serial]
fn should_make_aci_przelewy24_payment_test() {
    tester!(should_make_aci_przelewy24_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/authorizedotnet_ui.rs
================================================================================
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 fraudulent 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!("{CHECKOUT_BASE_URL}/gpay?gatewayname=authorizenet&gatewaymerchantid={pub_key}&amount={amount}&country=US&currency=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!("{CHECKOUT_BASE_URL}/saved/156"),
        vec![
            Event::EitherOr(
                Assert::IsElePresent(By::Css(".reviewButton")),
                vec![Event::Trigger(Trigger::Click(By::Css(".reviewButton")))],
                vec![Event::Trigger(Trigger::Click(By::Id("payment-submit-btn")))],
            ),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")), // This connector status will be processing for one day
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_paypal_payment_test() {
    tester!(should_make_paypal_payment);
}

Tests: crates/test_utils/tests/connectors/authorizedotnet_ui.rs
================================================================================
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 fraudulent 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!("{CHECKOUT_BASE_URL}/gpay?gatewayname=authorizenet&gatewaymerchantid={pub_key}&amount={amount}&country=US&currency=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!("{CHECKOUT_BASE_URL}/saved/156"),
        vec![
            Event::EitherOr(
                Assert::IsElePresent(By::Css(".reviewButton")),
                vec![Event::Trigger(Trigger::Click(By::Css(".reviewButton")))],
                vec![Event::Trigger(Trigger::Click(By::Id("payment-submit-btn")))],
            ),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")), // This connector status will be processing for one day
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
#[ignore]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_paypal_payment_test() {
    tester!(should_make_paypal_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/globalpay_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct GlobalpaySeleniumTest;

impl SeleniumTest for GlobalpaySeleniumTest {
    fn get_connector_name(&self) -> String {
        "globalpay".to_string()
    }
}

async fn should_make_gpay_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    let pub_key = conn
        .get_configs()
        .automation_configs
        .unwrap()
        .globalpay_gateway_merchant_id
        .unwrap();
    conn.make_gpay_payment(driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?amount=10.00&country=US&currency=USD&gatewayname=globalpayments&gatewaymerchantid={pub_key}"),
        vec![
        Event::Assert(Assert::IsPresent("succeeded")),
    ]).await?;
    Ok(())
}

async fn should_make_globalpay_paypal_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_paypal_payment(
        driver,
        &format!("{CHECKOUT_BASE_URL}/saved/46"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("payment-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_ideal_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/53"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_giropay_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/59"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_eps_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/50"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_sofort_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/63"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::RunIf(
                Assert::IsPresent("Wählen"),
                vec![Event::Trigger(Trigger::Click(By::Css("p.description")))],
            ),
            Event::Assert(Assert::IsPresent("Demo Bank")),
            Event::Trigger(Trigger::SendKeys(
                By::Id("BackendFormLOGINNAMEUSERID"),
                "12345",
            )),
            Event::Trigger(Trigger::SendKeys(By::Id("BackendFormUSERPIN"), "1234")),
            Event::Trigger(Trigger::Click(By::Css(
                "button.button-right.primary.has-indicator",
            ))),
            Event::RunIf(
                Assert::IsPresent("Kontoauswahl"),
                vec![Event::Trigger(Trigger::Click(By::Css(
                    "button.button-right.primary.has-indicator",
                )))],
            ),
            Event::Assert(Assert::IsPresent("PPRO Payment Services Ltd.")),
            Event::Trigger(Trigger::SendKeys(By::Id("BackendFormTan"), "12345")),
            Event::Trigger(Trigger::Click(By::Css(
                "button.button-right.primary.has-indicator",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_globalpay_paypal_payment_test() {
    tester!(should_make_globalpay_paypal_payment);
}

#[test]
#[serial]
fn should_make_globalpay_ideal_payment_test() {
    tester!(should_make_globalpay_ideal_payment);
}

#[test]
#[serial]
fn should_make_globalpay_giropay_payment_test() {
    tester!(should_make_globalpay_giropay_payment);
}

#[test]
#[serial]
fn should_make_globalpay_eps_payment_test() {
    tester!(should_make_globalpay_eps_payment);
}

#[test]
#[serial]
fn should_make_globalpay_sofort_payment_test() {
    tester!(should_make_globalpay_sofort_payment);
}

Tests: crates/test_utils/tests/connectors/globalpay_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct GlobalpaySeleniumTest;

impl SeleniumTest for GlobalpaySeleniumTest {
    fn get_connector_name(&self) -> String {
        "globalpay".to_string()
    }
}

async fn should_make_gpay_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    let pub_key = conn
        .get_configs()
        .automation_configs
        .unwrap()
        .globalpay_gateway_merchant_id
        .unwrap();
    conn.make_gpay_payment(driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?amount=10.00&country=US&currency=USD&gatewayname=globalpayments&gatewaymerchantid={pub_key}"),
        vec![
        Event::Assert(Assert::IsPresent("succeeded")),
    ]).await?;
    Ok(())
}

async fn should_make_globalpay_paypal_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_paypal_payment(
        driver,
        &format!("{CHECKOUT_BASE_URL}/saved/46"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("payment-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_ideal_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/53"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_giropay_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/59"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_eps_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/50"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Choose your Bank")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Login to your Online Banking Account")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Transaction Authentication")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Payment Successful")),
            Event::Trigger(Trigger::Click(By::Css("button.btn.btn-primary"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_globalpay_sofort_payment(driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = GlobalpaySeleniumTest {};
    conn.make_redirection_payment(
        driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/63"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::RunIf(
                Assert::IsPresent("Wählen"),
                vec![Event::Trigger(Trigger::Click(By::Css("p.description")))],
            ),
            Event::Assert(Assert::IsPresent("Demo Bank")),
            Event::Trigger(Trigger::SendKeys(
                By::Id("BackendFormLOGINNAMEUSERID"),
                "12345",
            )),
            Event::Trigger(Trigger::SendKeys(By::Id("BackendFormUSERPIN"), "1234")),
            Event::Trigger(Trigger::Click(By::Css(
                "button.button-right.primary.has-indicator",
            ))),
            Event::RunIf(
                Assert::IsPresent("Kontoauswahl"),
                vec![Event::Trigger(Trigger::Click(By::Css(
                    "button.button-right.primary.has-indicator",
                )))],
            ),
            Event::Assert(Assert::IsPresent("PPRO Payment Services Ltd.")),
            Event::Trigger(Trigger::SendKeys(By::Id("BackendFormTan"), "12345")),
            Event::Trigger(Trigger::Click(By::Css(
                "button.button-right.primary.has-indicator",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=succeeded", "status=processing"],
            )),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_gpay_payment_test() {
    tester!(should_make_gpay_payment);
}

#[test]
#[serial]
fn should_make_globalpay_paypal_payment_test() {
    tester!(should_make_globalpay_paypal_payment);
}

#[test]
#[serial]
fn should_make_globalpay_ideal_payment_test() {
    tester!(should_make_globalpay_ideal_payment);
}

#[test]
#[serial]
fn should_make_globalpay_giropay_payment_test() {
    tester!(should_make_globalpay_giropay_payment);
}

#[test]
#[serial]
fn should_make_globalpay_eps_payment_test() {
    tester!(should_make_globalpay_eps_payment);
}

#[test]
#[serial]
fn should_make_globalpay_sofort_payment_test() {
    tester!(should_make_globalpay_sofort_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/mollie_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct MollieSeleniumTest;

impl SeleniumTest for MollieSeleniumTest {
    fn get_connector_name(&self) -> String {
        "mollie".to_string()
    }
}

async fn should_make_mollie_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/32"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_sofort_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/29"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_ideal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn: MollieSeleniumTest = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/36"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::ClassName(
                "payment-method-list--bordered",
            ))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_eps_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/38"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_giropay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/41"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_bancontact_card_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/86"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_przelewy24_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/87"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/148"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_mollie_paypal_payment_test() {
    tester!(should_make_mollie_paypal_payment);
}

#[test]
#[serial]
fn should_make_mollie_sofort_payment_test() {
    tester!(should_make_mollie_sofort_payment);
}

#[test]
#[serial]
fn should_make_mollie_ideal_payment_test() {
    tester!(should_make_mollie_ideal_payment);
}

#[test]
#[serial]
fn should_make_mollie_eps_payment_test() {
    tester!(should_make_mollie_eps_payment);
}

#[test]
#[serial]
fn should_make_mollie_giropay_payment_test() {
    tester!(should_make_mollie_giropay_payment);
}

#[test]
#[serial]
fn should_make_mollie_bancontact_card_payment_test() {
    tester!(should_make_mollie_bancontact_card_payment);
}

#[test]
#[serial]
fn should_make_mollie_przelewy24_payment_test() {
    tester!(should_make_mollie_przelewy24_payment);
}

#[test]
#[serial]
fn should_make_mollie_3ds_payment_test() {
    tester!(should_make_mollie_3ds_payment);
}

Tests: crates/test_utils/tests/connectors/mollie_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct MollieSeleniumTest;

impl SeleniumTest for MollieSeleniumTest {
    fn get_connector_name(&self) -> String {
        "mollie".to_string()
    }
}

async fn should_make_mollie_paypal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/32"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_sofort_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/29"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_ideal_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn: MollieSeleniumTest = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/36"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::ClassName(
                "payment-method-list--bordered",
            ))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_eps_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/38"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_giropay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/41"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_bancontact_card_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/86"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_przelewy24_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/87"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_mollie_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = MollieSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/148"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Test profile")),
            Event::Trigger(Trigger::Click(By::Css("input[value='paid']"))),
            Event::Trigger(Trigger::Click(By::Css(
                "button[class='button form__button']",
            ))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_mollie_paypal_payment_test() {
    tester!(should_make_mollie_paypal_payment);
}

#[test]
#[serial]
fn should_make_mollie_sofort_payment_test() {
    tester!(should_make_mollie_sofort_payment);
}

#[test]
#[serial]
fn should_make_mollie_ideal_payment_test() {
    tester!(should_make_mollie_ideal_payment);
}

#[test]
#[serial]
fn should_make_mollie_eps_payment_test() {
    tester!(should_make_mollie_eps_payment);
}

#[test]
#[serial]
fn should_make_mollie_giropay_payment_test() {
    tester!(should_make_mollie_giropay_payment);
}

#[test]
#[serial]
fn should_make_mollie_bancontact_card_payment_test() {
    tester!(should_make_mollie_bancontact_card_payment);
}

#[test]
#[serial]
fn should_make_mollie_przelewy24_payment_test() {
    tester!(should_make_mollie_przelewy24_payment);
}

#[test]
#[serial]
fn should_make_mollie_3ds_payment_test() {
    tester!(should_make_mollie_3ds_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/airwallex_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct AirwallexSeleniumTest;

impl SeleniumTest for AirwallexSeleniumTest {
    fn get_connector_name(&self) -> String {
        "airwallex".to_string()
    }
}

async fn should_make_airwallex_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AirwallexSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/85"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Query(By::ClassName("title"))),
            Event::Assert(Assert::Eq(
                Selector::Title,
                "Airwallex - Create 3D Secure Payment",
            )),
            Event::Trigger(Trigger::SendKeys(By::Id("challengeDataEntry"), "1234")),
            Event::Trigger(Trigger::Click(By::Id("submit"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_airwallex_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AirwallexSeleniumTest {};
    let merchant_name = conn
        .get_configs()
        .automation_configs
        .unwrap()
        .airwallex_merchant_name
        .unwrap();
    conn.make_gpay_payment(web_driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?gatewayname=airwallex&gatewaymerchantid={merchant_name}&amount=70.00&country=US&currency=USD"),
        vec![
            Event::Trigger(Trigger::Query(By::ClassName("title"))),
            Event::Assert(Assert::Eq(Selector::Title, "Airwallex - Create 3D Secure Payment")),
            Event::Trigger(Trigger::SendKeys(By::Id("challengeDataEntry"), "1234")),
            Event::Trigger(Trigger::Click(By::Id("submit"))),
            Event::Assert(Assert::IsPresent("succeeded")),
    ]).await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_airwallex_3ds_payment_test() {
    tester!(should_make_airwallex_3ds_payment);
}

#[test]
#[serial]
#[ignore]
fn should_make_airwallex_gpay_payment_test() {
    tester!(should_make_airwallex_gpay_payment);
}

Tests: crates/test_utils/tests/connectors/airwallex_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct AirwallexSeleniumTest;

impl SeleniumTest for AirwallexSeleniumTest {
    fn get_connector_name(&self) -> String {
        "airwallex".to_string()
    }
}

async fn should_make_airwallex_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AirwallexSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/85"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::Query(By::ClassName("title"))),
            Event::Assert(Assert::Eq(
                Selector::Title,
                "Airwallex - Create 3D Secure Payment",
            )),
            Event::Trigger(Trigger::SendKeys(By::Id("challengeDataEntry"), "1234")),
            Event::Trigger(Trigger::Click(By::Id("submit"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::Contains(
                Selector::QueryParamStr,
                "status=succeeded",
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_airwallex_gpay_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AirwallexSeleniumTest {};
    let merchant_name = conn
        .get_configs()
        .automation_configs
        .unwrap()
        .airwallex_merchant_name
        .unwrap();
    conn.make_gpay_payment(web_driver,
        &format!("{CHECKOUT_BASE_URL}/gpay?gatewayname=airwallex&gatewaymerchantid={merchant_name}&amount=70.00&country=US&currency=USD"),
        vec![
            Event::Trigger(Trigger::Query(By::ClassName("title"))),
            Event::Assert(Assert::Eq(Selector::Title, "Airwallex - Create 3D Secure Payment")),
            Event::Trigger(Trigger::SendKeys(By::Id("challengeDataEntry"), "1234")),
            Event::Trigger(Trigger::Click(By::Id("submit"))),
            Event::Assert(Assert::IsPresent("succeeded")),
    ]).await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_airwallex_3ds_payment_test() {
    tester!(should_make_airwallex_3ds_payment);
}

#[test]
#[serial]
#[ignore]
fn should_make_airwallex_gpay_payment_test() {
    tester!(should_make_airwallex_gpay_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/bambora_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct BamboraSeleniumTest;

impl SeleniumTest for BamboraSeleniumTest {
    fn get_connector_name(&self) -> String {
        "bambora".to_string()
    }
}

async fn should_make_3ds_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let mycon = BamboraSeleniumTest {};
    mycon
        .make_redirection_payment(
            c,
            vec![
                Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/33"))),
                Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
                Event::Trigger(Trigger::Click(By::Id("continue-transaction"))),
                Event::Assert(Assert::IsPresent("succeeded")),
            ],
        )
        .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_3ds_payment_test() {
    tester!(should_make_3ds_payment);
}

Tests: crates/test_utils/tests/connectors/bambora_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct BamboraSeleniumTest;

impl SeleniumTest for BamboraSeleniumTest {
    fn get_connector_name(&self) -> String {
        "bambora".to_string()
    }
}

async fn should_make_3ds_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let mycon = BamboraSeleniumTest {};
    mycon
        .make_redirection_payment(
            c,
            vec![
                Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/33"))),
                Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
                Event::Trigger(Trigger::Click(By::Id("continue-transaction"))),
                Event::Assert(Assert::IsPresent("succeeded")),
            ],
        )
        .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_3ds_payment_test() {
    tester!(should_make_3ds_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs
================================================================================
use rand::Rng;
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_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AuthorizedotnetSeleniumTest {};
    let amount = rand::thread_rng().gen_range(50..1000); //This connector detects it as fraudulent payment if the same amount is used for multiple payments so random amount is passed for testing(
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/227?amount={amount}"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
        10,
        "processing",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}

Tests: crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs
================================================================================
use rand::Rng;
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_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = AuthorizedotnetSeleniumTest {};
    let amount = rand::thread_rng().gen_range(50..1000); //This connector detects it as fraudulent payment if the same amount is used for multiple payments so random amount is passed for testing(
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/227?amount={amount}"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
        10,
        "processing",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/zen_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct ZenSeleniumTest;

impl SeleniumTest for ZenSeleniumTest {
    fn get_connector_name(&self) -> String {
        "zen".to_string()
    }
}

async fn should_make_zen_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let mycon = ZenSeleniumTest {};
    mycon
        .make_redirection_payment(
            web_driver,
            vec![
                Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/201"))),
                Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
                Event::Trigger(Trigger::Sleep(10)), //url gets updated only after some time, so need this timeout to solve the issue
                Event::Trigger(Trigger::SwitchFrame(By::Name("cko-3ds2-iframe"))),
                Event::Trigger(Trigger::SendKeys(By::Id("password"), "Checkout1!")),
                Event::Trigger(Trigger::Click(By::Id("txtButton"))),
                Event::Trigger(Trigger::Sleep(3)),
                Event::Assert(Assert::IsPresent("succeeded")),
            ],
        )
        .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_zen_3ds_payment_test() {
    tester!(should_make_zen_3ds_payment);
}

Tests: crates/test_utils/tests/connectors/zen_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct ZenSeleniumTest;

impl SeleniumTest for ZenSeleniumTest {
    fn get_connector_name(&self) -> String {
        "zen".to_string()
    }
}

async fn should_make_zen_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let mycon = ZenSeleniumTest {};
    mycon
        .make_redirection_payment(
            web_driver,
            vec![
                Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/201"))),
                Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
                Event::Trigger(Trigger::Sleep(10)), //url gets updated only after some time, so need this timeout to solve the issue
                Event::Trigger(Trigger::SwitchFrame(By::Name("cko-3ds2-iframe"))),
                Event::Trigger(Trigger::SendKeys(By::Id("password"), "Checkout1!")),
                Event::Trigger(Trigger::Click(By::Id("txtButton"))),
                Event::Trigger(Trigger::Sleep(3)),
                Event::Assert(Assert::IsPresent("succeeded")),
            ],
        )
        .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_zen_3ds_payment_test() {
    tester!(should_make_zen_3ds_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/bluesnap_wh_ui.rs
================================================================================
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct BluesnapSeleniumTest;

impl SeleniumTest for BluesnapSeleniumTest {
    fn get_connector_name(&self) -> String {
        "bluesnap".to_string()
    }
}

async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = BluesnapSeleniumTest {};
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/199"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
        10,
        "succeeded",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}

Tests: crates/test_utils/tests/connectors/bluesnap_wh_ui.rs
================================================================================
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct BluesnapSeleniumTest;

impl SeleniumTest for BluesnapSeleniumTest {
    fn get_connector_name(&self) -> String {
        "bluesnap".to_string()
    }
}

async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = BluesnapSeleniumTest {};
    conn.make_webhook_test(
        web_driver,
        &format!("{CHECKOUT_BASE_URL}/saved/199"),
        vec![
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
        10,
        "succeeded",
    )
    .await?;
    Ok(())
}

#[test]
fn should_make_webhook_test() {
    tester!(should_make_webhook);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/noon_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct NoonSeleniumTest;

impl SeleniumTest for NoonSeleniumTest {
    fn get_connector_name(&self) -> String {
        "noon".to_string()
    }
}

async fn should_make_noon_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/176"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SwitchFrame(By::Id("redirectTo3ds1Frame"))),
            Event::Trigger(Trigger::SwitchFrame(By::Css("iframe[frameborder='0']"))),
            Event::Trigger(Trigger::SendKeys(By::Css("input.input-field"), "1234")),
            Event::Trigger(Trigger::Click(By::Css("input.button.primary"))),
            Event::Trigger(Trigger::Sleep(5)),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_noon_3ds_mandate_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/214"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SwitchFrame(By::Id("redirectTo3ds1Frame"))),
            Event::Trigger(Trigger::SwitchFrame(By::Css("iframe[frameborder='0']"))),
            Event::Trigger(Trigger::SendKeys(By::Css("input.input-field"), "1234")),
            Event::Trigger(Trigger::Click(By::Css("input.button.primary"))),
            Event::Trigger(Trigger::Sleep(5)),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_noon_non_3ds_mandate_payment(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/215"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_noon_3ds_payment_test() {
    tester!(should_make_noon_3ds_payment);
}

#[test]
#[serial]
fn should_make_noon_3ds_mandate_payment_test() {
    tester!(should_make_noon_3ds_mandate_payment);
}

#[test]
#[serial]
fn should_make_noon_non_3ds_mandate_payment_test() {
    tester!(should_make_noon_non_3ds_mandate_payment);
}

Tests: crates/test_utils/tests/connectors/noon_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct NoonSeleniumTest;

impl SeleniumTest for NoonSeleniumTest {
    fn get_connector_name(&self) -> String {
        "noon".to_string()
    }
}

async fn should_make_noon_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/176"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SwitchFrame(By::Id("redirectTo3ds1Frame"))),
            Event::Trigger(Trigger::SwitchFrame(By::Css("iframe[frameborder='0']"))),
            Event::Trigger(Trigger::SendKeys(By::Css("input.input-field"), "1234")),
            Event::Trigger(Trigger::Click(By::Css("input.button.primary"))),
            Event::Trigger(Trigger::Sleep(5)),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_noon_3ds_mandate_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/214"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Trigger(Trigger::SwitchFrame(By::Id("redirectTo3ds1Frame"))),
            Event::Trigger(Trigger::SwitchFrame(By::Css("iframe[frameborder='0']"))),
            Event::Trigger(Trigger::SendKeys(By::Css("input.input-field"), "1234")),
            Event::Trigger(Trigger::Click(By::Css("input.button.primary"))),
            Event::Trigger(Trigger::Sleep(5)),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_noon_non_3ds_mandate_payment(
    web_driver: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = NoonSeleniumTest {};
    conn.make_redirection_payment(
        web_driver,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/215"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
            Event::Assert(Assert::IsPresent("Mandate ID")),
            Event::Assert(Assert::IsPresent("man_")), // mandate id starting with man_
            Event::Trigger(Trigger::Click(By::Css("a.btn"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("succeeded")),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
fn should_make_noon_3ds_payment_test() {
    tester!(should_make_noon_3ds_payment);
}

#[test]
#[serial]
fn should_make_noon_3ds_mandate_payment_test() {
    tester!(should_make_noon_3ds_mandate_payment);
}

#[test]
#[serial]
fn should_make_noon_non_3ds_mandate_payment_test() {
    tester!(should_make_noon_non_3ds_mandate_payment);
}


Test-Implementation Pair

Implementation: crates/test_utils/tests/connectors/worldline_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct WorldlineSeleniumTest;

impl SeleniumTest for WorldlineSeleniumTest {
    fn get_connector_name(&self) -> String {
        "worldline".to_string()
    }
}

async fn should_make_card_non_3ds_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/71"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_worldline_ideal_redirect_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/49"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=requires_customer_action", "status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_worldline_giropay_redirect_payment(
    c: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/48"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=requires_customer_action", "status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
#[ignore]
fn should_make_worldline_giropay_redirect_payment_test() {
    tester!(should_make_worldline_giropay_redirect_payment);
}

#[test]
#[serial]
fn should_make_worldline_ideal_redirect_payment_test() {
    tester!(should_make_worldline_ideal_redirect_payment);
}

#[test]
#[serial]
fn should_make_card_non_3ds_payment_test() {
    tester!(should_make_card_non_3ds_payment);
}

Tests: crates/test_utils/tests/connectors/worldline_ui.rs
================================================================================
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};

use crate::{selenium::*, tester};

struct WorldlineSeleniumTest;

impl SeleniumTest for WorldlineSeleniumTest {
    fn get_connector_name(&self) -> String {
        "worldline".to_string()
    }
}

async fn should_make_card_non_3ds_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/71"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("status")),
            Event::Assert(Assert::IsPresent("processing")),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_worldline_ideal_redirect_payment(c: WebDriver) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/49"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=requires_customer_action", "status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

async fn should_make_worldline_giropay_redirect_payment(
    c: WebDriver,
) -> Result<(), WebDriverError> {
    let conn = WorldlineSeleniumTest {};
    conn.make_redirection_payment(
        c,
        vec![
            Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/48"))),
            Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
            Event::Assert(Assert::IsPresent("Google")),
            Event::Assert(Assert::ContainsAny(
                Selector::QueryParamStr,
                vec!["status=requires_customer_action", "status=succeeded"],
            )),
        ],
    )
    .await?;
    Ok(())
}

#[test]
#[serial]
#[ignore]
fn should_make_worldline_giropay_redirect_payment_test() {
    tester!(should_make_worldline_giropay_redirect_payment);
}

#[test]
#[serial]
fn should_make_worldline_ideal_redirect_payment_test() {
    tester!(should_make_worldline_ideal_redirect_payment);
}

#[test]
#[serial]
fn should_make_card_non_3ds_payment_test() {
    tester!(should_make_card_non_3ds_payment);
}