From b81ea1b4b75c6f326d331c5c23d94e807b895563 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 23 Apr 2023 23:08:37 +0200 Subject: harness: adjust to merchant API breaking changes, remove test that doesn't belong --- .../test-merchant-instances-urls.ts | 12 ++- .../src/integrationtests/test-payment-on-demo.ts | 114 --------------------- .../src/integrationtests/testrunner.ts | 2 - 3 files changed, 10 insertions(+), 118 deletions(-) delete mode 100644 packages/taler-harness/src/integrationtests/test-payment-on-demo.ts (limited to 'packages/taler-harness/src/integrationtests') 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 - */ - -/** - * 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, -- cgit v1.2.3