aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness')
-rw-r--r--packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts10
-rw-r--r--packages/taler-harness/src/integrationtests/test-withdrawal-bank-integrated.ts21
-rw-r--r--packages/taler-harness/src/integrationtests/test-withdrawal-fees.ts10
3 files changed, 27 insertions, 14 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
index f3e3802e5..046bd5aed 100644
--- a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
+++ b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
@@ -24,6 +24,7 @@ import {
NotificationType,
PreparePayResultType,
TalerCorebankApiClient,
+ j2s,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { makeNoFeeCoinConfig } from "../harness/denomStructures.js";
@@ -149,12 +150,15 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) {
});
t.logStep("wait");
await wres.withdrawalFinishedCond;
-
const exchangeUpdated1Cond = walletClient.waitForNotificationCond(
(x) =>
- x.type === NotificationType.ExchangeStateTransition &&
- x.exchangeBaseUrl === exchange.baseUrl,
+ {
+ t.logStep(`EXCHANGE UPDATE, ${j2s(x)}`)
+ return x.type === NotificationType.ExchangeStateTransition &&
+ x.exchangeBaseUrl === exchange.baseUrl
+ }
);
+
t.logStep("waiting tx");
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
{
diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-bank-integrated.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-bank-integrated.ts
index a13095883..3ec2a3bcd 100644
--- a/packages/taler-harness/src/integrationtests/test-withdrawal-bank-integrated.ts
+++ b/packages/taler-harness/src/integrationtests/test-withdrawal-bank-integrated.ts
@@ -46,7 +46,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
"TESTKUDOS:10",
);
- // Hand it to the wallet
+ t.logStep("Hand it to the wallet")
const r1 = await walletClient.client.call(
WalletApiOperation.GetWithdrawalDetailsForUri,
@@ -55,7 +55,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
},
);
- // Withdraw
+ t.logStep("Withdraw")
const r2 = await walletClient.client.call(
WalletApiOperation.AcceptBankIntegratedWithdrawal,
@@ -65,6 +65,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
},
);
+ t.logStep("wait confirmed")
const withdrawalBankConfirmedCond = walletClient.waitForNotificationCond(
(x) => {
return (
@@ -76,6 +77,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
},
);
+ t.logStep("wait finished")
const withdrawalFinishedCond = walletClient.waitForNotificationCond((x) => {
return (
x.type === NotificationType.TransactionStateTransition &&
@@ -84,6 +86,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
);
});
+ t.logStep("wait withdraw coins")
const withdrawalReserveReadyCond = walletClient.waitForNotificationCond(
(x) => {
return (
@@ -95,7 +98,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
},
);
- // Do it twice to check idempotency
+ t.logStep("Do it twice to check idempotency")
const r3 = await walletClient.client.call(
WalletApiOperation.AcceptBankIntegratedWithdrawal,
{
@@ -104,9 +107,10 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
},
);
+ t.logStep("stop wirewatch")
await exchange.stopWirewatch();
- // Check status before withdrawal is confirmed by bank.
+ t.logStep("Check status before withdrawal is confirmed by bank.")
{
const txn = await walletClient.client.call(
WalletApiOperation.GetTransactions,
@@ -122,7 +126,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
t.assertTrue(tx0.withdrawalDetails.reserveIsReady === false);
}
- // Confirm it
+ t.logStep("Confirm it")
await bankClient.confirmWithdrawalOperation(user.username, {
withdrawalOperationId: wop.withdrawal_id,
@@ -132,6 +136,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
// Check status after withdrawal is confirmed by bank,
// but before funds are wired to the exchange.
+ t.logStep("Check status after withdrawal")
{
const txn = await walletClient.client.call(
WalletApiOperation.GetTransactions,
@@ -147,11 +152,13 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
t.assertTrue(tx0.withdrawalDetails.reserveIsReady === false);
}
+ t.logStep("start wirewatch")
await exchange.startWirewatch();
+ t.logStep("wait reserve")
await withdrawalReserveReadyCond;
- // Check status after funds were wired.
+ t.logStep("Check status after funds were wired.")
{
const txn = await walletClient.client.call(
WalletApiOperation.GetTransactions,
@@ -169,7 +176,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
await withdrawalFinishedCond;
- // Check balance
+ t.logStep("Check balance")
const balResp = await walletClient.client.call(
WalletApiOperation.GetBalances,
diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-fees.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-fees.ts
index 8a2268231..0657d2da7 100644
--- a/packages/taler-harness/src/integrationtests/test-withdrawal-fees.ts
+++ b/packages/taler-harness/src/integrationtests/test-withdrawal-fees.ts
@@ -138,7 +138,7 @@ export async function runWithdrawalFeesTest(t: GlobalTestState) {
bankClient.setAuth(user);
const wop = await bankClient.createWithdrawalOperation(user.username, amount);
- // Hand it to the wallet
+ t.logStep("Hand it to the wallet")
const details = await wallet.client.call(
WalletApiOperation.GetWithdrawalDetailsForUri,
@@ -165,23 +165,25 @@ export async function runWithdrawalFeesTest(t: GlobalTestState) {
t.assertAmountEquals(amountDetails.amountEffective, "TESTKUDOS:5");
t.assertAmountEquals(amountDetails.amountRaw, "TESTKUDOS:7.5");
+ t.logStep("Complete all pending operations")
+
await wallet.runPending();
- // Withdraw (AKA select)
+ t.logStep("Withdraw (AKA select)")
await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, {
exchangeBaseUrl: exchange.baseUrl,
talerWithdrawUri: wop.taler_withdraw_uri,
});
- // Confirm it
+ t.logStep("Confirm it")
await bankClient.confirmWithdrawalOperation(user.username, {
withdrawalOperationId: wop.withdrawal_id,
});
await wallet.runUntilDone();
- // Check balance
+ t.logStep("Check balance")
const balResp = await wallet.client.call(WalletApiOperation.GetBalances, {});
console.log(j2s(balResp));