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

chore(e2e): explore-wallets #664

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
83 changes: 83 additions & 0 deletions cypress/e2e/explore/wallets.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import {
desktopWalletsUrls,
mobileWalletsUrls,
webWallets,
} from "../../fixture/wallets.config";

const viewports = ["macbook-16", "iphone-xr", "ipad-2"];

viewports.forEach((viewport) => {
context(`/explore/wallets on ${viewport}`, () => {
beforeEach(() => {
cy.visit("/explore/wallets");
cy.viewport(<Cypress.ViewportPreset>viewport);
});

it("should have Choose Wallet section visible and 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."
);
});

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(
"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);
});
mobileWalletsUrls.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."
);
});

it("should have Desktop Wallets links visible and expected text", () => {
desktopWalletsUrls.forEach((desktopWallet) => {
cy.checkElementVisibilityAndHref(
desktopWallet.testId,
desktopWallet.url
);
});
});
});
});
73 changes: 73 additions & 0 deletions cypress/fixture/wallets.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* 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 mobileWalletsUrls = [
{
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",
},
];

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will not work without proper versioning

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",
},
];
2 changes: 1 addition & 1 deletion public/locales/en-US/page-explore-wallets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 7 additions & 6 deletions src/pages/explore/wallets/_components/AdvanceUsageSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
</h2>
Expand All @@ -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")}
</p>
Expand All @@ -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",
Expand All @@ -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"
>
<CardLink
testId="github-link-rasp-pi"
url="https://github.com/Martin8617/Defi-Wallet-for-Raspberry-Pi"
descText="View on"
text={IconType.GITHUB}
Expand All @@ -72,7 +73,7 @@ export function AdvanceUsageSection() {
title={t("advanceUseSection.entries.CLI.title")}
desc={t("advanceUseSection.entries.CLI.desc")}
imageSrc="/assets/img/explore/explore-wallet-cli.png"
testid="AdvanceUseSection.Cli"
testid="advance-use-section-cli"
repoName="defiCh/ain"
keywords={{
mac: "apple",
Expand All @@ -85,7 +86,7 @@ export function AdvanceUsageSection() {
title={t("advanceUseSection.entries.DFIElectrum.title")}
desc={t("advanceUseSection.entries.DFIElectrum.desc")}
imageSrc={<FaReact className="fill-brand-100 w-[72px] h-[63px]" />}
testid="AdvanceUseSection.DFIElectrum"
testid="advance-use-section-electrum"
repoName="BirthdayResearch/defichain-electrum"
keywords={{
win: ".exe",
Expand Down
2 changes: 2 additions & 0 deletions src/pages/explore/wallets/_components/DynamicDownloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function DynamicDownloadCard(
<CardLink
descText="View on"
text={IconType.GITHUB}
testId="github-link-advance-use-section-electrum"
url={`https://github.com/${props.repoName}/releases/latest`}
/>
) : (
Expand All @@ -77,6 +78,7 @@ export function DynamicDownloadCard(
downloadLinks && downloadLinks[key] ? (
<CardLink
key={key}
testId={`github-link-${props.testid}-${key}`}
descText="Download for"
text={IconType[OSIconMapping[key]]}
url={downloadLinks[key]}
Expand Down
17 changes: 12 additions & 5 deletions src/pages/explore/wallets/_components/ForDailyUseSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function ForDailyUseSection() {
"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="ForDailyUseSection.Title"
data-testid="for-daily-use-section-title"
>
{t("dailyUseSection.title")}
</h2>
Expand All @@ -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")}
</p>
Expand All @@ -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"
>
<div className="flex flex-row lg:gap-x-4 gap-x-3">
<CardLink
url="https://apps.apple.com/us/app/defichain-wallet/id1572472820"
descText="Get It On"
text={IconType.APPSTORE}
testId="appstore-link-dfc"
/>
<CardLink
url="https://play.google.com/store/apps/details?id=com.defichain.app"
descText="Get It On"
text={IconType.GOOGLE_PLAY}
testId="google-play-link-dfc"
/>
</div>
</DownloadCard>
Expand All @@ -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"
>
<div className="flex flex-row lg:gap-x-4 gap-x-3">
<CardLink
url="https://apps.apple.com/app/id1582633093"
descText="Get It On"
text={IconType.APPSTORE}
testId="appstore-link-dfx"
/>
<CardLink
url="https://play.google.com/store/apps/details?id=com.defichain.app.dfx"
descText="Get It On"
text={IconType.GOOGLE_PLAY}
testId="google-play-link-dfx"
/>
</div>
</DownloadCard>
Expand All @@ -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"
>
<div className="flex items-center lg:space-x-4 space-x-3 text-lg font-medium">
<CardLink
url="https://chrome.google.com/webstore/detail/jellywallet/eegcfalgkkhehkhbjbggbhhlcnckadih"
descText="Download For"
text={IconType.CHROME}
testId="chrome-link-jly"
/>
<CardLink
url="https://addons.mozilla.org/en-US/firefox/addon/jellywallet/"
descText="Download For"
text={IconType.FIREFOX}
testId="firefox-link-jly"
/>
<CardLink
url="https://chrome.google.com/webstore/detail/jellywallet/eegcfalgkkhehkhbjbggbhhlcnckadih"
descText="Download For"
text={IconType.BRAVE}
testId="brave-link-jly"
/>
</div>
</DownloadCard>
Expand Down