Skip to content

Commit 2a6dc30

Browse files
committed
Remove test environment
1 parent 5e2d843 commit 2a6dc30

File tree

2 files changed

+22
-49
lines changed

2 files changed

+22
-49
lines changed

tests/environment.js

-38
This file was deleted.

tests/index.test.js

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
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
});

0 commit comments

Comments
 (0)