From a65be8c6b989440ae967a88bfb1379795ec88d52 Mon Sep 17 00:00:00 2001 From: Dylan Companjen Date: Mon, 13 Jun 2022 20:41:54 +0200 Subject: [PATCH] test: add myNode & Start9 e2e tests --- tests/e2e/createWallets.spec.ts | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/e2e/createWallets.spec.ts b/tests/e2e/createWallets.spec.ts index 685a2618ee..49657867aa 100644 --- a/tests/e2e/createWallets.spec.ts +++ b/tests/e2e/createWallets.spec.ts @@ -171,6 +171,50 @@ test.describe("Create or connect wallets", () => { await commonCreateWalletSuccessCheck({ browser, welcomePage, $document }); }); + test("successfully connects to myNode", async () => { + const { browser, welcomePage, $document } = + await commonCreateWalletUserCreate(); + + const connectButton = await getByText($document, "myNode"); + connectButton.click(); + + // wait for the field label instead of headline (headline text already exists on the page before) + await waitFor(() => getByText($document, "lndconnect REST URL")); + + const macaroon = + "AgEDbG5kAvgBAwoQ4hM6HKwsW01W5E4y3GTIVRIBMBoWCgdhZGRyZXNzEgRyZWFkEgV3cml0ZRoTCgRpbmZvEgRyZWFkEgV3cml0ZRoXCghpbnZvaWNlcxIEcmVhZBIFd3JpdGUaIQoIbWFjYXJvb24SCGdlbmVyYXRlEgRyZWFkEgV3cml0ZRoWCgdtZXNzYWdlEgRyZWFkEgV3cml0ZRoXCghvZmZjaGFpbhIEcmVhZBIFd3JpdGUaFgoHb25jaGFpbhIEcmVhZBIFd3JpdGUaFAoFcGVlcnMSBHJlYWQSBXdyaXRlGhgKBnNpZ25lchIIZ2VuZXJhdGUSBHJlYWQAAAYgxPl4Pghz-lCiCRgG9eu5GcXcQy4zgAtAFGOtpkhd8O0"; + const restApiUrl = `lndconnect://lnd1.regtest.getalby.com?cert=&macaroon=${macaroon}`; + const lndConnectUrlField = await getByLabelText( + $document, + "lndconnect REST URL" + ); + await lndConnectUrlField.type(restApiUrl); + + await commonCreateWalletSuccessCheck({ browser, welcomePage, $document }); + }); + + test("successfully connects to Start9", async () => { + const { browser, welcomePage, $document } = + await commonCreateWalletUserCreate(); + + const connectButton = await getByText($document, "Start9"); + connectButton.click(); + + // wait for the field label instead of headline (headline text already exists on the page before) + await waitFor(() => getByText($document, "lndconnect REST URL")); + + const macaroon = + "AgEDbG5kAvgBAwoQ4hM6HKwsW01W5E4y3GTIVRIBMBoWCgdhZGRyZXNzEgRyZWFkEgV3cml0ZRoTCgRpbmZvEgRyZWFkEgV3cml0ZRoXCghpbnZvaWNlcxIEcmVhZBIFd3JpdGUaIQoIbWFjYXJvb24SCGdlbmVyYXRlEgRyZWFkEgV3cml0ZRoWCgdtZXNzYWdlEgRyZWFkEgV3cml0ZRoXCghvZmZjaGFpbhIEcmVhZBIFd3JpdGUaFgoHb25jaGFpbhIEcmVhZBIFd3JpdGUaFAoFcGVlcnMSBHJlYWQSBXdyaXRlGhgKBnNpZ25lchIIZ2VuZXJhdGUSBHJlYWQAAAYgxPl4Pghz-lCiCRgG9eu5GcXcQy4zgAtAFGOtpkhd8O0"; + const restApiUrl = `lndconnect://lnd1.regtest.getalby.com?cert=&macaroon=${macaroon}`; + const lndConnectUrlField = await getByLabelText( + $document, + "lndconnect REST URL" + ); + await lndConnectUrlField.type(restApiUrl); + + await commonCreateWalletSuccessCheck({ browser, welcomePage, $document }); + }); + test("successfully connects to Eclair", async () => { const { browser, welcomePage, $document } = await commonCreateWalletUserCreate();