redirect after iFrame dosen't happening
See original GitHub issueAre you requesting a feature or reporting a bug?
Maybe it is a bug, I’m not sure, I just want to try testcafe…
What is the current behavior?
I want to build a login script, after login via iFrame the redirect dosen’t happening and I will get a 404 page, this is my test script: import { Selector } from ‘testcafe’; import {ClientFunction} from ‘testcafe’
fixture Getting Started
// declare the fixture
.page https://www.aboutyou.de/
; // specify the start page
//then create a test and place your code there test(‘Login test with new User’, async t => { const getLocation = ClientFunction(() => window.location.href);
// NOTE: the ClientFunction will be executed in TOP window's context
console.log(await getLocation());
await t
.click('button.login_8b49da')
.switchToIframe('.iframe_1k7bcr7')
.typeText('body > main > div > div.login-section.fade-in-out-transition > form > div:nth-child(1) > div > input', 'test@test.de3')
.typeText('body > main > div > div.login-section.fade-in-out-transition > form > div.form-wrapper > div > div > div:nth-child(2) > input', '12345')
.click('body > main > div > div.login-section.fade-in-out-transition > form > button')
.switchToMainWindow()
.expect(Selector('#app > section > div.navigation_1ie55wv > div.topWrapper_17208h5 > div > div.logoContainer_9563j8 > a > div > div.youWrapper_pzivoe > div.text_1apmb75-o_O-nick_ay4wjb').innerText)
.eql('vorname');
});
What is the expected behavior?
I should be redirected to the main page. If I’m doing a manually log in after the iFrame I will go trough this redirects:
Status Code URL IP Page Type Redirect Type Redirect URL 302 https://checkout.aboutyou.de/oauth/success ...* server_redirect temporary https://www.aboutyou.de/oauth?state=* 200 https://www.aboutyou.de/oauth?state=* ...* client_redirect javascript https://www.aboutyou.de/ 200 https://www.aboutyou.de/ ...* normal none none
How would you reproduce the current behavior (if this is a bug)?
please try my provided script
Provide the test code and the tested page URL (if applicable)
it is in the “What is the current behavior?” section Tested page URL: https://www.aboutyou.de/ Test code
import { Selector } from 'testcafe';
import {ClientFunction} from 'testcafe'
fixture `Getting Started`// declare the fixture
.page `https://www.aboutyou.de/`; // specify the start page
//then create a test and place your code there
test('Login test with new User', async t => {
const getLocation = ClientFunction(() => window.location.href);
// NOTE: the ClientFunction will be executed in TOP window's context
console.log(await getLocation());
await t
.click('button.login_8b49da')
.switchToIframe('.iframe_1k7bcr7')
.typeText('body > main > div > div.login-section.fade-in-out-transition > form > div:nth-child(1) > div > input', 'test@test.de3')
.typeText('body > main > div > div.login-section.fade-in-out-transition > form > div.form-wrapper > div > div > div:nth-child(2) > input', '12345')
.click('body > main > div > div.login-section.fade-in-out-transition > form > button')
.switchToMainWindow()
.expect(Selector('#app > section > div.navigation_1ie55wv > div.topWrapper_17208h5 > div > div.logoContainer_9563j8 > a > div > div.youWrapper_pzivoe > div.text_1apmb75-o_O-nick_ay4wjb').innerText)
.eql('vorname');
});
Specify your
- operating system: mac 10.13.4 (17E199)
- testcafe version: 0.19.2
- node.js version: v9.10.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
I’m working on this
Hey @AndreyBelym, I’m having the same issue where the
state
param is being dropped in the roundtrip for oauth. We’re in the same boat as @sebokgabor84 where we’re inside an iFrame. I’m wondering if there is any progress on debugging/solution for this?