Skip to content

Commit

Permalink
remove some skipped test in the proxyless mode, add comments (#7586)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev authored Mar 24, 2023
1 parent dd4dc88 commit 83109a4
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 12 deletions.
2 changes: 2 additions & 0 deletions test/functional/fixtures/api/es-next/auth/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Basic and NTLM authentications', function () {
return runTests('./testcafe-fixtures/basic-auth-with-correct-credentials-test.js');
});

// NOTE: NTLM authentication is not supported yet
skipInProxyless('Should authenticate on a "NTLM" server with correct credentials', function () {
return runTests('./testcafe-fixtures/ntlm-auth-check-username-test.js');
});
Expand All @@ -29,6 +30,7 @@ describe('Basic and NTLM authentications', function () {
return runTests('./testcafe-fixtures/basic-auth-with-correct-credentials-test.js', null, { useProxy: TRANSPARENT_PROXY_URL });
});

// NOTE: NTLM authentication is not supported yet
skipInProxyless('Should authenticate on a "NTLM" server with correct credentials', function () {
return runTests('./testcafe-fixtures/ntlm-auth-check-username-test.js', null, { useProxy: TRANSPARENT_PROXY_URL });
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/fixtures/api/es-next/drag/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ describe('[API] Drag actions', function () {
return runTests('./testcafe-fixtures/drag-and-drop-test.js', 'try to drop to undroppable', { skip: ['iphone', 'ipad', 'android'] });
});

// NOTE: Slightly difference in link.href. Probably related to link attribute overriding
skipInProxyless('Should reproduce native browser behavior', function () {
return runTests('./testcafe-fixtures/drag-and-drop-test.js', 'drag link and image', { only: ['chrome'] });
});
Expand Down
10 changes: 6 additions & 4 deletions test/functional/fixtures/api/es-next/take-screenshot/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ describe('[API] t.takeElementScreenshot()', function () {
afterEach(assertionHelper.removeScreenshotDir);

if (config.useLocalBrowsers) {
// NOTE: is the problem not in taking screenshot but in overrided scroll automation?
skipInProxyless('Should take screenshot of an element', function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Element',
{ setScreenshotPath: true })
Expand All @@ -344,6 +345,7 @@ describe('[API] t.takeElementScreenshot()', function () {
});
});

// NOTE: is the problem not in taking screenshot but in overrided scroll automation?
skipInProxyless('Should save screenshots to default dir with custom path specified', function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Element')
.then(function () {
Expand Down Expand Up @@ -552,7 +554,7 @@ describe('[API] t.takeElementScreenshot()', function () {
});
});

skipInProxyless('Should capture screenshot of the element inside a same-domain iframe', function () {
it('Should capture screenshot of the element inside a same-domain iframe', function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Same-domain iframe',
{ setScreenshotPath: true })
.then(function () {
Expand All @@ -563,7 +565,7 @@ describe('[API] t.takeElementScreenshot()', function () {
});
});

skipInProxyless('Should capture screenshot of the element inside a nested iframe', function () {
it('Should capture screenshot of the element inside a nested iframe', function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Nested iframes',
{ setScreenshotPath: true })
.then(function () {
Expand All @@ -574,7 +576,7 @@ describe('[API] t.takeElementScreenshot()', function () {
});
});

skipInProxyless('Should capture screenshot of the element inside a cross-domain iframe', function () {
it('Should capture screenshot of the element inside a cross-domain iframe', function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Cross-domain iframe',
{ setScreenshotPath: true })
.then(function () {
Expand All @@ -585,7 +587,7 @@ describe('[API] t.takeElementScreenshot()', function () {
});
});

skipInProxyless("Shouldn't scroll parent frames multiple times", function () {
it("Shouldn't scroll parent frames multiple times", function () {
return runTests('./testcafe-fixtures/take-element-screenshot.js', 'Rescroll parents',
{ setScreenshotPath: true })
.then(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ test('Bottom-right', async t => {
});

test
.page('../pages/same-domain-iframe.html')
.page('http://localhost:3000/fixtures/api/es-next/take-screenshot/pages/same-domain-iframe.html')
('Same-domain iframe', async t => {
await t
.switchToIframe('iframe')
.takeElementScreenshot('table', 'custom/' + t.ctx.parsedUA.name + '.png');
});

test
.page('../pages/nested-iframe.html')
.page('http://localhost:3000/fixtures/api/es-next/take-screenshot/pages/nested-iframe.html')
('Nested iframes', async t => {
await t
.switchToIframe('iframe')
Expand All @@ -109,7 +109,7 @@ test
});

test
.page('../pages/nested-iframe.html')
.page('http://localhost:3000/fixtures/api/es-next/take-screenshot/pages/nested-iframe.html')
('Rescroll parents', async t => {
await t
.switchToIframe('iframe')
Expand All @@ -124,7 +124,7 @@ test
});

test
.page('../pages/cross-domain-iframe.html')
.page('http://localhost:3000/fixtures/api/es-next/take-screenshot/pages/cross-domain-iframe.html')
('Cross-domain iframe', async t => {
await t
.switchToIframe('iframe')
Expand All @@ -140,7 +140,7 @@ test('Negative scroll target', async t => {
});

test
.page('../pages/element-bottom-right.html')
.page('http://localhost:3000/fixtures/api/es-next/take-screenshot/pages/element-bottom-right.html')
(`Bottom-right element`, async t => {
await t.takeElementScreenshot('table', 'custom/' + t.ctx.parsedUA.name + '.png');
});
1 change: 1 addition & 0 deletions test/functional/fixtures/api/es-next/upload/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { skipInProxyless } = require('../../../../utils/skip-in');

describe('[API] Upload', function () {
describe('t.setFilesToUpload', function () {
// NOTE: file uploading is not supported yet
skipInProxyless('Should upload the specified file', function () {
return runTests('./testcafe-fixtures/upload-test.js', 'Upload the file', { only: 'chrome' });
});
Expand Down
2 changes: 2 additions & 0 deletions test/functional/fixtures/api/raw/upload/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { errorInEachBrowserContains } = require('../../../../assertion-helper.js'


describe('[Raw API] Upload', function () {
// NOTE: file uploading is not supported yet
skipInProxyless('Should upload a file', function () {
return runTests('./testcafe-fixtures/upload.testcafe', 'Upload a file', { shouldFail: true })
.catch(function (errs) {
Expand All @@ -26,6 +27,7 @@ describe('[Raw API] Upload', function () {
});
});

// NOTE: file uploading is not supported yet
skipInProxyless('Should upload files', function () {
return runTests('./testcafe-fixtures/upload.testcafe', 'Upload files', { shouldFail: true })
.catch(function (errs) {
Expand Down
2 changes: 2 additions & 0 deletions test/functional/fixtures/driver/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('TestRun - Driver protocol', function () {
});
});

// NOTE: at this moment page events which come from real user are not prevented
skipInProxyless('Driver should prevent a real action', function () {
return runTests('./testcafe-fixtures/prevent-real-action-test.js', 'Perform native click');
});
Expand All @@ -34,6 +35,7 @@ describe('TestRun - Driver protocol', function () {
return runTests('./testcafe-fixtures/driver-test.js', 'Mixed execution order');
});

// NOTE: this test just is not designed for using in the proxyless mode (see the next ones)
skipInProxyless('Should clear out the localStorage and sessionStorage after test (GH-1546)(proxy)', function () {
return runTests('./testcafe-fixtures/clear-and-lock-storages.js');
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/fixtures/hammerhead/gh-2622/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { skipInProxyless } = require('../../../utils/skip-in');

describe('Page and iframe documents should not contain injected head scripts', () => {
// NOTE: they really contain. Probably it should not affect tests
skipInProxyless('Page and iframe documents should not contain injected head scripts', () => {
return runTests('testcafe-fixtures/index.js');
});
Expand Down
2 changes: 2 additions & 0 deletions test/functional/fixtures/proxy/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Using external proxy server', function () {
return runTests('testcafe-fixtures/index.test.js', null, { useProxy: TRANSPARENT_PROXY_URL });
});

// NOTE: The `--proxy` flag is not supported in the proxyless mode.
skipInProxyless('Should open restricted page via trusted proxy server', function () {
return runTests('testcafe-fixtures/restricted-page.test.js', null, { useProxy: TRUSTED_PROXY_URL });
});
Expand Down Expand Up @@ -41,6 +42,7 @@ describe('Using proxy-bypass', function () {
});
});

// NOTE: The `--proxy` flag is not supported in the proxyless mode.
skipInProxyless('Should open page without proxy but get resource with proxy', function () {
const server = http.createServer(function (req, res) {
res.write('document.getElementById(\'result\').innerHTML = \'proxy\'');
Expand Down
2 changes: 2 additions & 0 deletions test/functional/fixtures/regression/gh-2861/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { skipInProxyless } = require('../../../utils/skip-in');

describe('[Regression](GH-2861) - Should not hang on custom element click', function () {
// NOTE: the the test in incorrect for proxyless mode, since the native click is working
// differently than in the event emulation mode
skipInProxyless('Click on custom element', function () {
return runTests('testcafe-fixtures/index.js', null, { only: ['chrome'] });
});
Expand Down
2 changes: 2 additions & 0 deletions test/functional/fixtures/regression/gh-5886/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { skipInProxyless } = require('../../../utils/skip-in');

describe('[Regression](GH-5886) - Selector for element after switching to the rewritten iframe', function () {
// NOTE: iframe without src, create on client side, content is added using the `write` method.
// proxy mode has some additional scripts to process this scenario
skipInProxyless('Should exist', function () {
return runTests('testcafe-fixtures/index.js');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const { skipInProxyless } = require('../../../../utils/skip-in');

describe("Should provide a valid value for the 'document.title' property", () => {
describe('Initial value', () => {
// NOTE: in the proxy mode we have some additional scripts for processing document.title
// we do not have these scripts in the proxyless mode yet
skipInProxyless('script before and after <title>', () => {
return runTests('./testcafe-fixtures/index.js', 'script before and after <title>');
});
Expand All @@ -19,6 +21,8 @@ describe("Should provide a valid value for the 'document.title' property", () =>
return runTests('./testcafe-fixtures/index.js', 'empty value');
});

// NOTE: in the proxy mode we have some additional scripts for processing document.title
// we do not have these scripts in the proxyless mode yet
skipInProxyless('Change value', () => {
return runTests('./testcafe-fixtures/index.js', 'change value');
});
Expand Down
6 changes: 5 additions & 1 deletion test/functional/fixtures/reporter/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,9 @@ const experimentalDebug = !!process.env.EXPERIMENTAL_DEBUG;
});
}

// NOTE: the `event.isSameOriginPolicyFailed` property return `false` in the proxyless mode,
// but in the proxy mode it returns `true`
// the problem is only with warning log, but not with request mock
skipInProxyless('Should get warning for request hook', async () => {
await runTests('./testcafe-fixtures/failed-cors-validation.js', 'Failed CORS validation', {
only: 'chrome',
Expand Down Expand Up @@ -1163,6 +1166,7 @@ const experimentalDebug = !!process.env.EXPERIMENTAL_DEBUG;
});
});

// NOTE: this test hangs in proxyless for unknown reasons
skipInProxyless('Should raise an error when uncaught exception occurred in any reporter method', async () => {
function createReporterWithBrokenMethod (method) {
const base = {
Expand Down Expand Up @@ -1212,7 +1216,7 @@ const experimentalDebug = !!process.env.EXPERIMENTAL_DEBUG;
});
});

skipInProxyless('Should set options _hasTaskErrors to the runner if an error occurs', async () => {
it('Should set options _hasTaskErrors to the runner if an error occurs', async () => {
try {
await runTests('testcafe-fixtures/index-test.js', 'Simple command err test', { only: ['chrome'], shouldFail: true });
}
Expand Down
3 changes: 1 addition & 2 deletions test/functional/fixtures/screenshots-on-fails/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { expect } = require('chai');
const config = require('../../config.js');
const assertionHelper = require('../../assertion-helper.js');
const { createReporter } = require('../../utils/reporter');
const { skipInProxyless } = require('../../utils/skip-in');

const SCREENSHOT_PATH_MESSAGE_TEXT = 'Screenshot: ___test-screenshots___';
const REPORT_SCREENSHOT_PATH_TEXT_RE = /___test-screenshots___[\\/]\d{4,4}-\d{2,2}-\d{2,2}_\d{2,2}-\d{2,2}-\d{2,2}[\\/]test-1/;
Expand Down Expand Up @@ -102,7 +101,7 @@ describe('Screenshots on fails', function () {
});
});

skipInProxyless('Should save a screenshot to default dir if the ensureElement method fails without screenshotPath specified', function () {
it('Should save a screenshot to default dir if the ensureElement method fails without screenshotPath specified', function () {
return runTests('./testcafe-fixtures/screenshots-on-fails.js', 'Screenshot on the ensureElement method fail',
{ shouldFail: true, selectorTimeout: 0, screenshotsOnFails: true })
.catch(function () {
Expand Down

0 comments on commit 83109a4

Please sign in to comment.