Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(tests): move setCacheEnabled interception test to features (#253)

Yury Semikhatsky394c74fa5f88
diff --git a/test/features/interception.spec.js b/test/features/interception.spec.js
index c80b9f45be..5f59e94562 100644
--- a/test/features/interception.spec.js
+++ b/test/features/interception.spec.js
@@ -645,6 +645,21 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
expect(requests.get('style.css').isNavigationRequest()).toBe(false);
});
});
+
+ describe('Page.setCacheEnabled', function() {
+ it('should stay disabled when toggling request interception on/off', async({page, server}) => {
+ await page.setCacheEnabled(false);
+ await page.interception.enable();
+ await page.interception.disable();
+
+ await page.goto(server.PREFIX + '/cached/one-style.html');
+ const [nonCachedRequest] = await Promise.all([
+ server.waitForRequest('/cached/one-style.html'),
+ page.reload(),
+ ]);
+ expect(nonCachedRequest.headers['if-modified-since']).toBe(undefined);
+ });
+ });
};
/**
diff --git a/test/page.spec.js b/test/page.spec.js
index 4702e86bec..3894d980e0 100644
--- a/test/page.spec.js
+++ b/test/page.spec.js
@@ -867,18 +867,6 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
]);
expect(nonCachedRequest.headers['if-modified-since']).toBe(undefined);
});
- it.skip(WEBKIT)('should stay disabled when toggling request interception on/off', async({page, server}) => {
- await page.setCacheEnabled(false);
- await page.interception.enable();
- await page.interception.disable();
-
- await page.goto(server.PREFIX + '/cached/one-style.html');
- const [nonCachedRequest] = await Promise.all([
- server.waitForRequest('/cached/one-style.html'),
- page.reload(),
- ]);
- expect(nonCachedRequest.headers['if-modified-since']).toBe(undefined);
- });
});
describe('Page.title', function() {