File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 9
9
"dev:web" : " pnpm --filter @notesuite/client dev & pnpm --filter @notesuite/common dev" ,
10
10
"dev:server" : " pnpm --filter @notesuite/server start" ,
11
11
"dev:client" : " pnpm --filter @notesuite/client tauri dev & pnpm --filter @notesuite/common dev" ,
12
+ "demo" : " playwright test --debug --config=playwright.demo.config.ts" ,
12
13
"test" : " playwright test" ,
14
+ "shutdown" : " ./scripts/shutdown.sh" ,
13
15
"test:headed" : " playwright test --debug" ,
14
16
"clean" : " pnpm --filter @notesuite/server clean"
15
17
},
Original file line number Diff line number Diff line change
1
+ import { PlaywrightTestConfig } from 'playwright/test' ;
2
+
3
+ const config : PlaywrightTestConfig = {
4
+ testDir : 'tests' ,
5
+ use : {
6
+ browserName : 'chromium' ,
7
+ } ,
8
+ projects : [
9
+ {
10
+ name : 'demo' ,
11
+ testMatch : 'tests/common/demo.ts' ,
12
+ } ,
13
+ ] ,
14
+ } ;
15
+
16
+ export default config ;
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ killport () {
4
+ if [ -z " $1 " ]; then
5
+ echo " Usage: killport <port>"
6
+ return 1
7
+ fi
8
+ kill $( lsof -i :$1 | grep node | awk ' {print $2}' )
9
+ }
10
+
11
+ killport 5173
12
+ killport 3000
Original file line number Diff line number Diff line change @@ -58,13 +58,18 @@ class WebAgentInterface {
58
58
}
59
59
}
60
60
61
+ class DesktopAgentInterface {
62
+ constructor ( private agent : TestAgent ) { }
63
+ }
64
+
61
65
class MockAgentInterface {
62
66
constructor ( private agent : TestAgent ) { }
63
67
}
64
68
65
69
export class TestAgent {
66
70
runner = new AppRunner ( ) ;
67
71
web = new WebAgentInterface ( this ) ;
72
+ desktop = new DesktopAgentInterface ( this ) ;
68
73
mock = new MockAgentInterface ( this ) ;
69
74
70
75
workspaceId = '' ;
Original file line number Diff line number Diff line change
1
+ import { test } from 'playwright/test' ;
2
+ import { TestAgent } from './agent.js' ;
3
+
4
+ test ( 'demo' , async ( { page } ) => {
5
+ const agent = new TestAgent ( ) ;
6
+ await agent . start ( {
7
+ name : 'demo' ,
8
+ webPort : 5173 ,
9
+ backendPort : 3000 ,
10
+ } ) ;
11
+ await page . goto ( agent . web . baseUrl ) ;
12
+ // await page.pause();
13
+
14
+ await agent . web . createWorkspace ( page , 'hello' ) ;
15
+ await agent . web . createDoc ( page , 'First Doc' ) ;
16
+ await agent . web . createDoc ( page , 'Second Doc' ) ;
17
+ await agent . web . createDoc ( page , 'Third Doc' ) ;
18
+ // await page.pause();
19
+ // await agent.stop();
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments