From ec8bd3502f14e90368b8bb7c9d3f81bf9a78c75c Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 10 May 2023 15:43:15 +0700 Subject: [PATCH 01/10] init commit; --- cypress/e2e/explore/wallets.spec.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cypress/e2e/explore/wallets.spec.ts diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts new file mode 100644 index 000000000..f64095140 --- /dev/null +++ b/cypress/e2e/explore/wallets.spec.ts @@ -0,0 +1,27 @@ +const viewports = ["macbook-16", "iphone-xr", "ipad-2"]; + +viewports.forEach((viewport) => { + context(`/explore/wallets on ${viewport}`, () => { + beforeEach(() => { + cy.visit("/explore/wallets"); + cy.viewport(viewport); + }); + + it("should have Choose Wallet section visible and expected text", () => { + it("should be visible with expected text", () => { + cy.checkElementVisibilityAndText( + "section-title-explore-wallets-defichain-wallets", + "CHOOSE A WALLET THAT SUITS YOU" + ); + // cy.checkElementVisibilityAndText( + // "section-sub-title", + // "Experience DeFi with DFI" + // ); + // cy.checkElementVisibilityAndText( + // "section-desc", + // "Our native token unlocks the power of decentralized finance, giving you access to a growing ecosystem of cutting-edge DeFi tools and innovative blockchain applications." + // ); + }); + }); + }); +}); From 56631c92bb79b41610ac29f11d543e84c34ec2f9 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 10 May 2023 16:40:48 +0700 Subject: [PATCH 02/10] add test for Choose Wallet section; --- cypress/e2e/explore/wallets.spec.ts | 34 ++++++++++++++----- src/components/commons/SectionDescription.tsx | 1 + src/components/commons/SectionSubTitle.tsx | 1 + .../_components/ForDailyUseSection.tsx | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index f64095140..34e1b7be7 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -13,15 +13,33 @@ viewports.forEach((viewport) => { "section-title-explore-wallets-defichain-wallets", "CHOOSE A WALLET THAT SUITS YOU" ); - // cy.checkElementVisibilityAndText( - // "section-sub-title", - // "Experience DeFi with DFI" - // ); - // cy.checkElementVisibilityAndText( - // "section-desc", - // "Our native token unlocks the power of decentralized finance, giving you access to a growing ecosystem of cutting-edge DeFi tools and innovative blockchain applications." - // ); + cy.checkElementVisibilityAndText("sub-title", "DeFiChain Wallets"); + cy.checkElementVisibilityAndText( + "desc", + "Gain access to the DeFi landscape through non-custodial wallets designed for a multitude of requirements." + ); }); }); + + it("should have Start exploring section clickable", () => { + if (viewport === "macbook-16") { + cy.findByTestId("start-exploring-button").click({ + scrollBehavior: false, + }); + cy.url().should("include", "#explore-wallets-daily-use-section"); + } + cy.checkElementVisibilityAndText( + "section-title-for-daily-use", + "FOR DAILY USE" + ); + cy.checkElementVisibilityAndText( + "for-daily-use-section-title", + "Daily access to DeFiChain" + ); + // cy.checkElementVisibilityAndText( + // "harness-dfi-power-title", + // "Harness the power of DFI" + // ); + }); }); }); diff --git a/src/components/commons/SectionDescription.tsx b/src/components/commons/SectionDescription.tsx index eab50ee85..c1930bfba 100644 --- a/src/components/commons/SectionDescription.tsx +++ b/src/components/commons/SectionDescription.tsx @@ -9,6 +9,7 @@ export function SectionDescription({ }) { return (
{t("dailyUseSection.title")} From 0adc49b60b120b2e12414fb20b425ec4bacb721b Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 15 May 2023 16:00:44 +0800 Subject: [PATCH 03/10] added Daily Use tests; --- cypress/e2e/explore/wallets.spec.ts | 55 ++++++++++++++----- cypress/fixture/wallets.config.ts | 38 +++++++++++++ .../_components/AdvanceUsageSection.tsx | 4 +- .../_components/ForDailyUseSection.tsx | 15 +++-- 4 files changed, 91 insertions(+), 21 deletions(-) create mode 100644 cypress/fixture/wallets.config.ts diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index 34e1b7be7..2b07e8bfa 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -1,3 +1,5 @@ +import { mobileWallets, webWallets } from "../../fixture/wallets.config"; + const viewports = ["macbook-16", "iphone-xr", "ipad-2"]; viewports.forEach((viewport) => { @@ -8,17 +10,15 @@ viewports.forEach((viewport) => { }); it("should have Choose Wallet section visible and expected text", () => { - it("should be visible with expected text", () => { - cy.checkElementVisibilityAndText( - "section-title-explore-wallets-defichain-wallets", - "CHOOSE A WALLET THAT SUITS YOU" - ); - cy.checkElementVisibilityAndText("sub-title", "DeFiChain Wallets"); - cy.checkElementVisibilityAndText( - "desc", - "Gain access to the DeFi landscape through non-custodial wallets designed for a multitude of requirements." - ); - }); + cy.checkElementVisibilityAndText( + "section-title-explore-wallets-defichain-wallets", + "CHOOSE A WALLET THAT SUITS YOU" + ); + cy.checkElementVisibilityAndText("sub-title", "DeFiChain Wallets"); + cy.checkElementVisibilityAndText( + "desc", + "Gain access to the DeFi landscape through non-custodial wallets designed for a multitude of requirements." + ); }); it("should have Start exploring section clickable", () => { @@ -36,10 +36,35 @@ viewports.forEach((viewport) => { "for-daily-use-section-title", "Daily access to DeFiChain" ); - // cy.checkElementVisibilityAndText( - // "harness-dfi-power-title", - // "Harness the power of DFI" - // ); + + // todo: fix unprocessable character + // cy.checkElementVisibilityAndText( + // "for-daily-use-section-subtitle", + // "These wallets provide lightweight, easy access to DeFiChain’s suite of features. Best suited for users who interact with DeFiChain on a near-daily basis, while not compromising on speed and security of funds."); + }); + + it("should have For Daily Use elements visible and expected links", () => { + webWallets.forEach((webWallet) => { + cy.checkElementVisibilityAndHref(webWallet.testId, webWallet.url); + }); + mobileWallets.forEach((mobileWallet) => { + cy.checkElementVisibilityAndHref(mobileWallet.testId, mobileWallet.url); + }); + }); + + it("should have Suitable For Advanced usage elements visible and expected text", () => { + cy.checkElementVisibilityAndText( + "section-title-advance-usage", + "SUITABLE FOR ADVANCE USAGE" + ); + cy.checkElementVisibilityAndText( + "advance-use-section-title", + "Advanced usage of DeFiChain" + ); + cy.checkElementVisibilityAndText( + "advance-use-section-subtitle", + "Advanced wallets that are suited for complex usage of DeFiChain, such as masternode and multi-signature management along with much more." + ); }); }); }); diff --git a/cypress/fixture/wallets.config.ts b/cypress/fixture/wallets.config.ts new file mode 100644 index 000000000..ac630e6fa --- /dev/null +++ b/cypress/fixture/wallets.config.ts @@ -0,0 +1,38 @@ +/* eslint-disable import/prefer-default-export */ +export const webWallets = [ + { + testId: "brave-link-jly", + url: "https://chrome.google.com/webstore/detail/jellywallet/eegcfalgkkhehkhbjbggbhhlcnckadih", + }, + { + testId: "firefox-link-jly", + url: "https://addons.mozilla.org/en-US/firefox/addon/jellywallet/", + }, + { + testId: "chrome-link-jly", + url: "https://chrome.google.com/webstore/detail/jellywallet/eegcfalgkkhehkhbjbggbhhlcnckadih", + }, +]; + +export const mobileWallets = [ + { + wallet: "dfxWallet", + testId: "google-play-link-dfx", + url: "https://play.google.com/store/apps/details?id=com.defichain.app.dfx", + }, + { + wallet: "dfxWallet", + testId: "appstore-link-dfx", + url: "https://apps.apple.com/app/id1582633093", + }, + { + wallet: "lightWallet", + testId: "google-play-link-dfc", + url: "https://play.google.com/store/apps/details?id=com.defichain.app", + }, + { + wallet: "lightWallet", + testId: "appstore-link-dfc", + url: "https://apps.apple.com/us/app/defichain-wallet/id1572472820", + }, +]; diff --git a/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx b/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx index 8623bb0ca..510c5e0f5 100644 --- a/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx +++ b/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx @@ -25,7 +25,7 @@ export function AdvanceUsageSection() { "lg:text-[60px] lg:leading-[72px] md:text-[40px] md:leading-[44px] text-[32px] leading-[36px]", "text-dark-1000 md:text-center text-left" )} - data-testid="AdvanceUseSection.Title" + data-testid="advance-use-section-title" > {t("advanceUseSection.title")} @@ -35,7 +35,7 @@ export function AdvanceUsageSection() { "lg:tracking-normal tracking-[0.03em]", "text-dark-700 md:text-center text-left" )} - data-testid="AdvanceUseSection.Subtitle" + data-testid="advance-use-section-subtitle" > {t("advanceUseSection.subtitle")}

diff --git a/src/pages/explore/wallets/_components/ForDailyUseSection.tsx b/src/pages/explore/wallets/_components/ForDailyUseSection.tsx index ccc92ff2a..41a7ee8f1 100644 --- a/src/pages/explore/wallets/_components/ForDailyUseSection.tsx +++ b/src/pages/explore/wallets/_components/ForDailyUseSection.tsx @@ -35,7 +35,7 @@ export function ForDailyUseSection() { "lg:tracking-normal tracking-[0.03em]", "text-dark-700 md:text-center text-left" )} - data-testid="ForDailyUseSection.Subtitle" + data-testid="for-daily-use-section-subtitle" > {t("dailyUseSection.subtitle")}

@@ -45,18 +45,20 @@ export function ForDailyUseSection() { title={t("dailyUseSection.entries.DFC.title")} desc={t("dailyUseSection.entries.DFC.desc")} imageSrc="/assets/img/explore/explore-wallet-dfi.png" - testid="DailyUseSection.Dfc" + testid="daily-use-section-dfc" >
@@ -65,18 +67,20 @@ export function ForDailyUseSection() { title={t("dailyUseSection.entries.DFX.title")} desc={t("dailyUseSection.entries.DFX.desc")} imageSrc="/assets/img/explore/explore-wallet-dfx.png" - testid="DailyUseSection.Dfx" + testid="daily-use-section-dfx" >
@@ -85,23 +89,26 @@ export function ForDailyUseSection() { title={t("dailyUseSection.entries.JLY.title")} desc={t("dailyUseSection.entries.JLY.desc")} imageSrc="/assets/img/explore/explore-wallet-jellywallet.png" - testid="DailyUseSection.Jly" + testid="daily-use-section-jly" >
From 6a214a6b22e4bb455b387410a327f599982b4cb9 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 17 May 2023 13:52:02 +0800 Subject: [PATCH 04/10] added Desktop Wallets links tests; --- cypress/e2e/explore/wallets.spec.ts | 17 ++++++++- cypress/fixture/wallets.config.ts | 37 ++++++++++++++++++- .../_components/AdvanceUsageSection.tsx | 9 +++-- .../_components/DynamicDownloadCard.tsx | 2 + 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index 2b07e8bfa..51ae30754 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -1,4 +1,8 @@ -import { mobileWallets, webWallets } from "../../fixture/wallets.config"; +import { + desktopWalletsUrls, + mobileWalletsUrls, + webWallets, +} from "../../fixture/wallets.config"; const viewports = ["macbook-16", "iphone-xr", "ipad-2"]; @@ -47,7 +51,7 @@ viewports.forEach((viewport) => { webWallets.forEach((webWallet) => { cy.checkElementVisibilityAndHref(webWallet.testId, webWallet.url); }); - mobileWallets.forEach((mobileWallet) => { + mobileWalletsUrls.forEach((mobileWallet) => { cy.checkElementVisibilityAndHref(mobileWallet.testId, mobileWallet.url); }); }); @@ -66,5 +70,14 @@ viewports.forEach((viewport) => { "Advanced wallets that are suited for complex usage of DeFiChain, such as masternode and multi-signature management along with much more." ); }); + + it("should have Desktop Wallets links visible and expected text", () => { + desktopWalletsUrls.forEach((desktopWallet) => { + cy.checkElementVisibilityAndHref( + desktopWallet.testId, + desktopWallet.url + ); + }); + }); }); }); diff --git a/cypress/fixture/wallets.config.ts b/cypress/fixture/wallets.config.ts index ac630e6fa..a06ed5cbd 100644 --- a/cypress/fixture/wallets.config.ts +++ b/cypress/fixture/wallets.config.ts @@ -14,7 +14,7 @@ export const webWallets = [ }, ]; -export const mobileWallets = [ +export const mobileWalletsUrls = [ { wallet: "dfxWallet", testId: "google-play-link-dfx", @@ -36,3 +36,38 @@ export const mobileWallets = [ url: "https://apps.apple.com/us/app/defichain-wallet/id1572472820", }, ]; + +export const desktopWalletsUrls = [ + { + testId: "github-link-advance-use-section-dfc-win", + url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-Setup-3.2.9.exe", + }, + { + testId: "github-link-advance-use-section-dfc-mac", + url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-3.2.9.dmg", + }, + { + testId: "github-link-advance-use-section-dfc-linux", + url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-3.2.9.AppImage", + }, + { + testId: "github-link-rasp-pi", + url: "https://github.com/Martin8617/Defi-Wallet-for-Raspberry-Pi", + }, + { + testId: "github-link-advance-use-section-cli-mac", + url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-apple-darwin18.tar.gz", + }, + { + testId: "github-link-advance-use-section-cli-win", + url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-w64-mingw32.zip", + }, + { + testId: "github-link-advance-use-section-cli-linux", + url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-pc-linux-gnu.tar.gz", + }, + { + testId: "github-link-advance-use-section-electrum", + url: "https://github.com/BirthdayResearch/defichain-electrum/releases/latest", + }, +]; diff --git a/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx b/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx index 510c5e0f5..6266cb8fd 100644 --- a/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx +++ b/src/pages/explore/wallets/_components/AdvanceUsageSection.tsx @@ -46,7 +46,7 @@ export function AdvanceUsageSection() { title={t("advanceUseSection.entries.DFC.title")} desc={t("advanceUseSection.entries.DFC.desc")} imageSrc="/assets/img/explore/explore-wallet-dfiwallet.png" - testid="AdvanceUseSection.Dfc" + testid="advance-use-section-dfc" repoName="defiCh/app" keywords={{ mac: ".dmg", @@ -59,9 +59,10 @@ export function AdvanceUsageSection() { title={t("advanceUseSection.entries.RPI.title")} desc={t("advanceUseSection.entries.RPI.desc")} imageSrc="/assets/img/explore/explore-wallet-dfinode.png" - testid="AdvanceUseSection.Rpi" + testid="advance-use-section-rpi" > } - testid="AdvanceUseSection.DFIElectrum" + testid="advance-use-section-electrum" repoName="BirthdayResearch/defichain-electrum" keywords={{ win: ".exe", diff --git a/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx b/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx index e308f75fc..33135d523 100644 --- a/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx +++ b/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx @@ -69,6 +69,7 @@ export function DynamicDownloadCard( ) : ( @@ -77,6 +78,7 @@ export function DynamicDownloadCard( downloadLinks && downloadLinks[key] ? ( Date: Wed, 17 May 2023 14:02:34 +0800 Subject: [PATCH 05/10] fix unprocessable character tests; --- cypress/e2e/explore/wallets.spec.ts | 10 +++++----- public/locales/en-US/page-explore-wallets.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index 51ae30754..eb207151c 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -25,7 +25,7 @@ viewports.forEach((viewport) => { ); }); - it("should have Start exploring section clickable", () => { + it.only("should have Start exploring section clickable", () => { if (viewport === "macbook-16") { cy.findByTestId("start-exploring-button").click({ scrollBehavior: false, @@ -41,10 +41,10 @@ viewports.forEach((viewport) => { "Daily access to DeFiChain" ); - // todo: fix unprocessable character - // cy.checkElementVisibilityAndText( - // "for-daily-use-section-subtitle", - // "These wallets provide lightweight, easy access to DeFiChain’s suite of features. Best suited for users who interact with DeFiChain on a near-daily basis, while not compromising on speed and security of funds."); + cy.checkElementVisibilityAndText( + "for-daily-use-section-subtitle", + "These wallets provide lightweight, easy access to DeFiChain’s suite of features. Best suited for users who interact with DeFiChain on a near-daily basis, while not compromising on speed and security of funds." + ); }); it("should have For Daily Use elements visible and expected links", () => { diff --git a/public/locales/en-US/page-explore-wallets.json b/public/locales/en-US/page-explore-wallets.json index 041c20302..8a2892fac 100644 --- a/public/locales/en-US/page-explore-wallets.json +++ b/public/locales/en-US/page-explore-wallets.json @@ -18,7 +18,7 @@ "dailyUseSection": { "sectionTitle": "FOR DAILY USE", "title": "Daily access to DeFiChain", - "subtitle": "These wallets provide lightweight, easy access to DeFiChain’s suite of features. \u2028Best suited for users who interact with DeFiChain on a near-daily basis, while not compromising on speed and security of funds.", + "subtitle": "These wallets provide lightweight, easy access to DeFiChain’s suite of features. Best suited for users who interact with DeFiChain on a near-daily basis, while not compromising on speed and security of funds.", "entries": { "DFC": { "title": "Light Wallet", From 4557be1d3de18831f96dae8ed3b16c70b9d67c2b Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 17 May 2023 14:03:43 +0800 Subject: [PATCH 06/10] remove only --- cypress/e2e/explore/wallets.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index eb207151c..e9c690ce2 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -25,7 +25,7 @@ viewports.forEach((viewport) => { ); }); - it.only("should have Start exploring section clickable", () => { + it("should have Start exploring section clickable", () => { if (viewport === "macbook-16") { cy.findByTestId("start-exploring-button").click({ scrollBehavior: false, From 228908cf57344857bb41c6ac90b4ea625bd0b34f Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 23 May 2023 12:34:48 +0800 Subject: [PATCH 07/10] fix test ids --- cypress/e2e/explore/wallets.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index e9c690ce2..d3302e582 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -18,9 +18,12 @@ viewports.forEach((viewport) => { "section-title-explore-wallets-defichain-wallets", "CHOOSE A WALLET THAT SUITS YOU" ); - cy.checkElementVisibilityAndText("sub-title", "DeFiChain Wallets"); cy.checkElementVisibilityAndText( - "desc", + "section-header-explore-dex-decentralized-exchange", + "DeFiChain Wallets" + ); + cy.checkElementVisibilityAndText( + "section-desc-explore-dex-decentralized-exchange", "Gain access to the DeFi landscape through non-custodial wallets designed for a multitude of requirements." ); }); From 1e2746e726589e071f814be51353bc6251e671e3 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 23 May 2023 13:47:40 +0800 Subject: [PATCH 08/10] add fetching of the version for desktop wallets --- cypress/e2e/explore/wallets.spec.ts | 37 ++++++++++++--- cypress/fixture/wallets.config.ts | 73 +++++++++++++++-------------- cypress/support/commands.ts | 19 ++++++++ 3 files changed, 89 insertions(+), 40 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index d3302e582..8fdcb9737 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -75,12 +75,37 @@ viewports.forEach((viewport) => { }); it("should have Desktop Wallets links visible and expected text", () => { - desktopWalletsUrls.forEach((desktopWallet) => { - cy.checkElementVisibilityAndHref( - desktopWallet.testId, - desktopWallet.url - ); - }); + let defichainAppVersion: string; + let ainVersion: string; + + const username = "mikhail-zlochevskyi"; + const password = + "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"; + + cy.getLatestVersion("DeFiCh/ain", username, password) + .then((latestVersion1: any) => { + ainVersion = latestVersion1; + + return cy.getLatestVersion( + "BirthdayResearch/defichain-app", + username, + password + ); + }) + .then((latestVersion2: any) => { + defichainAppVersion = latestVersion2; + + const walletsList = desktopWalletsUrls( + ainVersion, + defichainAppVersion + ); + walletsList.forEach((desktopWallet) => { + cy.checkElementVisibilityAndHref( + desktopWallet.testId, + desktopWallet.url + ); + }); + }); }); }); }); diff --git a/cypress/fixture/wallets.config.ts b/cypress/fixture/wallets.config.ts index a06ed5cbd..5ba1e379d 100644 --- a/cypress/fixture/wallets.config.ts +++ b/cypress/fixture/wallets.config.ts @@ -37,37 +37,42 @@ export const mobileWalletsUrls = [ }, ]; -export const desktopWalletsUrls = [ - { - testId: "github-link-advance-use-section-dfc-win", - url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-Setup-3.2.9.exe", - }, - { - testId: "github-link-advance-use-section-dfc-mac", - url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-3.2.9.dmg", - }, - { - testId: "github-link-advance-use-section-dfc-linux", - url: "https://github.com/BirthdayResearch/defichain-app/releases/download/v3.2.9/DeFi-Wallet-3.2.9.AppImage", - }, - { - testId: "github-link-rasp-pi", - url: "https://github.com/Martin8617/Defi-Wallet-for-Raspberry-Pi", - }, - { - testId: "github-link-advance-use-section-cli-mac", - url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-apple-darwin18.tar.gz", - }, - { - testId: "github-link-advance-use-section-cli-win", - url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-w64-mingw32.zip", - }, - { - testId: "github-link-advance-use-section-cli-linux", - url: "https://github.com/DeFiCh/ain/releases/download/v3.2.8/defichain-3.2.8-x86_64-pc-linux-gnu.tar.gz", - }, - { - testId: "github-link-advance-use-section-electrum", - url: "https://github.com/BirthdayResearch/defichain-electrum/releases/latest", - }, -]; +export function desktopWalletsUrls( + ainVersion: string, + defichainAppVersion: string +) { + return [ + { + testId: "github-link-advance-use-section-dfc-win", + url: `https://github.com/BirthdayResearch/defichain-app/releases/download/v${defichainAppVersion}/DeFi-Wallet-Setup-${defichainAppVersion}.exe`, + }, + { + testId: "github-link-advance-use-section-dfc-mac", + url: `https://github.com/BirthdayResearch/defichain-app/releases/download/v${defichainAppVersion}/DeFi-Wallet-${defichainAppVersion}.dmg`, + }, + { + testId: "github-link-advance-use-section-dfc-linux", + url: `https://github.com/BirthdayResearch/defichain-app/releases/download/v${defichainAppVersion}/DeFi-Wallet-${defichainAppVersion}.AppImage`, + }, + { + testId: "github-link-rasp-pi", + url: "https://github.com/Martin8617/Defi-Wallet-for-Raspberry-Pi", + }, + { + testId: "github-link-advance-use-section-cli-mac", + url: `https://github.com/DeFiCh/ain/releases/download/v${ainVersion}/defichain-${ainVersion}-x86_64-apple-darwin18.tar.gz`, + }, + { + testId: "github-link-advance-use-section-cli-win", + url: `https://github.com/DeFiCh/ain/releases/download/v${ainVersion}/defichain-${ainVersion}-x86_64-w64-mingw32.zip`, + }, + { + testId: "github-link-advance-use-section-cli-linux", + url: `https://github.com/DeFiCh/ain/releases/download/v${ainVersion}/defichain-${ainVersion}-x86_64-pc-linux-gnu.tar.gz`, + }, + { + testId: "github-link-advance-use-section-electrum", + url: "https://github.com/BirthdayResearch/defichain-electrum/releases/latest", + }, + ]; +} diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 3ffef593a..c1b7156df 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -17,6 +17,11 @@ declare global { testId: string, expectedHref: string ): Chainable; + getLatestVersion( + repo: string, + username: string, + password: string + ): Chainable; } } } @@ -38,6 +43,20 @@ Cypress.Commands.add( } ); +Cypress.Commands.add("getLatestVersion", (repo, username, password) => { + return cy + .request({ + method: "GET", + url: `https://api.github.com/repos/${repo}/releases/latest`, + auth: { + username, + password, + }, + }) + .its("body.tag_name") + .then((tag_name) => tag_name.replaceAll("v", "")); +}); + Cypress.Commands.add("interceptServerSideWait", (exec: () => void) => { cy.intercept("GET", "/_next/data/**").as("nextData"); exec(); From ab40916d90ce9682d84b2a0be143e9cf6bd4561c Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 23 May 2023 14:02:31 +0800 Subject: [PATCH 09/10] update github key --- cypress/e2e/explore/wallets.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index 8fdcb9737..c6f6e5915 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -80,7 +80,7 @@ viewports.forEach((viewport) => { const username = "mikhail-zlochevskyi"; const password = - "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"; + "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"; cy.getLatestVersion("DeFiCh/ain", username, password) .then((latestVersion1: any) => { From 8dfe07a8e7f234a1cfa36f7defa66cc97623d528 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 23 May 2023 14:18:44 +0800 Subject: [PATCH 10/10] update github key; add auth to download link builder; --- cypress/e2e/explore/wallets.spec.ts | 2 +- .../wallets/_components/DynamicDownloadCard.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/explore/wallets.spec.ts b/cypress/e2e/explore/wallets.spec.ts index c6f6e5915..4b679c121 100644 --- a/cypress/e2e/explore/wallets.spec.ts +++ b/cypress/e2e/explore/wallets.spec.ts @@ -80,7 +80,7 @@ viewports.forEach((viewport) => { const username = "mikhail-zlochevskyi"; const password = - "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"; + "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"; cy.getLatestVersion("DeFiCh/ain", username, password) .then((latestVersion1: any) => { diff --git a/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx b/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx index 33135d523..6989bfc9c 100644 --- a/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx +++ b/src/pages/explore/wallets/_components/DynamicDownloadCard.tsx @@ -96,7 +96,15 @@ export async function getGitHubAssets( repoName: string ): Promise { const baseUrl = `https://api.github.com/repos/${repoName}/releases/latest`; - const res = await fetch(baseUrl); + const username = "mikhail-zlochevskyi"; + const password = + "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"; + + const res = await fetch(baseUrl, { + headers: { + Authorization: `Basic ${btoa(`${username}:${password}`)}`, + }, + }); const json = await res.json(); const { assets } = json;