diff options
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests')
18 files changed, 71 insertions, 46 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts b/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts index 0f8af05e5..2259dd8bb 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts @@ -27,6 +27,7 @@ import { BankApi, BankAccessApi, CreditDebitIndicator, + getPayto } from "../harness/harness.js"; import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util"; import { defaultCoinConfig } from "../harness/denomStructures"; @@ -61,7 +62,7 @@ export async function runBankApiTest(t: GlobalTestState) { }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -85,13 +86,13 @@ export async function runBankApiTest(t: GlobalTestState) { await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts b/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts index f33c8338b..07382c43e 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts @@ -18,7 +18,7 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState } from "../harness/harness.js"; +import { GlobalTestState, getPayto } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; /** @@ -44,7 +44,7 @@ export async function runDepositTest(t: GlobalTestState) { WalletApiOperation.CreateDepositGroup, { amount: "TESTKUDOS:10", - depositPaytoUri: "payto://x-taler-bank/localhost/foo", + depositPaytoUri: getPayto("foo"), }, ); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts index 8a5d563ce..91e9bdec5 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts @@ -26,6 +26,7 @@ import { MerchantService, BankApi, BankAccessApi, + getPayto } from "../harness/harness.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { @@ -69,7 +70,7 @@ export async function runExchangeManagementTest(t: GlobalTestState) { }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -98,13 +99,13 @@ export async function runExchangeManagementTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts b/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts index 56684f70a..9badfd501 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts @@ -40,6 +40,7 @@ import { MerchantService, setupDb, WalletCli, + getPayto } from "../harness/harness.js"; import { startWithdrawViaBank, withdrawViaBank } from "../harness/helpers.js"; @@ -103,7 +104,7 @@ export async function runExchangeTimetravelTest(t: GlobalTestState) { }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -127,13 +128,13 @@ export async function runExchangeTimetravelTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts index 025e12226..d3ff89ae4 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts @@ -25,6 +25,7 @@ import { MerchantService, setupDb, WalletCli, + getPayto } from "../harness/harness.js"; import { withdrawViaBank, @@ -63,7 +64,7 @@ export async function createMyTestkudosEnvironment( }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -140,7 +141,7 @@ export async function createMyTestkudosEnvironment( await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts index 8e8f966b9..1e958fd73 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts @@ -25,6 +25,7 @@ import { MerchantService, setupDb, WalletCli, + getPayto } from "../harness/harness.js"; import { withdrawViaBank, @@ -80,7 +81,7 @@ export async function createConfusedMerchantTestkudosEnvironment( const faultyExchange = new FaultInjectedExchangeService(t, exchange, 9081); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -108,13 +109,13 @@ export async function createConfusedMerchantTestkudosEnvironment( await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")] }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts index 589c79120..ef926c4af 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts @@ -25,6 +25,7 @@ import { MerchantApiClient, MerchantService, setupDb, + getPayto } from "../harness/harness.js"; /** @@ -74,7 +75,7 @@ export async function runMerchantInstancesDeleteTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], auth: { method: "external", }, @@ -84,7 +85,7 @@ export async function runMerchantInstancesDeleteTest(t: GlobalTestState) { await merchant.addInstance({ id: "myinst", name: "Second Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], auth: { method: "external", }, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts index fc5e7305a..6f76e2325 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts @@ -24,6 +24,7 @@ import { MerchantApiClient, MerchantService, setupDb, + getPayto } from "../harness/harness.js"; /** @@ -71,7 +72,7 @@ export async function runMerchantInstancesUrlsTest(t: GlobalTestState) { default_wire_transfer_delay: { d_ms: 60000 }, jurisdiction: {}, name: "My Default Instance", - payto_uris: ["payto://x-taler-bank/foo/bar"], + payto_uris: [getPayto("bar")], auth: { method: "token", token: "secret-token:i-am-default", @@ -88,7 +89,7 @@ export async function runMerchantInstancesUrlsTest(t: GlobalTestState) { default_wire_transfer_delay: { d_ms: 60000 }, jurisdiction: {}, name: "My Second Instance", - payto_uris: ["payto://x-taler-bank/foo/bar"], + payto_uris: [getPayto("bar")], auth: { method: "token", token: "secret-token:i-am-myinst", diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts index 46af87922..1bf6be4cd 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts @@ -25,6 +25,7 @@ import { MerchantApiClient, MerchantService, setupDb, + getPayto } from "../harness/harness.js"; /** @@ -74,7 +75,7 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], auth: { method: "external", }, @@ -84,7 +85,7 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { await merchant.addInstance({ id: "myinst", name: "Second Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], auth: { method: "external", }, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts index 2be01d919..7e421cc35 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts @@ -31,6 +31,7 @@ import { MerchantPrivateApi, BankApi, BankAccessApi, + getPayto } from "../harness/harness.js"; import { FaultInjectedExchangeService, @@ -64,7 +65,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) { }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); @@ -107,7 +108,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); console.log("setup done!"); @@ -131,18 +132,21 @@ export async function runPaymentFaultTest(t: GlobalTestState) { await wallet.runPending(); - // Confirm it - - await BankApi.confirmWithdrawalOperation(bank, user, wop); - // Withdraw await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, { exchangeBaseUrl: faultyExchange.baseUrl, talerWithdrawUri: wop.taler_withdraw_uri, }); + await wallet.runPending(); + + // Confirm it + + await BankApi.confirmWithdrawalOperation(bank, user, wop); + await wallet.runUntilDone(); + // Check balance await wallet.client.call(WalletApiOperation.GetBalances, {}); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts index 754c3a0e8..3084ecfe0 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts @@ -25,6 +25,7 @@ import { MerchantService, WalletCli, MerchantPrivateApi, + getPayto } from "../harness/harness.js"; import { withdrawViaBank } from "../harness/helpers.js"; import { coin_ct10, coin_u1 } from "../harness/denomStructures"; @@ -54,7 +55,7 @@ async function setupTest( }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); @@ -86,13 +87,13 @@ async function setupTest( await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts index 276c532b5..87c4d958b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts @@ -27,6 +27,7 @@ import { setupDb, BankService, delayMs, + getPayto } from "../harness/harness.js"; import { withdrawViaBank, @@ -84,7 +85,7 @@ async function createTestEnvironment( }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -121,13 +122,13 @@ async function createTestEnvironment( await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts index e20d8bdad..b55be9f82 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts @@ -36,6 +36,7 @@ import { MerchantService, setupDb, WalletCli, + getPayto } from "../harness/harness.js"; import { startWithdrawViaBank, withdrawViaBank } from "../harness/helpers.js"; @@ -97,7 +98,7 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) { }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -121,13 +122,13 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) { await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); await merchant.addInstance({ id: "minst1", name: "minst1", - paytoUris: ["payto://x-taler-bank/minst1"], + paytoUris: [getPayto("minst1")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts index c6a7f8402..f31220e24 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts @@ -18,7 +18,7 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, MerchantPrivateApi, BankApi } from "../harness/harness.js"; +import { GlobalTestState, MerchantPrivateApi, BankApi, getWireMethod } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; /** @@ -43,7 +43,7 @@ export async function runTippingTest(t: GlobalTestState) { { exchange_url: exchange.baseUrl, initial_balance: "TESTKUDOS:10", - wire_method: "x-taler-bank", + wire_method: getWireMethod(), }, ); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts b/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts index c21a7279b..c42ae5adf 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts @@ -32,6 +32,7 @@ import { MerchantService, setupDb, WalletCli, + getPayto } from "../harness/harness.js"; import { SimpleTestEnvironment } from "../harness/helpers.js"; @@ -69,7 +70,7 @@ export async function createMyEnvironment( }); const exchangeBankAccount = await bank.createExchangeAccount( - "MyExchange", + "myexchange", "x", ); exchange.addBankAccount("1", exchangeBankAccount); @@ -93,7 +94,7 @@ export async function createMyEnvironment( await merchant.addInstance({ id: "default", name: "Default Instance", - paytoUris: [`payto://x-taler-bank/merchant-default`], + paytoUris: [getPayto("merchant-default")], }); console.log("setup done!"); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts index fe719ea62..5ba1fa893 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts @@ -47,12 +47,18 @@ export async function runWithdrawalAbortBankTest(t: GlobalTestState) { await wallet.runPending(); - // Confirm it + // Abort it await BankApi.abortWithdrawalOperation(bank, user, wop); // Withdraw + // Difference: + // -> with euFin, the wallet selects + // -> with PyBank, the wallet stops _before_ + // + // WHY ?! + // const e = await t.assertThrowsOperationErrorAsync(async () => { await wallet.client.call( WalletApiOperation.AcceptBankIntegratedWithdrawal, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts index 35969c78f..25df19e46 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts @@ -47,16 +47,18 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) { await wallet.runPending(); - // Confirm it - - await BankApi.confirmWithdrawalOperation(bank, user, wop); - // Withdraw const r2 = await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, { exchangeBaseUrl: exchange.baseUrl, talerWithdrawUri: wop.taler_withdraw_uri, }); + await wallet.runPending(); + + // Confirm it + + await BankApi.confirmWithdrawalOperation(bank, user, wop); + await wallet.runUntilDone(); // Check balance diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts index b93d1b500..2f88b3024 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts @@ -50,6 +50,7 @@ export async function runTestWithdrawalManualTest(t: GlobalTestState) { const reservePub: string = wres.reservePub; + // Bug. await BankApi.adminAddIncoming(bank, { exchangeBankAccount, amount: "TESTKUDOS:10", |