fixture
This commit is contained in:
parent
74af249c38
commit
90fc8d9b57
|
|
@ -19,7 +19,7 @@ runs:
|
||||||
elif [[ "$version" == "12" || "$version" == "13" ]]; then
|
elif [[ "$version" == "12" || "$version" == "13" ]]; then
|
||||||
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access VALUES('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159);"
|
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access VALUES('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159);"
|
||||||
else
|
else
|
||||||
echo "macOS version is unsupported. Version is $version, exiting"
|
echo "Skipping unsupported macOS version $version"
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Successfully allowed microphone access"
|
echo "Successfully allowed microphone access"
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import type { TestInfo } from '@playwright/test';
|
||||||
export type BrowserTestWorkerFixtures = PageWorkerFixtures & {
|
export type BrowserTestWorkerFixtures = PageWorkerFixtures & {
|
||||||
browserVersion: string;
|
browserVersion: string;
|
||||||
defaultSameSiteCookieValue: string;
|
defaultSameSiteCookieValue: string;
|
||||||
|
sameSiteStoredValueForNone: string;
|
||||||
allowsThirdParty: boolean;
|
allowsThirdParty: boolean;
|
||||||
browserMajorVersion: number;
|
browserMajorVersion: number;
|
||||||
browserType: BrowserType;
|
browserType: BrowserType;
|
||||||
|
|
@ -86,6 +87,13 @@ const test = baseTest.extend<BrowserTestTestFixtures, BrowserTestWorkerFixtures>
|
||||||
throw new Error('unknown browser - ' + browserName);
|
throw new Error('unknown browser - ' + browserName);
|
||||||
}, { scope: 'worker' }],
|
}, { scope: 'worker' }],
|
||||||
|
|
||||||
|
sameSiteStoredValueForNone: [async ({ browserName, isMac }, run) => {
|
||||||
|
if (browserName === 'webkit' && isMac && parseInt(os.release(), 10) >= 24)
|
||||||
|
await run('Lax');
|
||||||
|
else
|
||||||
|
await run('None');
|
||||||
|
}, { scope: 'worker' }],
|
||||||
|
|
||||||
browserMajorVersion: [async ({ browserVersion }, run) => {
|
browserMajorVersion: [async ({ browserVersion }, run) => {
|
||||||
await run(Number(browserVersion.split('.')[0]));
|
await run(Number(browserVersion.split('.')[0]));
|
||||||
}, { scope: 'worker' }],
|
}, { scope: 'worker' }],
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ it('should get multiple cookies', async ({ context, page, server, defaultSameSit
|
||||||
]));
|
]));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get cookies from multiple urls', async ({ context, browserName, isWindows, platform }) => {
|
it('should get cookies from multiple urls', async ({ context, browserName, isWindows, sameSiteStoredValueForNone }) => {
|
||||||
await context.addCookies([{
|
await context.addCookies([{
|
||||||
url: 'https://foo.com',
|
url: 'https://foo.com',
|
||||||
name: 'doggo',
|
name: 'doggo',
|
||||||
|
|
@ -178,7 +178,7 @@ it('should get cookies from multiple urls', async ({ context, browserName, isWin
|
||||||
expires: -1,
|
expires: -1,
|
||||||
httpOnly: false,
|
httpOnly: false,
|
||||||
secure: true,
|
secure: true,
|
||||||
sameSite: (browserName === 'webkit' && platform === 'darwin' && parseInt(os.release(), 10) >= 24) ? 'Lax' : 'None',
|
sameSite: sameSiteStoredValueForNone,
|
||||||
}]));
|
}]));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -274,7 +274,7 @@ it('should return secure cookies based on HTTP(S) protocol', async ({ context, b
|
||||||
}]);
|
}]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add cookies with an expiration', async ({ context, browserName, platform }) => {
|
it('should add cookies with an expiration', async ({ context, sameSiteStoredValueForNone }) => {
|
||||||
const expires = Math.floor((Date.now() / 1000)) + 3600;
|
const expires = Math.floor((Date.now() / 1000)) + 3600;
|
||||||
await context.addCookies([{
|
await context.addCookies([{
|
||||||
url: 'https://foo.com',
|
url: 'https://foo.com',
|
||||||
|
|
@ -293,7 +293,7 @@ it('should add cookies with an expiration', async ({ context, browserName, platf
|
||||||
expires,
|
expires,
|
||||||
httpOnly: false,
|
httpOnly: false,
|
||||||
secure: true,
|
secure: true,
|
||||||
sameSite: (browserName === 'webkit' && platform === 'darwin' && parseInt(os.release(), 10) >= 24) ? 'Lax' : 'None',
|
sameSite: sameSiteStoredValueForNone,
|
||||||
}]);
|
}]);
|
||||||
{
|
{
|
||||||
// Rollover to 5-digit year
|
// Rollover to 5-digit year
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import os from 'os';
|
|
||||||
import type { LookupAddress } from 'dns';
|
import type { LookupAddress } from 'dns';
|
||||||
import formidable from 'formidable';
|
import formidable from 'formidable';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
@ -1246,7 +1245,7 @@ it('should work with connectOverCDP', async ({ browserName, browserType, server
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support SameSite cookie attribute over https', async ({ contextFactory, httpsServer, browserName, isWindows, platform }) => {
|
it('should support SameSite cookie attribute over https', async ({ contextFactory, httpsServer, browserName, isWindows, sameSiteStoredValueForNone }) => {
|
||||||
// Cookies with SameSite=None must also specify the Secure attribute. WebKit navigation
|
// Cookies with SameSite=None must also specify the Secure attribute. WebKit navigation
|
||||||
// to HTTP url will fail if the response contains a cookie with Secure attribute, so
|
// to HTTP url will fail if the response contains a cookie with Secure attribute, so
|
||||||
// we do HTTPS navigation.
|
// we do HTTPS navigation.
|
||||||
|
|
@ -1262,8 +1261,8 @@ it('should support SameSite cookie attribute over https', async ({ contextFactor
|
||||||
const [cookie] = await page.context().cookies();
|
const [cookie] = await page.context().cookies();
|
||||||
if (browserName === 'webkit' && isWindows)
|
if (browserName === 'webkit' && isWindows)
|
||||||
expect(cookie.sameSite).toBe('None');
|
expect(cookie.sameSite).toBe('None');
|
||||||
else if (browserName === 'webkit' && platform === 'darwin' && value === 'None')
|
else if (value === 'None')
|
||||||
expect(cookie.sameSite).toBe('Lax');
|
expect(cookie.sameSite).toBe(sameSiteStoredValueForNone);
|
||||||
else
|
else
|
||||||
expect(cookie.sameSite).toBe(value);
|
expect(cookie.sameSite).toBe(value);
|
||||||
});
|
});
|
||||||
|
|
@ -1293,7 +1292,7 @@ it('fetch should not throw on long set-cookie value', async ({ context, server }
|
||||||
expect(cookies.map(c => c.name)).toContain('bar');
|
expect(cookies.map(c => c.name)).toContain('bar');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support set-cookie with SameSite and without Secure attribute over HTTP', async ({ page, server, browserName, isWindows, isLinux, isMac }) => {
|
it('should support set-cookie with SameSite and without Secure attribute over HTTP', async ({ page, server, browserName, isWindows, isLinux, sameSiteStoredValueForNone }) => {
|
||||||
for (const value of ['None', 'Lax', 'Strict']) {
|
for (const value of ['None', 'Lax', 'Strict']) {
|
||||||
await it.step(`SameSite=${value}`, async () => {
|
await it.step(`SameSite=${value}`, async () => {
|
||||||
server.setRoute('/empty.html', (req, res) => {
|
server.setRoute('/empty.html', (req, res) => {
|
||||||
|
|
@ -1308,8 +1307,8 @@ it('should support set-cookie with SameSite and without Secure attribute over HT
|
||||||
expect(cookie).toBeFalsy();
|
expect(cookie).toBeFalsy();
|
||||||
else if (browserName === 'webkit' && isWindows)
|
else if (browserName === 'webkit' && isWindows)
|
||||||
expect(cookie.sameSite).toBe('None');
|
expect(cookie.sameSite).toBe('None');
|
||||||
else if (browserName === 'webkit' && isMac && parseInt(os.release(), 10) >= 24 && value === 'None')
|
else if (value === 'None')
|
||||||
expect(cookie.sameSite).toBe('Lax');
|
expect(cookie.sameSite).toBe(sameSiteStoredValueForNone);
|
||||||
else
|
else
|
||||||
expect(cookie.sameSite).toBe(value);
|
expect(cookie.sameSite).toBe(value);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue