aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-23 23:08:37 +0200
committerFlorian Dold <florian@dold.me>2023-04-23 23:08:37 +0200
commitb81ea1b4b75c6f326d331c5c23d94e807b895563 (patch)
tree0cf6d1dddafe1b10d7515b3d785acbdbc8da4bf6 /packages/taler-harness/src/integrationtests
parenteff3920bd5a2bff58d66ac72ba8bd2c1577f452f (diff)
downloadwallet-core-b81ea1b4b75c6f326d331c5c23d94e807b895563.tar.xz
harness: adjust to merchant API breaking changes, remove test that doesn't belong
Diffstat (limited to 'packages/taler-harness/src/integrationtests')
-rw-r--r--packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts12
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-on-demo.ts114
-rw-r--r--packages/taler-harness/src/integrationtests/testrunner.ts2
3 files changed, 10 insertions, 118 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts
index a4e44c7f3..1b5d50fd1 100644
--- a/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts
+++ b/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts
@@ -78,7 +78,11 @@ export async function runMerchantInstancesUrlsTest(t: GlobalTestState) {
),
jurisdiction: {},
name: "My Default Instance",
- payto_uris: [getPayto("bar")],
+ accounts: [
+ {
+ payto_uri: getPayto("bar"),
+ },
+ ],
auth: {
method: "token",
token: "secret-token:i-am-default",
@@ -99,7 +103,11 @@ export async function runMerchantInstancesUrlsTest(t: GlobalTestState) {
),
jurisdiction: {},
name: "My Second Instance",
- payto_uris: [getPayto("bar")],
+ accounts: [
+ {
+ payto_uri: getPayto("bar"),
+ },
+ ],
auth: {
method: "token",
token: "secret-token:i-am-myinst",
diff --git a/packages/taler-harness/src/integrationtests/test-payment-on-demo.ts b/packages/taler-harness/src/integrationtests/test-payment-on-demo.ts
deleted file mode 100644
index 22e88c8a0..000000000
--- a/packages/taler-harness/src/integrationtests/test-payment-on-demo.ts
+++ /dev/null
@@ -1,114 +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, WalletCli } from "../harness/harness.js";
-import { makeTestPayment } from "../harness/helpers.js";
-import {
- WalletApiOperation,
- BankApi,
- BankAccessApi,
- BankServiceHandle,
-} from "@gnu-taler/taler-wallet-core";
-import { createPlatformHttpLib } from "@gnu-taler/taler-util/http";
-
-/**
- * Run test for basic, bank-integrated withdrawal and payment.
- */
-export async function runPaymentDemoTest(t: GlobalTestState) {
- // Withdraw digital cash into the wallet.
- let bankInterface: BankServiceHandle = {
- baseUrl: "https://bank.demo.taler.net/",
- bankAccessApiBaseUrl: "https://bank.demo.taler.net/",
- http: createPlatformHttpLib(),
- };
- let user = await BankApi.createRandomBankUser(bankInterface);
- let wop = await BankAccessApi.createWithdrawalOperation(
- bankInterface,
- user,
- "KUDOS:20",
- );
-
- let wallet = new WalletCli(t);
- await wallet.client.call(WalletApiOperation.GetWithdrawalDetailsForUri, {
- talerWithdrawUri: wop.taler_withdraw_uri,
- });
-
- await wallet.runPending();
-
- // Confirm it
-
- await BankApi.confirmWithdrawalOperation(bankInterface, user, wop);
-
- // Withdraw
-
- await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, {
- exchangeBaseUrl: "https://exchange.demo.taler.net/",
- talerWithdrawUri: wop.taler_withdraw_uri,
- });
- await wallet.runUntilDone();
-
- let balanceBefore = await wallet.client.call(
- WalletApiOperation.GetBalances,
- {},
- );
- t.assertTrue(balanceBefore["balances"].length == 1);
-
- const order = {
- summary: "Buy me!",
- amount: "KUDOS:5",
- fulfillment_url: "taler://fulfillment-success/thx",
- };
-
- let merchant = {
- makeInstanceBaseUrl: function (instanceName?: string) {
- return "https://backend.demo.taler.net/instances/donations/";
- },
- port: 0,
- name: "donations",
- };
-
- t.assertTrue("TALER_ENV_FRONTENDS_APITOKEN" in process.env);
-
- await makeTestPayment(
- t,
- {
- merchant,
- wallet,
- order,
- },
- {
- Authorization: `Bearer ${process.env["TALER_ENV_FRONTENDS_APITOKEN"]}`,
- },
- );
-
- await wallet.runUntilDone();
-
- let balanceAfter = await wallet.client.call(
- WalletApiOperation.GetBalances,
- {},
- );
- t.assertTrue(balanceAfter["balances"].length == 1);
- t.assertTrue(
- balanceBefore["balances"][0]["available"] >
- balanceAfter["balances"][0]["available"],
- );
-}
-
-runPaymentDemoTest.excludeByDefault = true;
-runPaymentDemoTest.suites = ["buildbot"];
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts
index 38047a850..f845f4e99 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -69,7 +69,6 @@ import { runPaymentFaultTest } from "./test-payment-fault.js";
import { runPaymentForgettableTest } from "./test-payment-forgettable.js";
import { runPaymentIdempotencyTest } from "./test-payment-idempotency.js";
import { runPaymentMultipleTest } from "./test-payment-multiple.js";
-import { runPaymentDemoTest } from "./test-payment-on-demo.js";
import { runPaymentTransientTest } from "./test-payment-transient.js";
import { runPaymentZeroTest } from "./test-payment-zero.js";
import { runPaywallFlowTest } from "./test-paywall-flow.js";
@@ -160,7 +159,6 @@ const allTests: TestMainFunction[] = [
runMerchantRefundApiTest,
runMerchantSpecPublicOrdersTest,
runPaymentClaimTest,
- runPaymentDemoTest,
runPaymentFaultTest,
runPaymentForgettableTest,
runPaymentIdempotencyTest,