Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ services:
# --- Tests:

chrome.catroweb:
image: zenika/alpine-chrome:100
image: zenika/alpine-chrome:124
container_name: chrome.catroweb
restart: on-failure
shm_size: '512mb'
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
# --- Tests:

chrome.catroweb:
image: zenika/alpine-chrome:100
image: zenika/alpine-chrome:124
container_name: chrome.catroweb
shm_size: '512mb'
restart: on-failure
Expand Down
21 changes: 21 additions & 0 deletions src/System/Testing/Behat/Context/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,27 @@ public function theResponseStatusCodeShouldBe(string $status_code): void
);
}

/**
* @Then /^the response Location header should be "([^"]*)"$/
*
* @throws \Exception
*/
public function theResponseLocationHeaderShouldBe(string $expected_url): void
{
$location_header = $this->getKernelBrowser()->getResponse()->headers->get('Location');
Assert::assertSame($expected_url, $location_header);
}

/**
* @Given /^I do not follow redirects$/
*
* @throws \Exception
*/
public function iDoNotFollowRedirects(): void
{
$this->getKernelBrowser()->followRedirects(false);
}

/**
* @Then /^the response should be in json format$/
*
Expand Down
22 changes: 14 additions & 8 deletions tests/BehatFeatures/web/general/help.feature
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
@web @help
Feature: Help page redirect

# Note: assert via HTTP redirect (Location header), not browser navigation.
# Browser navigation triggered Chrome OOM crashes when loading the heavy
# external catrobat.org/docs/ page in CI.

Scenario: Navigating to "/app/help" should redirect to the wiki
When I switch the language to "English"
And I go to "/app/help"
And I wait for the page to be loaded
Then I should be on "https://catrobat.org/docs/"
Given I do not follow redirects
When I set request language to "English"
And I GET "/app/help"
Then the response status code should be "302"
And the response Location header should be "https://catrobat.org/docs/"

Scenario: Navigating to "/app/help" should redirect to a german page
When I switch the language to "Deutsch"
And I go to "/app/help"
And I wait for the page to be loaded
Then I should be on "https://catrobat.org/de/dokumentation/"
Given I do not follow redirects
When I set request language to "Deutsch"
And I GET "/app/help"
Then the response status code should be "302"
And the response Location header should be "https://catrobat.org/de/dokumentation/"
Loading