This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LIVE-448 - Add playwright test suite for market page (#4736)
* Add playwright test suite for market page * update screenshots (linux) * update screenshots (windows) * update screenshots (windows) * update screenshots (linux) * update screenshots (windows) * Fix screenshots * Update market tests * update screenshots (linux) * update screenshots (windows) * update screenshots (windows) * Fix conflicts * Update LLC * update screenshots (linux) * update screenshots (linux) * update screenshots (linux) * ci run * Fix merge * update screenshots (windows) * market page tests * update screenshots (linux) * update screenshots (windows) * last ci run * Split sorting test step in two Co-authored-by: Team Live <[email protected]> Co-authored-by: Nabil Bourenane <[email protected]>
- Loading branch information
1 parent
d6003e9
commit 2090c77
Showing
77 changed files
with
246 additions
and
14 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Page, Locator } from "@playwright/test"; | ||
|
||
export class MarketCoinPage { | ||
readonly page: Page; | ||
readonly buyButton: Locator; | ||
readonly swapButton: Locator; | ||
readonly counterValueSelect: Locator; | ||
readonly marketRangeSelect: Locator; | ||
readonly starFilterButton: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.buyButton = page.locator("data-test-id=market-coin-buy-button"); | ||
this.swapButton = page.locator("data-test-id=market-coin-swap-button"); | ||
this.counterValueSelect = page.locator("data-test-id=market-coin-counter-value-select"); | ||
this.marketRangeSelect = page.locator("data-test-id=market-coin-range-select"); | ||
this.starFilterButton = page.locator("data-test-id=market-coin-star-button"); | ||
} | ||
|
||
async openBuyPage() { | ||
await this.buyButton.click(); | ||
} | ||
|
||
async openSwapPage() { | ||
await this.swapButton.click(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { Page, Locator } from "@playwright/test"; | ||
|
||
export class MarketPage { | ||
readonly page: Page; | ||
readonly searchInput: Locator; | ||
readonly counterValueSelect: Locator; | ||
readonly marketRangeSelect: Locator; | ||
readonly filterDrawerButton: Locator; | ||
readonly starFilterButton: Locator; | ||
readonly sortButton: Locator; | ||
readonly loadingPlaceholder: Locator; | ||
readonly coinRow: Function; | ||
readonly starButton: Function; | ||
readonly buyButton: Function; | ||
readonly swapButton: Function; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.searchInput = page.locator("data-test-id=market-search-input"); | ||
this.counterValueSelect = page.locator("data-test-id=market-countervalue-select"); | ||
this.marketRangeSelect = page.locator("data-test-id=market-range-select"); | ||
this.filterDrawerButton = page.locator("data-test-id=market-filter-drawer-button"); | ||
this.starFilterButton = page.locator("data-test-id=market-star-button"); | ||
this.sortButton = page.locator("data-test-id=market-sort-button"); | ||
this.loadingPlaceholder = page.locator("data-test-id=loading-placeholder"); | ||
this.coinRow = (ticker: string): Locator => page.locator(`data-test-id=market-${ticker}-row`); | ||
this.starButton = (ticker: string): Locator => | ||
page.locator(`data-test-id=market-${ticker}-star-button`); | ||
this.buyButton = (ticker: string): Locator => | ||
page.locator(`data-test-id=market-${ticker}-buy-button`); | ||
this.swapButton = (ticker: string): Locator => | ||
page.locator(`data-test-id=market-${ticker}-swap-button`); | ||
} | ||
|
||
async search(query: string) { | ||
await this.searchInput.fill(query); | ||
} | ||
|
||
async openFilterDrawer() { | ||
await this.filterDrawerButton.click(); | ||
} | ||
|
||
async toggleInvertSort() { | ||
await this.sortButton.click(); | ||
} | ||
|
||
async switchCountervalue(ticker: string) { | ||
await this.counterValueSelect.click(); | ||
// TODO: For some reason need to hack selects like that | ||
await this.page.click('#react-select-2-listbox div div:has-text("Thai Baht - THB")'); | ||
} | ||
|
||
async switchMarketRange(range: string) { | ||
await this.marketRangeSelect.click(); | ||
// TODO: For some reason need to hack selects like that | ||
await this.page.click(`text=${range}`); | ||
} | ||
|
||
async toggleStarFilter() { | ||
await this.starFilterButton.click(); | ||
} | ||
|
||
async openCoinPage(ticker: string) { | ||
await this.coinRow(ticker).click(); | ||
} | ||
|
||
async starCoin(ticker: string) { | ||
await this.starButton(ticker).click(); | ||
} | ||
|
||
async openBuyPage(ticker: string) { | ||
await this.buyButton(ticker).click(); | ||
} | ||
|
||
async openSwapPage(ticker: string) { | ||
await this.swapButton(ticker).click(); | ||
} | ||
|
||
async waitForLoading() { | ||
await this.loadingPlaceholder.first().waitFor({ state: "detached" }); | ||
await this.swapButton("btc").waitFor({ state: "attached" }); // swap buttons are displayed few seconds after | ||
} | ||
} |
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
Binary file modified
BIN
+2.9 KB
(100%)
tests/specs/account.spec.ts-snapshots/ATOM-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.97 KB
(100%)
tests/specs/account.spec.ts-snapshots/BTC-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.89 KB
(100%)
tests/specs/account.spec.ts-snapshots/ETH-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.89 KB
(100%)
tests/specs/account.spec.ts-snapshots/LTC-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.06 KB
(100%)
tests/specs/account.spec.ts-snapshots/XRP-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.95 KB
(100%)
tests/specs/account.spec.ts-snapshots/XTZ-complete-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+856 Bytes
(100%)
tests/specs/devmode.spec.ts-snapshots/devMode-on-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.01 KB
(100%)
tests/specs/discover.spec.ts-snapshots/live-app-list-all-accounts-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.98 KB
(100%)
tests/specs/discover.spec.ts-snapshots/live-app-request-account-modal-1-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.96 KB
(100%)
tests/specs/discover.spec.ts-snapshots/live-app-request-account-modal-2-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.81 KB
(100%)
tests/specs/discover.spec.ts-snapshots/live-app-request-account-modal-3-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.96 KB
(100%)
...ecs/discover.spec.ts-snapshots/live-app-request-single-account-output-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.9 KB
(100%)
tests/specs/firmwareupdate.spec.ts-snapshots/modal-closed-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.01 KB
(100%)
tests/specs/layout.spec.ts-snapshots/collapse-sidebar-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.93 KB
(110%)
tests/specs/layout.spec.ts-snapshots/discreet-mode-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.05 KB
(100%)
tests/specs/layout.spec.ts-snapshots/dismiss-carousel-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.79 KB
(100%)
tests/specs/layout.spec.ts-snapshots/experimental-features-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1013 Bytes
(100%)
tests/specs/layout.spec.ts-snapshots/help-drawer-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.98 KB
(110%)
tests/specs/layout.spec.ts-snapshots/receive-modal-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.91 KB
(100%)
tests/specs/manager.spec.ts-snapshots/manager-install-tron-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.81 KB
(100%)
tests/specs/manager.spec.ts-snapshots/manager-installed-apps-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.77 KB
(100%)
tests/specs/manager.spec.ts-snapshots/manager-uninstall-tron-win32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.83 KB
(100%)
tests/specs/manager.spec.ts-snapshots/manager-uninstallAll-win32.png
Oops, something went wrong.
Binary file modified
BIN
+2.82 KB
(100%)
tests/specs/manager.spec.ts-snapshots/manager-updateAll-win32.png
Oops, something went wrong.
Oops, something went wrong.
2090c77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint outputs ✅
Tests outputs ✅
PASS src/generate-cryptoassets-md.test.js
Test Suites: 1 skipped, 1 passed, 1 of 2 total
Tests: 5 skipped, 1 passed, 6 total
Snapshots: 0 total
Time: 2.214 s
Test results written to: report.json
Diff output ✅