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

Add redirect methods #29

Merged
merged 1 commit into from Jan 29, 2021
Merged

Add redirect methods #29

merged 1 commit into from Jan 29, 2021

Conversation

TavoNiievez
Copy link
Member

@Naktibalda Naktibalda merged commit b7406c7 into Codeception:master Jan 29, 2021
@ThomasLandauer
Copy link
Member

@TavoNiievez This was released already? Cause I'd suggest to rename followRedirect to openRedirectedUrl (or openRedirectedLocation or openRedirectedPage). Why?

  • followRedirect sounds to me like I'm supposed to somehow pass a redirect into it: followRedirect($redirect)
  • "follow" sounds like some long-term action, while in fact it's just a one-time action (isn't it?).

Questions:
1: It does not startFollowingRedirects? I.e. it just follows the pending redirect from the latest request? => Should be explained explicitly.
2: Talking about "latest": If I stopFollowingRedirects, then do 5 amOnPage, then openRedirectedUrl: Only the redirected URL from the latest amOnPage will be executed?
2a: But if this redirect yields another 3xx response, that page won't be called (see 1)? But it will produce another pending redirect, so calling it repeatedly does make sense in some situations:

$I->stopFollowingRedirects();
$I->amOnPage(...);
// ...
$I->openRedirectedUrl();
$I->openRedirectedUrl();
$I->openRedirectedUrl();

TODO:

  • Mention that it only makes sense after stopFollowingRedirects
  • At stopFollowingRedirects, mention this one
  • Add this:

It's basically a shortcut for:
$location = $I->grabHttpHeader('Location'); // REST module
$I->amOnPage($location);

@Naktibalda
Copy link
Member

Yes, it was released as 1.4.0 right after merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants