test: try to scroll to bottom e2e

This commit is contained in:
Louis 2024-10-22 17:56:36 +07:00
parent 7ce0625047
commit 2d80d6962b
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
3 changed files with 9 additions and 4 deletions

View File

@ -320,7 +320,6 @@ jobs:
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}' # TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always()
with: with:
name: playwright-report name: playwright-report
path: electron/playwright-report/ path: electron/playwright-report/

View File

@ -16,6 +16,7 @@ test.beforeAll(async () => {
test('explores hub', async ({ hubPage }) => { test('explores hub', async ({ hubPage }) => {
await hubPage.navigateByMenu() await hubPage.navigateByMenu()
await hubPage.verifyContainerVisible() await hubPage.verifyContainerVisible()
await hubPage.scrollToBottom()
const useModelBtn = page.getByTestId(/^use-model-btn-.*/).first() const useModelBtn = page.getByTestId(/^use-model-btn-.*/).first()
await expect(useModelBtn).toBeVisible({ await expect(useModelBtn).toBeVisible({

View File

@ -8,9 +8,8 @@ export class BasePage {
constructor( constructor(
protected readonly page: Page, protected readonly page: Page,
readonly action: CommonActions, readonly action: CommonActions,
protected containerId: string, protected containerId: string
) { ) {}
}
public getValue(key: string) { public getValue(key: string) {
return this.action.getValue(key) return this.action.getValue(key)
@ -37,6 +36,12 @@ export class BasePage {
expect(container.isVisible()).toBeTruthy() expect(container.isVisible()).toBeTruthy()
} }
async scrollToBottom() {
await this.page.evaluate(() => {
window.scrollTo(0, document.body.scrollHeight)
})
}
async waitUpdateLoader() { async waitUpdateLoader() {
await this.isElementVisible('img[alt="Jan - Logo"]') await this.isElementVisible('img[alt="Jan - Logo"]')
} }