aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-08-25 13:24:08 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-08-25 13:24:08 +0200
commit5ab3070b3a63c2e8fed0e413dea06cf03fb48f1e (patch)
tree121425d99c9465f2daf8ac91c6dc2254ebac5906 /packages/taler-harness/src
parent70fca92e781696a057089bc8bc48adebdf6e017e (diff)
parent2051aded501cddac1a4c869fb1f9731ac4523a1e (diff)
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r--packages/taler-harness/src/bench1.ts5
-rw-r--r--packages/taler-harness/src/bench3.ts6
-rw-r--r--packages/taler-harness/src/integrationtests/scenario-prompt-payment.ts59
-rw-r--r--packages/taler-harness/src/integrationtests/test-simple-payment.ts59
-rw-r--r--packages/taler-harness/src/integrationtests/testrunner.ts2
5 files changed, 63 insertions, 68 deletions
diff --git a/packages/taler-harness/src/bench1.ts b/packages/taler-harness/src/bench1.ts
index fb7cc9e1f..6aa444e0a 100644
--- a/packages/taler-harness/src/bench1.ts
+++ b/packages/taler-harness/src/bench1.ts
@@ -68,7 +68,6 @@ export async function runBench1(configJson: any): Promise<void> {
} else {
logger.info("not trusting exchange (validating signatures)");
}
- const batchWithdrawal = !!process.env["TALER_WALLET_BATCH_WITHDRAWAL"];
let wallet = {} as Wallet;
let getDbStats: () => AccessStats;
@@ -91,9 +90,7 @@ export async function runBench1(configJson: any): Promise<void> {
testing: {
insecureTrustExchange: trustExchange,
},
- features: {
- batchWithdrawal,
- },
+ features: {},
},
});
wallet = res.wallet;
diff --git a/packages/taler-harness/src/bench3.ts b/packages/taler-harness/src/bench3.ts
index ffafc75d2..c7eca90a8 100644
--- a/packages/taler-harness/src/bench3.ts
+++ b/packages/taler-harness/src/bench3.ts
@@ -76,8 +76,6 @@ export async function runBench3(configJson: any): Promise<void> {
} else {
logger.info("not trusting exchange (validating signatures)");
}
- const batchWithdrawal = !!process.env["TALER_WALLET_BATCH_WITHDRAWAL"];
-
let wallet = {} as Wallet;
let getDbStats: () => AccessStats;
@@ -96,9 +94,7 @@ export async function runBench3(configJson: any): Promise<void> {
persistentStoragePath: undefined,
httpLib: myHttpLib,
config: {
- features: {
- batchWithdrawal,
- },
+ features: {},
testing: {
insecureTrustExchange: trustExchange,
},
diff --git a/packages/taler-harness/src/integrationtests/scenario-prompt-payment.ts b/packages/taler-harness/src/integrationtests/scenario-prompt-payment.ts
deleted file mode 100644
index 7177a017c..000000000
--- a/packages/taler-harness/src/integrationtests/scenario-prompt-payment.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- This file is part of GNU Taler
- (C) 2020 Taler Systems S.A.
-
- GNU Taler is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-/**
- * Imports.
- */
-import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
-import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
-} from "../harness/helpers.js";
-
-/**
- * Run test for basic, bank-integrated withdrawal.
- */
-export async function runPromptPaymentScenario(t: GlobalTestState) {
- // Set up test environment
-
- const { wallet, bank, exchange, merchant } =
- await createSimpleTestkudosEnvironment(t);
-
- // Withdraw digital cash into the wallet.
-
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
-
- // Set up order.
-
- const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
- order: {
- summary: "Buy me!",
- amount: "TESTKUDOS:5",
- fulfillment_url: "taler://fulfillment-success/thx",
- },
- });
-
- let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, {
- orderId: orderResp.order_id,
- });
-
- t.assertTrue(orderStatus.order_status === "unpaid");
-
- console.log(orderStatus);
-
- // Wait "forever"
- await new Promise(() => {});
-}
diff --git a/packages/taler-harness/src/integrationtests/test-simple-payment.ts b/packages/taler-harness/src/integrationtests/test-simple-payment.ts
new file mode 100644
index 000000000..82fa5f21d
--- /dev/null
+++ b/packages/taler-harness/src/integrationtests/test-simple-payment.ts
@@ -0,0 +1,59 @@
+/*
+ This file is part of GNU Taler
+ (C) 2020 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Imports.
+ */
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { GlobalTestState } from "../harness/harness.js";
+import {
+ createSimpleTestkudosEnvironmentV2,
+ withdrawViaBankV2,
+ makeTestPaymentV2,
+} from "../harness/helpers.js";
+import { j2s } from "@gnu-taler/taler-util";
+
+/**
+ * Run test for basic, bank-integrated withdrawal and payment.
+ */
+export async function runSimplePaymentTest(t: GlobalTestState) {
+ // Set up test environment
+
+ const { walletClient, bank, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV2(t);
+
+ // Withdraw digital cash into the wallet.
+
+ await withdrawViaBankV2(t, {
+ walletClient,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
+
+ await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
+
+ const order = {
+ summary: "Buy me!",
+ amount: "TESTKUDOS:5",
+ fulfillment_url: "taler://fulfillment-success/thx",
+ };
+
+ await makeTestPaymentV2(t, { walletClient, merchant, order });
+ await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
+}
+
+runSimplePaymentTest.suites = ["wallet"];
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts
index 67572f0f7..58e2a20f7 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -103,6 +103,7 @@ import { runPaymentTemplateTest } from "./test-payment-template.js";
import { runExchangeDepositTest } from "./test-exchange-deposit.js";
import { runPeerRepairTest } from "./test-peer-repair.js";
import { runPaymentShareTest } from "./test-payment-share.js";
+import { runSimplePaymentTest } from "./test-simple-payment.js";
/**
* Test runner.
@@ -129,6 +130,7 @@ const allTests: TestMainFunction[] = [
runClauseSchnorrTest,
runDenomUnofferedTest,
runDepositTest,
+ runSimplePaymentTest,
runExchangeManagementTest,
runExchangeTimetravelTest,
runFeeRegressionTest,