feat: upload 0.7.0-canary.18 static output (#2883)

This commit is contained in:
Alex Yang
2023-06-28 03:10:08 +08:00
committed by GitHub
parent 26ac56e163
commit 20fd9b6574
10 changed files with 123 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
static
tests/fixtures/*.ydoc

View File

@@ -0,0 +1,7 @@
# AFFiNE Legacy 0.7.0-canary.18
> This package is static output of AFFiNE 0.7.0-canary.18
>
> **This package is for debug only**.
>
> DO NOT MODIFY `affine-web.zip`

Binary file not shown.

View File

@@ -0,0 +1,16 @@
{
"name": "@affine-legacy/0.7.0-canary.18",
"description": "AFFiNE 0.7.0-canary.18 static output",
"scripts": {
"unzip": "unzip affine-web -d static",
"start": "yarn exec serve -s static -l 8081",
"e2e": "playwright test"
},
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "=1.33.0",
"playwright": "=1.33.0",
"serve": "^14.2.0"
}
}

View File

@@ -0,0 +1,41 @@
import type {
PlaywrightTestConfig,
PlaywrightWorkerOptions,
} from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: './tests',
fullyParallel: true,
timeout: process.env.CI ? 50_000 : 30_000,
use: {
baseURL: 'http://localhost:8081/',
browserName:
(process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ??
'chromium',
permissions: ['clipboard-read', 'clipboard-write'],
viewport: { width: 1440, height: 800 },
actionTimeout: 5 * 1000,
locale: 'en-US',
trace: 'on-first-retry',
video: 'on-first-retry',
},
forbidOnly: !!process.env.CI,
workers: 4,
retries: 1,
reporter: process.env.CI ? 'github' : 'list',
webServer: [
{
command: 'yarn start',
port: 8081,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
},
],
};
if (process.env.CI) {
config.retries = 3;
config.workers = '50%';
}
export default config;

View File

@@ -0,0 +1,22 @@
import { resolve } from 'node:path';
import { test } from '@playwright/test';
test('init page', async ({ page }) => {
await page.goto('http://localhost:8081/');
await page.waitForSelector('v-line');
const currentWorkspaceId: string = await page.evaluate(
() => (globalThis.currentWorkspace as any).id
);
const downloadPromise = page.waitForEvent('download');
await page.evaluate(() => {
const workspace = (globalThis.currentWorkspace as any).blockSuiteWorkspace;
workspace.exportYDoc();
});
const download = await downloadPromise;
const output = resolve(__dirname, 'fixtures', currentWorkspaceId + '.ydoc');
await download.saveAs(output);
});