-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7721 from prury/playwright-test
- Loading branch information
Showing
17 changed files
with
179 additions
and
18 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
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,79 @@ | ||
import { expect, test } from './fixtures' | ||
|
||
test('Profile Interactions', async ({ page, Commands }) => { | ||
const testAddress = 'FSMdmCLv5gFZ87YerB3M8ZSQ58BGHdSnreC4J6znWpqPQK9' | ||
await page.goto(`ahk/u/${testAddress}?tab=owned`) | ||
await Commands.scrollDownSlow() | ||
//test step - will check if buy now has items that are not listed | ||
await test.step('Buy Now', async () => { | ||
await Commands.acceptCookies() | ||
await page.getByTestId('profile-filter-button-buynow').click() | ||
await Commands.scrollDownSlow() | ||
for (const li of await page.locator('[class="nft-card"]').all()) { | ||
await expect(li.getByText('KSM')).toBeVisible() | ||
} | ||
}) | ||
//test step | ||
await test.step('Activity Tab', async () => { | ||
await page.getByTestId('profile-tabs').last().click() | ||
//usually sale and buy are active when you enter the page | ||
//SALE | ||
await page.getByTestId('profile-activity-button-filter').nth(1).click() | ||
//checks if sale tag exists | ||
await expect(page.getByTestId('history-item-row').first()).toBeVisible() | ||
await expect( | ||
page.getByTestId('history-item-row').first().filter({ hasText: 'Sale' }), | ||
).toBeVisible() | ||
await page.getByTestId('identity-tippy-link').first().hover() | ||
await expect(page.getByTestId('identity-popover-container')).toBeVisible() | ||
//BUY | ||
await page.getByTestId('profile-activity-button-filter').nth(0).click() | ||
await page.getByTestId('profile-activity-button-filter').nth(1).click() | ||
await page.getByTestId('identity-tippy-link').last().hover() | ||
await expect(page.getByTestId('identity-popover-container')).toBeVisible() | ||
await expect( | ||
page.getByTestId('history-item-row').first().filter({ hasText: 'Buy' }), | ||
).toBeVisible() | ||
//TRANSFER | ||
await page.getByTestId('profile-activity-button-filter').nth(1).click() | ||
await page.getByTestId('profile-activity-button-filter').nth(3).click() | ||
await expect( | ||
page | ||
.getByTestId('history-item-row') | ||
.first() | ||
.filter({ hasText: 'Transfer' }), | ||
).toBeVisible() | ||
//LIST | ||
await page.getByTestId('profile-activity-button-filter').nth(3).click() | ||
await page.getByTestId('profile-activity-button-filter').nth(4).click() | ||
await expect( | ||
page.getByTestId('history-item-row').first().filter({ hasText: 'List' }), | ||
).toBeVisible() | ||
//ALL | ||
await page.getByTestId('profile-activity-button-all').click() | ||
}) | ||
//test step | ||
await test.step('Profile Links', async () => { | ||
//copy address | ||
await page | ||
.getByTestId('profile-identity-buttons') | ||
.getByText('Copy Address') | ||
.click() | ||
await Commands.copyText(testAddress) | ||
//QR Code | ||
await page | ||
.getByTestId('profile-identity-buttons') | ||
.getByText('QR Code') | ||
.click() | ||
await expect(page.locator('[class="card-header-title"]')).toBeVisible() | ||
await page.keyboard.press('Escape') | ||
//Transfer | ||
await page | ||
.getByTestId('profile-identity-buttons') | ||
.getByText('Transfer') | ||
.click() | ||
await expect(page).toHaveURL( | ||
`/ahk/transfer?target=${testAddress}&usdamount=10&donation=true`, | ||
) | ||
}) | ||
}) |
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,11 @@ | ||
import { expect, test } from './fixtures' | ||
|
||
test('Settings', async ({ page, Commands }) => { | ||
await Commands.e2elogin() | ||
await page.goto('/ahk') | ||
//click on settings and check if page redirects correctly | ||
await page.getByTestId('navbar-profile-dropdown').click() | ||
await page.getByTestId('sidebar-link-settings').click() | ||
await expect(page).toHaveURL('/settings') | ||
await expect(page.getByTestId('sidebar-wallet-container')).toBeHidden() | ||
}) |
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,19 @@ | ||
import { expect, test } from './fixtures' | ||
|
||
test('Sidebar Interactions', async ({ page, Commands }) => { | ||
await Commands.e2elogin() | ||
await page.goto('/ahk') | ||
//checks if sidebar closes when clicking another sidebar | ||
//profile | ||
await page.getByTestId('navbar-profile-dropdown').click() | ||
await expect(page.getByTestId('sidebar-wallet-container')).toBeVisible() | ||
//cart | ||
await page.getByTestId('navbar-button-cart').click() | ||
await expect(page.getByTestId('sidebar-wallet-container')).toBeHidden() | ||
//notification | ||
await page.getByTestId('navbar-button-notification').click() | ||
await expect(page.getByTestId('shopping-cart-modal-container')).toBeHidden() | ||
//profile | ||
await page.getByTestId('navbar-profile-dropdown').click() | ||
await expect(page.getByTestId('notification-modal-container')).toBeHidden() | ||
}) |