From 0a84c9daac341c9939bb25cb24ca10c905b41183 Mon Sep 17 00:00:00 2001 From: GitBluub Date: Fri, 1 Dec 2023 23:37:35 +0100 Subject: [PATCH] fix: robot tests with apikey --- back/test/robot/albums/albums.robot | 2 ++ back/test/robot/artists/artists.robot | 2 ++ back/test/robot/auth/auth.resource | 5 +++++ back/test/robot/auth/auth.robot | 2 ++ back/test/robot/auth/guest.robot | 2 +- back/test/robot/genres/genres.robot | 2 ++ back/test/robot/history/history.robot | 1 + back/test/robot/lesson/lesson.robot | 2 ++ back/test/robot/songs/songs.robot | 2 ++ 9 files changed, 19 insertions(+), 1 deletion(-) diff --git a/back/test/robot/albums/albums.robot b/back/test/robot/albums/albums.robot index 9f03c73..4bff523 100644 --- a/back/test/robot/albums/albums.robot +++ b/back/test/robot/albums/albums.robot @@ -3,6 +3,8 @@ Documentation Tests of the /album route. ... Ensures that the album CRUD works corectly. Resource ../rest.resource +Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases *** diff --git a/back/test/robot/artists/artists.robot b/back/test/robot/artists/artists.robot index e0189c7..19f90b0 100644 --- a/back/test/robot/artists/artists.robot +++ b/back/test/robot/artists/artists.robot @@ -3,6 +3,8 @@ Documentation Tests of the /artist route. ... Ensures that the artist CRUD works corectly. Resource ../rest.resource +Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases *** diff --git a/back/test/robot/auth/auth.resource b/back/test/robot/auth/auth.resource index 6f6064c..99a874c 100644 --- a/back/test/robot/auth/auth.resource +++ b/back/test/robot/auth/auth.resource @@ -5,6 +5,11 @@ Resource ../rest.resource *** Keywords *** +ApiKey + [Documentation] Set the API Key + Set Headers {"Authorization": "API Key %{API_KEY_ROBOT}"} + + Login [Documentation] Shortcut to login with the given username for future requests [Arguments] ${username} diff --git a/back/test/robot/auth/auth.robot b/back/test/robot/auth/auth.robot index 7d39b97..7954983 100644 --- a/back/test/robot/auth/auth.robot +++ b/back/test/robot/auth/auth.robot @@ -4,6 +4,8 @@ Documentation Tests of the /auth route. Resource ../rest.resource Resource ./auth.resource +Test Setup ApiKey + *** Test Cases *** diff --git a/back/test/robot/auth/guest.robot b/back/test/robot/auth/guest.robot index f6fa40d..3325369 100644 --- a/back/test/robot/auth/guest.robot +++ b/back/test/robot/auth/guest.robot @@ -66,7 +66,7 @@ GuestToNormal Integer response status 200 Boolean response body isGuest true - ${res}= PUT /auth/me { "username": "toto", "password": "toto", "email": "a@b.c"} + ${res}= PUT /auth/me { "username": "toto", "password": "toto", "email": "awdaw@b.c"} Output Integer response status 200 String response body username "toto" diff --git a/back/test/robot/genres/genres.robot b/back/test/robot/genres/genres.robot index ab6b12a..e81ee2d 100644 --- a/back/test/robot/genres/genres.robot +++ b/back/test/robot/genres/genres.robot @@ -3,6 +3,8 @@ Documentation Tests of the /genre route. ... Ensures that the genre CRUD works corectly. Resource ../rest.resource +Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases *** diff --git a/back/test/robot/history/history.robot b/back/test/robot/history/history.robot index e2f39d6..6430c7e 100644 --- a/back/test/robot/history/history.robot +++ b/back/test/robot/history/history.robot @@ -4,6 +4,7 @@ Documentation Tests of the /history route. Resource ../rest.resource Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases *** diff --git a/back/test/robot/lesson/lesson.robot b/back/test/robot/lesson/lesson.robot index 9c72ff7..39bca86 100644 --- a/back/test/robot/lesson/lesson.robot +++ b/back/test/robot/lesson/lesson.robot @@ -3,6 +3,8 @@ Documentation Tests of the /lesson route. ... Ensures that the lesson CRUD works corectly. Resource ../rest.resource +Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases *** diff --git a/back/test/robot/songs/songs.robot b/back/test/robot/songs/songs.robot index f35e78d..047753b 100644 --- a/back/test/robot/songs/songs.robot +++ b/back/test/robot/songs/songs.robot @@ -4,6 +4,8 @@ Documentation Tests of the /song route. Resource ../rest.resource Resource ../auth/auth.resource +Resource ../auth/auth.resource +Test Setup ApiKey *** Test Cases ***