test: update the test for Firefox (#12535)

This commit is contained in:
Alex Rudenko 2024-06-04 12:30:31 +02:00 committed by GitHub
parent 99a7f28746
commit 88df407517
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 18 deletions

View File

@ -2176,20 +2176,6 @@
"expectations": ["SKIP"],
"comment": "For some reason it times out on MacOS. Perhaps it's a bug in chromium-bidi"
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch tmp profile should be cleaned up",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch tmp profile should be cleaned up",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[locator.spec] Locator Locator.race races multiple locators",
"platforms": ["darwin", "linux", "win32"],

View File

@ -214,7 +214,7 @@ describe('Launcher specs', function () {
} catch {}
});
it('tmp profile should be cleaned up', async () => {
const {puppeteer} = await getTestState({skipLaunch: true});
const {puppeteer, isFirefox} = await getTestState({skipLaunch: true});
// Set a custom test tmp dir so that we can validate that
// the profile dir is created and then cleaned up.
@ -231,9 +231,10 @@ describe('Launcher specs', function () {
// One profile folder should have been created at this moment.
const profiles = fs.readdirSync(testTmpDir);
expect(profiles).toHaveLength(1);
expect(profiles[0]?.startsWith('puppeteer_dev_chrome_profile-')).toBe(
true
);
const expectedProfile = isFirefox
? 'puppeteer_dev_firefox_profile-'
: 'puppeteer_dev_chrome_profile-';
expect(profiles[0]?.startsWith(expectedProfile)).toBe(true);
// Open a page to make sure its functional.
await context.newPage();