-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d65cc14
commit 7a06ccf
Showing
8 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { test } from '@playwright/test'; | ||
import * as indexVPTest from './vpTests/index/index.vp.test.js'; | ||
import * as fortyEightVPTest from './vpTests/48/pocket48.vp.test.js'; | ||
import * as pocket48RoomMessage from './vpTests/48/roomMessage.vp.test.js'; | ||
import * as douyinVPTest from './vpTests/douyin/douyin.vp.test.js'; | ||
|
||
test.describe.parallel('48tools vp test', function(): void { | ||
test.describe.serial(indexVPTest.title, indexVPTest.callback); | ||
test.describe.serial(fortyEightVPTest.title, fortyEightVPTest.callback); | ||
test.describe.serial(pocket48RoomMessage.title, pocket48RoomMessage.callback); | ||
test.describe.serial(douyinVPTest.title, douyinVPTest.callback); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import ElectronApp from '../../utils/ElectronApp.js'; | ||
import { testTitle, vpImage } from '../../utils/testUtils.js'; | ||
import testIdClick from '../../actions/testIdClick.js'; | ||
import * as TestId from '../../TestId.js'; | ||
|
||
/* 口袋48房间消息 */ | ||
export const title: string = 'VP 48 Room Message Page'; | ||
|
||
export function callback(): void { | ||
let app: ElectronApp | null = null; | ||
let dark: boolean = false; | ||
|
||
test.beforeEach(async function(): Promise<void> { | ||
app = new ElectronApp(); | ||
await app.init({ dark }); | ||
}); | ||
|
||
test.afterEach(async function(): Promise<void> { | ||
await app!.close(); | ||
app = null; | ||
}); | ||
|
||
// 测试 | ||
async function Pocket48RoomMessageVPTest(isDark?: boolean): Promise<void> { | ||
if (!app) { | ||
throw new Error('app is null'); | ||
} | ||
|
||
await testIdClick(app, '48-room-message'); | ||
await app.win.waitForSelector('.ant-pagination'); | ||
await expect(app.win).toHaveScreenshot(vpImage('48', 'pocket48-room-message', isDark)); | ||
} | ||
|
||
test(testTitle(TestId.Pocket48RoomMessageVP.Light, 'pocket48 room message'), async function(): Promise<void> { | ||
await Pocket48RoomMessageVPTest(); | ||
|
||
// 为下一个测试用例做修改 | ||
dark = true; | ||
}); | ||
|
||
test(testTitle(TestId.Pocket48RoomMessageVP.Dark, 'pocket48 room message dark mode'), async function(): Promise<void> { | ||
await Pocket48RoomMessageVPTest(true); | ||
}); | ||
} |