Skip to content

Commit

Permalink
fix: 🩹 Reactivating Solana Swap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VicAlbr committed Dec 13, 2024
1 parent 013e3ac commit 79a7907
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 61 deletions.
7 changes: 6 additions & 1 deletion apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ export class AccountPage extends AppPage {
await this.viewDetailsButton.click();
}

@step("Click on last operation ($0)")
@step("Click on selected ($0) last operation")
async selectAndClickOnLastOperation(operation: string) {
await this.selectSpecificOperation(operation).first().click();
}

@step("Click on last operation")
async clickOnLastOperation() {
await this.operationRows.first().click();
}

@step("Click Stake button on banner")
async clickBannerCTA() {
await this.stakeBannerButton.scrollIntoViewIfNeeded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for (const currency of currencies) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.portfolio.openAddAccountModal();
await app.addAccount.expectModalVisiblity();
Expand Down
22 changes: 7 additions & 15 deletions apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { test } from "../../fixtures/common";
import { Account } from "@ledgerhq/live-common/e2e/enum/Account";
import { OperationType } from "@ledgerhq/live-common/e2e/enum/OperationType";
import { Delegate } from "../../models/Delegate";
import { addTmsLink } from "tests/utils/allureUtils";
import { getDescription } from "../../utils/customJsonReporter";
Expand Down Expand Up @@ -29,15 +28,15 @@ const validators = [
xrayTicket: "B2CQA-2731, B2CQA-2763",
},
{
delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Chorus One"), //Issue with the provider - CI ✅ because failling code is commented - LIVE-14500
delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Chorus One"),
xrayTicket: "B2CQA-2730, B2CQA-2764",
},
{
delegate: new Delegate(Account.NEAR_2, "0.01", "ledgerbyfigment.poolv1.near"),
xrayTicket: "B2CQA-2732, B2CQA-2765",
},
{
delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"), //Issue with the provider - CI ✅ because failling code is commented - LIVE-14500
delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"),
xrayTicket: "B2CQA-2766",
},
{
Expand Down Expand Up @@ -78,7 +77,7 @@ test.describe("Delegate flows", () => {
annotation: { type: "TMS", description: account.xrayTicket },
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.delegate.account.accountName);
Expand All @@ -105,7 +104,7 @@ test.describe("Delegate flows", () => {
await app.drawer.close();

await app.layout.syncAccounts();
await app.account.selectAndClickOnLastOperation(OperationType.DELEGATED);
await app.account.clickOnLastOperation();
await app.delegateDrawer.expectDelegationInfos(account.delegate);
},
);
Expand Down Expand Up @@ -135,7 +134,7 @@ test.describe("Delegate flows", () => {
annotation: { type: "TMS", description: validator.xrayTicket },
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(validator.delegate.account.accountName);
Expand All @@ -153,13 +152,6 @@ test.describe("Delegate flows", () => {
await app.delegate.openSearchProviderModal();
await app.delegate.checkValidatorListIsVisible();
await app.delegate.selectProviderOnRow(2);
// TODO: verification skipped due to bug (Clicking 'Show less' does not select the validator that was chosen previously) - LIVE-14500
if (
![Currency.SOL.name, Currency.ADA.name].includes(
validator.delegate.account.currency.name,
)
)
await app.delegate.closeProviderList(2);
},
);
});
Expand Down Expand Up @@ -191,7 +183,7 @@ test.describe("Delegate flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToPortfolio();
await app.portfolio.startStakeFlow();
Expand All @@ -213,7 +205,7 @@ test.describe("Delegate flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToMarket();
await app.market.search(delegateAccount.account.currency.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ for (const account of accounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.account.accountName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe(`[${app.name}] Sync Accounts`, () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.expectAccountsCount(0);
Expand Down
8 changes: 4 additions & 4 deletions apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test.describe("send NFT to ENS address", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName);
await app.account.navigateToNFTGallery();
Expand Down Expand Up @@ -87,7 +87,7 @@ test.describe("The user can see his NFT floor price", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.accountName);
await app.account.navigateToNFTGallery();
Expand Down Expand Up @@ -135,7 +135,7 @@ for (const account of accounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.account.accountName);
await app.account.checkNftListInAccount(account.account);
Expand Down Expand Up @@ -170,7 +170,7 @@ for (const account of accounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.account.accountName);
await app.account.navigateToNFTGallery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe("Portfolio", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToPortfolio();
await app.portfolio.checkBuySellButtonVisibility();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for (const account of accounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.account.accountName);
Expand Down Expand Up @@ -100,7 +100,7 @@ test.describe("Receive", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.accountName);
Expand Down
29 changes: 18 additions & 11 deletions apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Account } from "@ledgerhq/live-common/e2e/enum/Account";
import { Fee } from "@ledgerhq/live-common/e2e/enum/Fee";
import { OperationType } from "@ledgerhq/live-common/e2e/enum/OperationType";
import { Transaction } from "../../models/Transaction";
import { addTmsLink } from "tests/utils/allureUtils";
import { addTmsLink, addBugLink } from "tests/utils/allureUtils";
import { getDescription } from "../../utils/customJsonReporter";
import { CLI } from "tests/utils/cliUtils";
import { isRunningInScheduledWorkflow } from "tests/utils/githubUtils";
Expand Down Expand Up @@ -153,6 +153,7 @@ const transactionE2E = [
{
transaction: new Transaction(Account.POL_1, Account.POL_2, "0.001", Fee.SLOW),
xrayTicket: "B2CQA-2807",
bugTicket: "BACK-8150",
},
{
transaction: new Transaction(Account.DOGE_1, Account.DOGE_2, "0.01", Fee.SLOW),
Expand Down Expand Up @@ -187,7 +188,7 @@ const transactionE2E = [
xrayTicket: "B2CQA-2814",
},
{
transaction: new Transaction(Account.ADA_1, Account.ADA_1, "1", undefined, "noTag"),
transaction: new Transaction(Account.ADA_1, Account.ADA_2, "1", undefined, "noTag"),
xrayTicket: "B2CQA-2815",
},
{
Expand Down Expand Up @@ -248,10 +249,16 @@ test.describe("Send flows", () => {
test(
`Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}`,
{
annotation: { type: "TMS", description: transaction.xrayTicket },
annotation: [
{ type: "TMS", description: transaction.xrayTicket },
{ type: "BUG", description: transaction.bugTicket },
],
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
if (transaction.bugTicket) {
await addBugLink(getDescription(test.info().annotations, "BUG").split(", "));
}

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -318,7 +325,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -360,7 +367,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -409,7 +416,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -450,7 +457,7 @@ test.describe("Send flows", () => {
annotation: { type: "TMS", description: transaction.xrayTicket },
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -498,7 +505,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -542,7 +549,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down Expand Up @@ -584,7 +591,7 @@ test.describe("Send flows", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe("Settings", () => {
annotation: [{ type: "TMS", description: "B2CQA-817" }],
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.showParentAccountTokens(Account.ETH_1.accountName);
Expand Down Expand Up @@ -62,7 +62,7 @@ test.describe("Password", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
const countBeforeLock = await app.accounts.countAccounts();
Expand Down Expand Up @@ -108,7 +108,7 @@ test.describe("counter value selection", () => {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToSettings();
await app.settings.changeCounterValue("euro");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for (const token of subAccounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.portfolio.openAddAccountModal();
await app.addAccount.expectModalVisiblity();
Expand Down Expand Up @@ -74,7 +74,7 @@ for (const token of subAccountReceive) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(token.account.accountName);
Expand Down Expand Up @@ -110,7 +110,7 @@ for (const token of subAccounts) {
},
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(token.account.accountName);
Expand Down
Loading

0 comments on commit 79a7907

Please sign in to comment.