Merge remote-tracking branch 'refs/remotes/origin/feat/cloud-sync'

Conflicts:
	packages/data-center/src/provider/base.ts
This commit is contained in:
Lin Onetwo
2023-01-05 18:50:13 +08:00
33 changed files with 754 additions and 190 deletions
+9 -2
View File
@@ -4,11 +4,18 @@ import { loadPage } from './libs/load-page';
loadPage();
test.describe('Open contact us', () => {
test.skip('Click about us', async ({ page }) => {
test('Click about us', async ({ page }) => {
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
// await page.waitForTimeout(1000);
await page.getByText('About AFFiNE').click();
await page
.getByRole('tooltip', {
name: 'AFFiNE Log in to sync with affine About AFFiNE',
})
.locator('div')
.filter({ hasText: 'About AFFiNE' })
.nth(2)
.click();
const contactUsModal = page.locator(
'[data-testid=contact-us-modal-content]'
);
+5 -1
View File
@@ -1,7 +1,11 @@
import { test } from '@playwright/test';
import type { Page } from '@playwright/test';
interface IType {
page: Page;
}
export function loadPage() {
test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page }: IType) => {
await page.goto('http://localhost:8080');
// waiting for page loading end
await page.waitForSelector('#__next');
+5 -3
View File
@@ -1,11 +1,13 @@
export async function newPage(page) {
import type { Page } from '@playwright/test';
export async function newPage(page: Page) {
return page.getByTestId('sliderBar').getByText('New Page').click();
}
export async function clickPageMoreActions(page) {
export async function clickPageMoreActions(page: Page) {
return page
.getByTestId('editor-header-items')
.getByRole('button')
.nth(1)
.nth(2)
.click();
}
+1 -1
View File
@@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page';
loadPage();
test.describe.skip('Local first default workspace', () => {
test.describe('Local first default workspace', () => {
test('Default workspace name', async ({ page }) => {
const workspaceName = page.getByTestId('workspace-name');
expect(await workspaceName.textContent()).toBe('AFFiNE');
+18 -17
View File
@@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page';
loadPage();
test.describe.skip('Login Flow', () => {
test.describe('Login Flow', () => {
test('Open login modal by click current workspace', async ({ page }) => {
await page.getByTestId('current-workspace').click();
await page.waitForTimeout(800);
@@ -24,21 +24,22 @@ test.describe.skip('Login Flow', () => {
.click();
});
test('Open google firebase page', 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);
const [firebasePage] = await Promise.all([
page.waitForEvent('popup'),
page
.getByRole('button', {
name: 'Google Continue with Google Set up an AFFiNE account to sync data',
})
.click(),
]);
// not stable
// test.skip('Open google firebase page', 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);
// const [firebasePage] = await Promise.all([
// page.waitForEvent('popup'),
// page
// .getByRole('button', {
// name: 'Google Continue with Google Set up an AFFiNE account to sync data',
// })
// .click(),
// ]);
expect(firebasePage.url()).toContain('.firebaseapp.com/__/auth/handler');
});
// expect(firebasePage.url()).toContain('.firebaseapp.com/__/auth/handler');
// });
});