Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test hangs after a form submitting #4553

Closed
LavrovArtem opened this issue Dec 6, 2019 · 2 comments
Closed

Test hangs after a form submitting #4553

LavrovArtem opened this issue Dec 6, 2019 · 2 comments
Labels
AREA: client FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@LavrovArtem
Copy link
Contributor

What is your Test Scenario?

  1. Switch to a same-domain iframe
  2. Submit a form to the current iframe
  3. Redirect to a cross-domain url

What is the Current behavior?

Test hangs.

What is your web application and your TestCafe test code?

Test server:
const http = require('http');

http
    .createServer((req, res) => {
        if (req.url === '/') {
            res.writeHead(200, { 'content-type': 'text/html' });
            res.end('<iframe src="/iframe"></iframe>');
        } else if (req.url === '/iframe') {
            res.writeHead(200, { 'content-type': 'text/html' });
            res.end(`
                <h1>Same-domain iframe</h1>
                <form action="/cross-domain-redirect">
                    <input type="submit" value="Submit">
                </form>
            `);
        } else if (req.url === '/cross-domain-redirect?') {
            res.writeHead(302, { 'location': 'http://localhost:2020/cross-domain-iframe' });
            res.end();
        } else
            res.end();
    })
    .listen(2019, () => console.log('http://localhost:2019/'));


http
    .createServer((req, res) => {
        if (req.url === '/cross-domain-iframe') {
            res.writeHead(200, { 'content-type': 'text/html' });
            res.end('<h1>Cross-domain iframe</h1>');
        } else
            res.end();
    })
    .listen(2020); 
Test code:
fixture`Cross-domain form action`
    .page`http://localhost:2019/`;

test('Switch and submit', async t => {
    await t
        .switchToIframe('iframe')
        .click('input');
});
Test with workaround:
import { ClientFunction } from 'testcafe';

fixture`Cross-domain form action`
    .page`http://localhost:2019/`;

test('Switch and submit', async t => {
    await t.switchToIframe('iframe');
    await ClientFunction(() => document.querySelector('input').click());
});
@AndreyBelym AndreyBelym added AREA: client FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug). labels Dec 6, 2019
@AndreyBelym AndreyBelym added this to the Planned milestone Dec 6, 2019
@LavrovArtem
Copy link
Contributor Author

LavrovArtem commented Dec 6, 2019

SC ticket id: T815222

@AndreyBelym
Copy link
Contributor

Duplicate of #4232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants