test: add open login modal test

This commit is contained in:
tzhangchi
2022-12-23 18:08:30 +08:00
parent 490dbb4a60
commit 2d52e49b3a
4 changed files with 24 additions and 4 deletions
+2 -2
View File
@@ -5,10 +5,10 @@ loadPage();
test.describe('Open contact us', () => {
test('Click about us', async ({ page }) => {
page.waitForTimeout(1000);
// page.waitForTimeout(1000);
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
page.waitForTimeout(1000);
await page
.getByRole('tooltip', {
name: 'A AFFiNE Log in to sync with affine About AFFiNE',
+17
View File
@@ -0,0 +1,17 @@
import { test, expect, type Page } from '@playwright/test';
import { loadPage } from './libs/load-page';
loadPage();
test.describe('Login Flow', () => {
test('Open Login Modal', async ({ page }) => {
await page.getByTestId('current-workspace').click();
await page.waitForTimeout(800);
// why don't we use waitForSelector, It seems that waitForSelector not stable?
await page.getByTestId('open-login-modal').click();
await page.waitForTimeout(800);
await page
.getByRole('heading', { name: 'Currently not logged in' })
.click();
});
});