mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 11:58:41 +00:00
feat: upload 0.7.0-canary.18 static output (#2883)
This commit is contained in:
2
.github/actions/setup-node/action.yml
vendored
2
.github/actions/setup-node/action.yml
vendored
@@ -82,7 +82,7 @@ runs:
|
||||
id: playwright-version
|
||||
if: ${{ inputs.playwright-install == 'true' }}
|
||||
shell: bash
|
||||
run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')" >> $GITHUB_OUTPUT
|
||||
run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://' | head -n 1)" >> $GITHUB_OUTPUT
|
||||
|
||||
# Attempt to restore the correct Playwright browser binaries based on the
|
||||
# currently installed version of Playwright (The browser binary versions
|
||||
|
||||
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -273,6 +273,26 @@ jobs:
|
||||
path: ./test-results
|
||||
if-no-files-found: ignore
|
||||
|
||||
e2e-migration-test:
|
||||
name: E2E Migration Test
|
||||
runs-on: ubuntu-latest
|
||||
environment: development
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
with:
|
||||
playwright-install: true
|
||||
|
||||
- name: Unzip
|
||||
run: yarn unzip
|
||||
working-directory: ./tests/affine-legacy/0.7.0-canary.18
|
||||
|
||||
- name: Run legacy playwright tests
|
||||
run: yarn e2e --forbid-only
|
||||
working-directory: ./tests/affine-legacy/0.7.0-canary.18
|
||||
|
||||
desktop-test:
|
||||
name: Desktop Test
|
||||
runs-on: ${{ matrix.spec.os }}
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"plugins/*",
|
||||
"packages/*",
|
||||
"tests/fixtures",
|
||||
"tests/kit"
|
||||
"tests/kit",
|
||||
"tests/affine-legacy/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "dev-web",
|
||||
|
||||
2
tests/affine-legacy/0.7.0-canary.18/.gitignore
vendored
Normal file
2
tests/affine-legacy/0.7.0-canary.18/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
static
|
||||
tests/fixtures/*.ydoc
|
||||
7
tests/affine-legacy/0.7.0-canary.18/README.md
Normal file
7
tests/affine-legacy/0.7.0-canary.18/README.md
Normal 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`
|
||||
BIN
tests/affine-legacy/0.7.0-canary.18/affine-web.zip
Normal file
BIN
tests/affine-legacy/0.7.0-canary.18/affine-web.zip
Normal file
Binary file not shown.
16
tests/affine-legacy/0.7.0-canary.18/package.json
Normal file
16
tests/affine-legacy/0.7.0-canary.18/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
41
tests/affine-legacy/0.7.0-canary.18/playwright.config.ts
Normal file
41
tests/affine-legacy/0.7.0-canary.18/playwright.config.ts
Normal 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;
|
||||
22
tests/affine-legacy/0.7.0-canary.18/tests/basic.spec.ts
Normal file
22
tests/affine-legacy/0.7.0-canary.18/tests/basic.spec.ts
Normal 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);
|
||||
});
|
||||
12
yarn.lock
12
yarn.lock
@@ -12,6 +12,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@affine-legacy/0.7.0-canary.18@workspace:tests/affine-legacy/0.7.0-canary.18":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@affine-legacy/0.7.0-canary.18@workspace:tests/affine-legacy/0.7.0-canary.18"
|
||||
dependencies:
|
||||
"@affine-test/fixtures": "workspace:*"
|
||||
"@affine-test/kit": "workspace:*"
|
||||
"@playwright/test": =1.33.0
|
||||
playwright: =1.33.0
|
||||
serve: ^14.2.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@affine-test/fixtures@workspace:*, @affine-test/fixtures@workspace:tests/fixtures":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@affine-test/fixtures@workspace:tests/fixtures"
|
||||
|
||||
Reference in New Issue
Block a user