mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 05:37:20 +03:00
test: uncomment more cookies tests
This commit is contained in:
parent
8989da6c16
commit
505c9e3660
@ -24,6 +24,7 @@ import { Events } from './events';
|
||||
import { Page, Viewport } from './Page';
|
||||
import { Target } from './Target';
|
||||
import { TaskQueue } from './TaskQueue';
|
||||
import { Protocol } from './protocol';
|
||||
|
||||
export class Browser extends EventEmitter {
|
||||
_defaultViewport: Viewport;
|
||||
@ -272,7 +273,7 @@ export class BrowserContext extends EventEmitter {
|
||||
|
||||
async setCookies(cookies: SetNetworkCookieParam[]) {
|
||||
cookies = rewriteCookies(cookies);
|
||||
const cc = cookies.map(c => ({ ...c, session: c.expires === -1 || c.expires === undefined }));
|
||||
const cc = cookies.map(c => ({ ...c, session: c.expires === -1 || c.expires === undefined })) as Protocol.Browser.SetCookieParam[];
|
||||
await this._browser._connection.send('Browser.setCookies', { cookies: cc, browserContextId: this._id });
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROME, WEBKIT}) {
|
||||
module.exports.addTests = function ({ testRunner, expect, defaultBrowserOptions, playwright }) {
|
||||
const {describe, xdescribe, fdescribe} = testRunner;
|
||||
const {it, fit, xit} = testRunner;
|
||||
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
|
||||
@ -40,14 +40,13 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
|
||||
domain: 'localhost',
|
||||
path: '/',
|
||||
expires: -1,
|
||||
size: 16,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
session: true,
|
||||
sameSite: 'None',
|
||||
}]);
|
||||
});
|
||||
it.skip(WEBKIT)('context.setCookies() should work', async({page, server}) => {
|
||||
it('context.setCookies() should work', async({page, server}) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.browserContext().setCookies([{
|
||||
url: server.EMPTY_PAGE,
|
||||
@ -61,14 +60,13 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
|
||||
domain: 'localhost',
|
||||
path: '/',
|
||||
expires: -1,
|
||||
size: 16,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
session: true,
|
||||
sameSite: 'None',
|
||||
}]);
|
||||
});
|
||||
it.skip(WEBKIT)('context.clearCookies() should work', async({page, server}) => {
|
||||
it('context.clearCookies() should work', async({page, server}) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.browserContext().setCookies([{
|
||||
url: server.EMPTY_PAGE,
|
||||
|
Loading…
Reference in New Issue
Block a user