Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod v0.4.36 #731

Merged
merged 17 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
VITE_FEEDBACK: https://feedback-staging.mutinywallet.com
VITE_SCORER: https://scorer-staging.mutinywallet.com
VITE_PRIMAL: https://primal-cache.mutinywallet.com/api
run: pnpm exec playwright test
run: pnpm exec playwright test --grep-invert @slow
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.mutinywallet.mutinywallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36
versionName "0.4.35"
versionCode 37
versionName "0.4.36"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-mlkit-barcode-scanning')
implementation project(':capacitor-app')
implementation project(':capacitor-browser')
implementation project(':capacitor-app-launcher')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-haptics')
Expand Down
4 changes: 2 additions & 2 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ project(':capacitor-mlkit-barcode-scanning').projectDir = new File('../node_modu
include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app/android')

include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../node_modules/.pnpm/@capacitor+browser@5.0.6_@[email protected]/node_modules/@capacitor/browser/android')
include ':capacitor-app-launcher'
project(':capacitor-app-launcher').projectDir = new File('../node_modules/.pnpm/@capacitor+app-launcher@5.0.6_@[email protected]/node_modules/@capacitor/app-launcher/android')

include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/clipboard/android')
Expand Down
52 changes: 0 additions & 52 deletions e2e/load.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,3 @@ test("initial load", async ({ page }) => {
console.log("Page loaded.");
});

test("first receive", async ({ page }) => {
// Click the receive button
await page.click("text=Receive");

// Expect the url to conain receive
await expect(page).toHaveURL(/.*receive/);

// At least one h1 should show "0 sats"
await expect(page.locator("h1")).toContainText(["0 SATS"]);

// At least one h2 should show "0 USD"
await expect(page.locator("h2")).toContainText(["$0 USD"]);

// Click the 10k button
await page.click("text=10k");

// Now the h1 should show "10,000 sats"
await expect(page.locator("h1")).toContainText(["10,000 SATS"]);

// Click the "Set Amount" button
await page.click("text=Set Amount");

// There should be a button with the text "Continue" and it should not be disabled
const continueButton = await page.locator("button", { hasText: "Continue" });
await expect(continueButton).not.toBeDisabled();

// Wait one second
// TODO: figure out how to not get an error without waiting
await page.waitForTimeout(1000);

continueButton.click();

await expect(
page.getByText("Keep Mutiny open to complete the payment.")
).toBeVisible();

// Locate an SVG inside a div with id "qr"
const qrCode = await page.locator("#qr > svg");

await expect(qrCode).toBeVisible();

const value = await qrCode.getAttribute("value");

// The SVG's value property includes "bitcoin:t"
expect(value).toContain("bitcoin:t");

// Now click thie "Edit" button
await page.click("text=Edit");

// There should not be an h1 that says "Error"
await expect(page.locator("h1")).not.toContainText(["Error"]);
});
2 changes: 1 addition & 1 deletion e2e/restore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
});

test("restore from seed", async ({ page }) => {
test("restore from seed @slow", async ({ page }) => {
// should have 100k sats on-chain
const TEST_SEED_WORDS =
"rival hood review write spoon tide orange ill opera enrich clip acoustic";
Expand Down
92 changes: 92 additions & 0 deletions e2e/roundtrip.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { test, expect } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
});

test("rountrip receive and send", async ({ page }) => {
// Click the receive button
await page.click("text=Receive");

// Expect the url to conain receive
await expect(page).toHaveURL(/.*receive/);

// At least one h1 should show "0 sats"
await expect(page.locator("h1")).toContainText(["0 SATS"]);

// At least one h2 should show "0 USD"
await expect(page.locator("h2")).toContainText(["$0 USD"]);

// Click the 100k button
await page.click("text=100k");

// Now the h1 should show "10,000 sats"
await expect(page.locator("h1")).toContainText(["100,000 SATS"]);

// Click the "Set Amount" button
await page.click("text=Set Amount");

// There should be a button with the text "Continue" and it should not be disabled
const continueButton = await page.locator("button", { hasText: "Continue" });
await expect(continueButton).not.toBeDisabled();

// Wait one second
// TODO: figure out how to not get an error without waiting
await page.waitForTimeout(1000);

continueButton.click();

await expect(
page.getByText("Keep Mutiny open to complete the payment.")
).toBeVisible();

// Locate an SVG inside a div with id "qr"
const qrCode = await page.locator("#qr > svg");

await expect(qrCode).toBeVisible();

const value = await qrCode.getAttribute("value");

// The SVG's value property includes "bitcoin:t"
expect(value).toContain("bitcoin:t");

const lightningInvoice = value?.split("lightning=")[1];

// Post the lightning invoice to the server
const _response = await fetch("https://faucet.mutinynet.com/api/lightning", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
bolt11: lightningInvoice
})
});

// Wait for an h1 to appear in the dom that says "Payment Received"
await page.waitForSelector("text=Payment Received", { timeout: 30000 });

// Click the "Nice" button
await page.click("text=Nice");

// Now we send
await page.click("text=Send");

// In the textarea with the placeholder "bitcoin:..." type [email protected]
const sendInput = await page.locator("textarea");
await sendInput.fill("[email protected]");

await page.click("text=Continue");

await page.click("text=Set Amount");

await page.click("text=10k");

await page.click("text=Set Amount");

await page.click("text=Confirm Send");

// Wait for an h1 to appear in the dom that says "Payment Received"
await page.waitForSelector("text=Payment Sent", { timeout: 30000 });
});

Loading