File tree Expand file tree Collapse file tree 6 files changed +151
-2054
lines changed
Expand file tree Collapse file tree 6 files changed +151
-2054
lines changed Original file line number Diff line number Diff line change 9191
9292 - name : Test
9393 uses : GabrielBB/xvfb-action@v1
94+ env :
95+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 1
9496 with :
9597 run : yarn test
9698
Original file line number Diff line number Diff line change 6767 }
6868 },
6969 "scripts" : {
70- "test" : " jest" ,
70+ "test" : " playwright test" ,
71+ "test:debug" : " DEBUG=pw:browser* playwright test" ,
7172 "start" : " electron ." ,
7273 "start:debug" : " ELECTRON_ENABLE_LOGGING=1 electron ." ,
7374 "icon" : " rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated" ,
120121 "ytpl" : " ^2.3.0"
121122 },
122123 "devDependencies" : {
124+ "@playwright/test" : " ^1.25.1" ,
123125 "auto-changelog" : " ^2.4.0" ,
124- "electron" : " ^18.2.3 " ,
126+ "electron" : " ^20.1.1 " ,
125127 "electron-builder" : " ^23.0.3" ,
126128 "electron-devtools-installer" : " ^3.1.1" ,
127129 "electron-icon-maker" : " 0.0.5" ,
128- "jest" : " ^27.3.1" ,
129- "playwright" : " ^1.17.1" ,
130+ "playwright" : " ^1.25.1" ,
130131 "rimraf" : " ^3.0.2" ,
131132 "xo" : " ^0.45.0"
132133 },
Original file line number Diff line number Diff line change 1+ const { test, expect } = require ( "@playwright/test" ) ;
2+
13const { sortSegments } = require ( "../segments" ) ;
24
35test ( "Segment sorting" , ( ) => {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- /**
2- * @jest -environment ./tests/environment
3- */
1+ const path = require ( "path" ) ;
42
5- describe ( "YouTube Music App" , ( ) => {
6- const app = global . __APP__ ;
3+ const { _electron : electron } = require ( "playwright" ) ;
4+ const { test , expect } = require ( "@playwright/test" ) ;
75
8- test ( "With default settings, app is launched and visible" , async ( ) => {
9- const window = await app . firstWindow ( ) ;
10- const title = await window . title ( ) ;
11- expect ( title ) . toEqual ( "YouTube Music" ) ;
6+ const appPath = path . resolve ( __dirname , ".." ) ;
127
13- const url = window . url ( ) ;
14- expect ( url . startsWith ( "https://music.youtube.com" ) ) . toBe ( true ) ;
8+ test ( "YouTube Music App - With default settings, app is launched and visible" , async ( ) => {
9+ const app = await electron . launch ( {
10+ args : [
11+ "--no-sandbox" ,
12+ "--disable-gpu" ,
13+ "--whitelisted-ips=" ,
14+ "--disable-dev-shm-usage" ,
15+ appPath ,
16+ ] ,
1517 } ) ;
18+
19+ const window = await app . firstWindow ( ) ;
20+ const title = await window . title ( ) ;
21+ expect ( title ) . toEqual ( "YouTube Music" ) ;
22+
23+ const url = window . url ( ) ;
24+ expect ( url . startsWith ( "https://music.youtube.com" ) ) . toBe ( true ) ;
25+
26+ await app . close ( ) ;
1627} ) ;
You can’t perform that action at this time.
0 commit comments