From aa6ee75b92068d79186ba57d6621448f59f72fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20L=C3=B3pez?= Date: Fri, 27 Sep 2024 14:48:43 +0200 Subject: [PATCH] Updated response code behat tests --- .../tests/behat/local/features/200.feature | 23 ++++++----------- .../tests/behat/local/features/403.feature | 25 ++++++++----------- .../tests/behat/local/features/404.feature | 17 +++++++------ 3 files changed, 28 insertions(+), 37 deletions(-) diff --git a/aljibe-kickstart/tests/behat/local/features/200.feature b/aljibe-kickstart/tests/behat/local/features/200.feature index 8647707..19342ef 100644 --- a/aljibe-kickstart/tests/behat/local/features/200.feature +++ b/aljibe-kickstart/tests/behat/local/features/200.feature @@ -1,18 +1,11 @@ -Feature: - As a Maintainer - I want to check that main pages are accesible +Feature: As a user + I want to visit the following pages + So that I can browse the site! - @behat - Scenario: Homepage is working - Given I go to "/" + Scenario Outline: 200 response + When I go to "" Then the response status code should be 200 - @behat - Scenario: Robots.txt is working - Given I go to "/robots.txt" - Then the response status code should be 200 - -# @behat -# Scenario: Sitemap is working -# Given I go to "/sitemap.xml" -# Then the response status code should be 200 \ No newline at end of file + Examples: + | url | + | / | diff --git a/aljibe-kickstart/tests/behat/local/features/403.feature b/aljibe-kickstart/tests/behat/local/features/403.feature index 59bd23a..d8ab392 100644 --- a/aljibe-kickstart/tests/behat/local/features/403.feature +++ b/aljibe-kickstart/tests/behat/local/features/403.feature @@ -1,18 +1,13 @@ -Feature: - As a Maintainer - I want to check that blocked pages are not accesible +Feature: As a system + I want to block the following pages + So user cannot access where they should not! - @behat - Scenario: Admin area is not accesible - Given I go to "/admin" + Scenario Outline: 403 response + When I go to "" Then the response status code should be 403 - @behat - Scenario: User root profile page is not acccesible - Given I go to "/user/1" - Then the response status code should be 403 - - @behat - Scenario: User register page is not acccesible - Given I go to "/user/register" - Then the response status code should be 403 + Examples: + | url | + | /admin | + | /user/1 | + | /user/register | diff --git a/aljibe-kickstart/tests/behat/local/features/404.feature b/aljibe-kickstart/tests/behat/local/features/404.feature index 5e529a7..b69f90a 100644 --- a/aljibe-kickstart/tests/behat/local/features/404.feature +++ b/aljibe-kickstart/tests/behat/local/features/404.feature @@ -1,8 +1,11 @@ -Feature: - As a Maintainer - I want to check that some urls return not found code +Feature: As a system + I want to make not-found the following pages + So user cannot access where they should not! - @behat - Scenario: Homepage works - Given I go to "/url-not-working" - Then the response status code should be 404 \ No newline at end of file + Scenario Outline: 404 response + When I go to "" + Then the response status code should be 404 + + Examples: + | url | + | /url-not-found |