-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8daecb
commit 1a3759b
Showing
2 changed files
with
7 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import test from "../../fixtures/mockFixtures"; | ||
import { expect } from "@playwright/test"; | ||
import { SwapPage } from "../../page/swap.page"; | ||
import { DeviceAction } from "../../models/DeviceAction"; | ||
import { Drawer } from "../../page/drawer/drawer"; | ||
import { AccountsPage } from "../../page/accounts.page"; | ||
import { AccountPage } from "../../page/account.page"; | ||
import { Layout } from "../../component/layout.component"; | ||
import { Modal } from "../../component/modal.component"; | ||
import test from "../../fixtures/mockFixtures"; | ||
import { DeviceAction } from "../../models/DeviceAction"; | ||
import { AccountPage } from "../../page/account.page"; | ||
import { AccountsPage } from "../../page/accounts.page"; | ||
import { Drawer } from "../../page/drawer/drawer"; | ||
import { SwapPage } from "../../page/swap.page"; | ||
import { | ||
getBitcoinToDogecoinRatesMock, | ||
getBitcoinToEthereumRatesMock, | ||
getEthereumToTetherRatesMock, | ||
getProvidersCDNDataMock, | ||
} from "./services-api-mocks/getRates.mock"; | ||
|
||
|
@@ -97,7 +96,6 @@ test.describe.parallel("Swap", () => { | |
await swapPage.selectCurrencyFromCurrencyDropdown("Dogecoin"); | ||
await swapPage.sendMax(); // entering amount in textbox doesn't generate a quote in mock/PW | ||
await layout.waitForLoadingSpinnerToHaveDisappeared(); | ||
await swapPage.waitForProviderRates(); | ||
await expect.soft(page).toHaveScreenshot("add-to-account-button.png"); | ||
Check failure on line 99 in apps/ledger-live-desktop/tests/specs/services/swap.spec.ts GitHub Actions / Desktop Tests E2E (Ubuntu)[mocked_tests] › specs/services/swap.spec.ts:30:7 › Swap › Add accounts via Swap page @smoke
|
||
}); | ||
|
||
|
@@ -107,58 +105,6 @@ test.describe.parallel("Swap", () => { | |
}); | ||
}); | ||
|
||
test("Filter Rates @smoke", async ({ page, mockProviderSvgs, mockFeesEndpoint }) => { | ||
const swapPage = new SwapPage(page); | ||
const layout = new Layout(page); | ||
|
||
await page.route("https://swap.ledger.com/v5/rate**", async route => { | ||
const mockRatesResponse = getEthereumToTetherRatesMock(); | ||
await route.fulfill({ headers: { teststatus: "mocked" }, body: mockRatesResponse }); | ||
}); | ||
|
||
await page.route("https://cdn.live.ledger.com/swap-providers/data.json", async route => { | ||
const mockProvidersResponse = getProvidersCDNDataMock(); | ||
await route.fulfill({ headers: { teststatus: "mocked" }, body: mockProvidersResponse }); | ||
}); | ||
|
||
await test.step("Generate ETH to USDT quotes", async () => { | ||
await swapPage.navigate(); | ||
await swapPage.reverseSwapPair(); | ||
await swapPage.filterDestinationCurrencyDropdown("Tether USD"); | ||
await layout.waitForLoadingSpinnerToHaveDisappeared(); | ||
await swapPage.selectCurrencyFromCurrencyDropdown("Tether USD"); | ||
await swapPage.sendMax(); | ||
await layout.waitForLoadingSpinnerToHaveDisappeared(); | ||
await swapPage.waitForProviderRates(); | ||
await expect.soft(page).toHaveScreenshot("eth-to-usdt-quotes-generated.png"); | ||
}); | ||
|
||
await test.step("Decentralised Quotes filtered", async () => { | ||
await swapPage.filterByDecentralisedQuotes(); | ||
await expect.soft(page).toHaveScreenshot("only-decentralised-quotes-displayed.png"); | ||
}); | ||
|
||
await test.step("Fixed Decentralised Quotes filtered", async () => { | ||
await swapPage.filterByFixedRateQuotes(); | ||
await expect.soft(page).toHaveScreenshot("fixed-decentralised-quotes-displayed.png"); | ||
}); | ||
|
||
await test.step("Floating Decentralised Quotes filtered", async () => { | ||
await swapPage.filterByFloatingRateQuotes(); | ||
await expect.soft(page).toHaveScreenshot("floating-decentralised-quotes-displayed.png"); | ||
}); | ||
|
||
await test.step("Floating Centralised Quotes filtered", async () => { | ||
await swapPage.filterByCentralisedQuotes(); | ||
await expect.soft(page).toHaveScreenshot("floating-centralised-quotes-displayed.png"); | ||
}); | ||
|
||
await test.step("Fixed Centralised filtered", async () => { | ||
await swapPage.filterByFixedRateQuotes(); | ||
await expect.soft(page).toHaveScreenshot("fixed-centralised-quotes-diplayed.png"); | ||
}); | ||
}); | ||
|
||
test("Full Swap with Centralised Exchange @smoke", async ({ | ||
page, | ||
mockProviderSvgs, | ||
|