From 1e9e915085cde817125d8cd0c9961b9252a05751 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 18 Aug 2019 19:42:21 +0200 Subject: bump version / implement integrationtest cmd --- src/headless/taler-wallet-cli.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src/headless/taler-wallet-cli.ts') diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 9c4a84e3e..6e2190236 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -17,6 +17,8 @@ import commander = require("commander"); import os = require("os"); import { getDefaultNodeWallet, withdrawTestBalance } from "./helpers"; +import { MerchantBackendConnection } from "./merchant"; +import { runIntegrationTest } from "./integrationtest"; const program = new commander.Command(); program.version("0.0.1"); @@ -36,7 +38,7 @@ program }); program - .command("balance", undefined, { isDefault: true }) + .command("balance") .description("show wallet balance") .action(async () => { console.log("balance command called"); @@ -49,6 +51,35 @@ program process.exit(0); }); + +program + .command("integrationtest") + .option('-e, --exchange ', 'exchange base URL', "https://exchange.test.taler.net/") + .option('-m, --merchant ', 'merchant base URL', "https://backend.test.taler.net/") + .option('-m, --merchant-instance ', 'merchant instance', "default") + .option('-m, --merchant-api-key ', 'merchant API key', "sandbox") + .option('-b, --bank ', 'bank base URL', "https://bank.test.taler.net/") + .option('-w, --withdraw-amount ', 'amount to withdraw', "TESTKUDOS:10") + .option('-s, --spend-amount ', 'amount to spend', "TESTKUDOS:5") + .description("Run integration test with bank, exchange and merchant.") + .action(async (cmdObj) => { + + await runIntegrationTest({ + amountToSpend: cmdObj.spendAmount, + amountToWithdraw: cmdObj.withdrawAmount, + bankBaseUrl: cmdObj.bank, + exchangeBaseUrl: cmdObj.exchange, + merchantApiKey: cmdObj.merchantApiKey, + merchantBaseUrl: cmdObj.merchant, + merchantInstance: cmdObj.merchantInstance, + }).catch(err => { + console.error("Failed with exception:"); + console.error(err); + }); + + process.exit(0); + }); + // error on unknown commands program.on("command:*", function() { console.error( -- cgit v1.2.3