Skip to content

Commit

Permalink
proxyless: small fixes (#7357)
Browse files Browse the repository at this point in the history
  • Loading branch information
miherlosev committed Nov 1, 2022
1 parent 9e35d0a commit 0ce9a64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
28 changes: 13 additions & 15 deletions test/functional/fixtures/api/es-next/iframe-switching/test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const { expect } = require('chai');
const { errorInEachBrowserContains } = require('../../../../assertion-helper.js');

const { skipInProxyless, skipDescribeInProxyless } = require('../../../../utils/skip-in');

// NOTE: we set selectorTimeout to a large value in some tests to wait for
// an iframe to load on the farm (it is fast locally but can take some time on the farm)

Expand All @@ -21,61 +19,61 @@ describe('[API] t.switchToIframe(), t.switchToMainWindow()', function () {
DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should switch context between a nested iframe and the main window', function () {
it('Should switch context between a nested iframe and the main window', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click on element in a nested iframe', {
skip: 'firefox-osx',
...DEFAULT_RUN_OPTIONS,
});
});

skipInProxyless('Should switch context between a shadow iframe and the main window', function () {
it('Should switch context between a shadow iframe and the main window', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click on an element in a shadow iframe and return to the main window', {
...DEFAULT_RUN_OPTIONS,
skip: ['ie', 'edge'],
});
});

skipInProxyless('Should switch context between a nested shadow iframe and the main window', function () {
it('Should switch context between a nested shadow iframe and the main window', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click on element in a nested shadow iframe', {
...DEFAULT_RUN_OPTIONS,
skip: ['ie', 'edge'],
});
});

skipInProxyless('Should wait while a target iframe is loaded', function () {
it('Should wait while a target iframe is loaded', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click in a slowly loading iframe', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should resume execution if an iframe is removed as a result of an action', function () {
it('Should resume execution if an iframe is removed as a result of an action', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Remove an iframe during execution', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should execute an action in an iframe with redirect', function () {
it('Should execute an action in an iframe with redirect', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click in an iframe with redirect', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should keep context if the page was reloaded', function () {
it('Should keep context if the page was reloaded', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Reload the main page from an iframe', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should correctly switch to the main window context if an iframe was removed from the nested one', function () {
it('Should correctly switch to the main window context if an iframe was removed from the nested one', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Remove the parent iframe from the nested one', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should work in an iframe without src', function () {
it('Should work in an iframe without src', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click in an iframe without src', DEFAULT_RUN_OPTIONS);
});

skipInProxyless('Should work in a cross-domain iframe', function () {
it('Should work in a cross-domain iframe', function () {
// TODO: fix this test for Safari on BrowserStack
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click in a cross-domain iframe with redirect', { skip: ['safari', 'firefox-osx'], ...DEFAULT_RUN_OPTIONS });
});

skipInProxyless('Should work in an iframe with the srcdoc attribute', function () {
it('Should work in an iframe with the srcdoc attribute', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Click in an iframe with the srcdoc attribute', { skip: 'ie', ...DEFAULT_RUN_OPTIONS });
});

skipDescribeInProxyless('Unavailable iframe errors', function () {
describe('Unavailable iframe errors', function () {
it('Should ensure the iframe element exists before switching to it', function () {
return runTests('./testcafe-fixtures/iframe-switching-test.js', 'Switch to a non-existent iframe',
{ shouldFail: true })
Expand Down Expand Up @@ -146,7 +144,7 @@ describe('[API] t.switchToIframe(), t.switchToMainWindow()', function () {
});
});

skipDescribeInProxyless('Page errors handling', function () {
describe('Page errors handling', function () {
it('Should fail if an error occurs in a same-domain iframe while an action is being executed', function () {
return runTests('./testcafe-fixtures/page-errors-test.js', 'Error in a same-domain iframe', DEFAULT_FAILED_RUN_OPTIONS)
.catch(function (errs) {
Expand Down
1 change: 1 addition & 0 deletions ts-defs-src/runner-api/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ interface StartOptions {
cache: boolean;
configFile: string;
disableHttp2: boolean;
proxyless: boolean;
}

interface ColorOutputOptions {
Expand Down

0 comments on commit 0ce9a64

Please sign in to comment.