File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -10,20 +10,23 @@ jobs:
10
10
strategy :
11
11
fail-fast : false
12
12
matrix :
13
- os : [windows-latest, macos-latest, ubuntu-latest]
13
+ os : [windows-latest, macos-latest] # ubuntu-latest fails with playwright electron.launch
14
14
15
15
steps :
16
- - uses : actions/checkout@v3
16
+ - uses : actions/checkout@v4
17
17
- name : Setup nodejs
18
- uses : actions/setup-node@v3
18
+ uses : actions/setup-node@v4
19
19
with :
20
- node-version : ' 16 '
20
+ node-version : ' 20 '
21
21
- name : Install dependencies
22
22
run : npm install
23
+ - name : Install Playwright
24
+ run : npx playwright install
23
25
- name : Run Test
24
26
run : npm test
25
27
- name : Upload screenshots
26
- uses : actions/upload-artifact@v3
28
+ uses : actions/upload-artifact@v4
29
+ if : ${{ always() }}
27
30
with :
28
31
name : screenshots_${{ matrix.os }}
29
32
path : screenshot
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from "playwright/test" ;
2
+
3
+ export default defineConfig ( {
4
+ testDir : "test" ,
5
+ testMatch : "**/?(*.)+(spec|test).[tj]s?(x)" ,
6
+ } ) ;
Original file line number Diff line number Diff line change @@ -17,24 +17,17 @@ test.afterEach(async ({ page }, testInfo) => {
17
17
18
18
test ( 'launch app' , async ( ) => {
19
19
const title = await mainWindow . title ( ) ;
20
- expect ( title ) . toBe ( 'sbe' ) ;
20
+ expect ( title ) . toBe ( 'sbe - Scrapbox in Electron ' ) ;
21
21
await mainWindow . screenshot ( { path : './screenshot/main.png' } ) ;
22
22
23
23
const packaged = await isPackaged ( ) ;
24
24
expect ( packaged ) . toBe ( false ) ;
25
25
26
- const windows = await electronApp . windows ( ) ;
27
- expect ( windows . length ) . toBe ( 2 ) ;
28
- console . log ( await windows [ 1 ] . title ( ) ) ;
29
- await windows [ 1 ] . screenshot ( { path : './screenshot/child.png' } ) ;
30
- } ) ;
31
-
32
- test ( 'open fav page' , async ( ) => {
33
- await mainWindow . click ( '#inspire > div.v-application--wrap > header > div.v-toolbar__content > header > div > button:nth-child(11)' ) ;
34
- await mainWindow . waitForTimeout ( 2000 ) ;
35
26
const windows = await electronApp . windows ( ) ;
36
27
expect ( windows . length ) . toBe ( 3 ) ;
37
- await windows [ 2 ] . screenshot ( { path : './screenshot/favs.png' } ) ;
28
+ expect ( await windows [ 1 ] . title ( ) ) . toBe ( 'Start page' ) ;
29
+ await windows [ 1 ] . screenshot ( { path : './screenshot/child1.png' } ) ;
30
+ await windows [ 2 ] . screenshot ( { path : './screenshot/child2.png' } ) ;
38
31
} ) ;
39
32
40
33
async function isPackaged ( ) {
You can’t perform that action at this time.
0 commit comments