Skip to content

Commit

Permalink
Merge pull request #8692 from LedgerHQ/support/fix-swap-ci
Browse files Browse the repository at this point in the history
[QAA] Adding and reactivating swap tests + fixing ci
  • Loading branch information
VicAlbr authored Dec 13, 2024
2 parents a1a9629 + 43c2642 commit eafb5d9
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 62 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 @@ -56,9 +56,12 @@ export class SwapConfirmationDrawer extends Drawer {

@step("Verify swap completion: $0")
async verifyExchangeCompletedTextContent(currencyToReceive: string) {
await expect(this.swapCompletedMessage).toHaveText("Transaction broadcast successfully");
await expect(this.swapCompletedMessage).toHaveText("Transaction broadcast successfully", {
timeout: 60000,
});
await expect(this.swapCompletedDescription).toHaveText(
`Your Swap operation has been sent to the network for confirmation. Please wait for your transaction to be confirmed and for the provider to process and send your ${currencyToReceive}.`,
{ timeout: 60000 },
);
}
}
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
23 changes: 8 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,7 @@ 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);
await app.delegate.closeProviderList(2);

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator

1) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator › Check selected provider is displayed when closing list Error: expect(received).toContain(expected) // indexOf Expected substring: "Ledger by Figment" Received string: "Ledger by Chorus One" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator

1) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator › Check selected provider is displayed when closing list Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "Ledger by Figment" Received string: "Ledger by Chorus One" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator

1) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Solana] - Select validator › Check selected provider is displayed when closing list Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "Ledger by Figment" Received string: "Ledger by Chorus One" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator

3) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator › Check selected provider is displayed when closing list Error: expect(received).toContain(expected) // indexOf Expected substring: "BIRD - Early Bird Pool" Received string: "undefined - undefined" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator

3) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator › Check selected provider is displayed when closing list Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "COJR - COJRPool" Received string: "CCV1 - (Crypto Capital Venture) #Pool2" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30

Check failure on line 155 in apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts

View workflow job for this annotation

GitHub Actions / Desktop Tests E2E (Ubuntu) (1, 3)

[speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator

3) [speculos_tests] › specs/speculos/delegate.spec.ts:131:11 › Delegate flows › Select a validator › [Cardano] - Select validator › Check selected provider is displayed when closing list Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "DAN - Cardano Dan's Stake Pool" Received string: "CRBN - Caribbean" 153 | await app.delegate.checkValidatorListIsVisible(); 154 | await app.delegate.selectProviderOnRow(2); > 155 | await app.delegate.closeProviderList(2); | ^ 156 | }, 157 | ); 158 | }); at /home/runner/_work/ledger-live/ledger-live/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts:155:30
},
);
});
Expand Down Expand Up @@ -191,7 +184,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 +206,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 eafb5d9

Please sign in to comment.