From d55f437320c53161f807c424948fccad59c41f23 Mon Sep 17 00:00:00 2001 From: JouwNaam Date: Sat, 15 Mar 2025 20:32:22 +0100 Subject: [PATCH] API test toegevoegd voor het toevoegen van klanten. --- Tests/Klant_Toevoegen_API.robot | 19 +++++++++++++++++++ requirements.txt | Bin 996 -> 1246 bytes 2 files changed, 19 insertions(+) create mode 100644 Tests/Klant_Toevoegen_API.robot diff --git a/Tests/Klant_Toevoegen_API.robot b/Tests/Klant_Toevoegen_API.robot new file mode 100644 index 0000000..4d971d6 --- /dev/null +++ b/Tests/Klant_Toevoegen_API.robot @@ -0,0 +1,19 @@ +*** Settings *** +Library RequestsLibrary +Library FakerLibrary locale=nl_NL + +*** Variables *** +${BASE_URL} https://api-paypoint-test.melvanveen.nl/api +${CUSTOMERS} /customers + +*** Test Cases *** +Nieuwe Klant Toevoegen + [Documentation] Voegt een nieuwe klant toe met behulp van random data. Hiervoor wordt API gebruikt in plaats van de GUI. + ${voornaam}= FakerLibrary.First Name Nonbinary + ${achternaam}= FakerLibrary.Last Name + ${body}= Create Dictionary firstName=${voornaam} lastName=${achternaam} email=jejim33876@barodis.com + ${response}= POST ${BASE_URL}${CUSTOMERS} json=${body} + Status Should Be 200 ${response} + Should Be Equal As Strings ${voornaam} ${response.json()}[firstName] + Should Be Equal As Strings ${achternaam} ${response.json()}[lastName] + Should Be Equal As Strings jejim33876@barodis.com ${response.json()}[email] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f29bbf25db3da2eeaa5e86f4aaf764a85716e60c..a8ee625be7e1f4b65024f25b603aecfabaf19a48 100644 GIT binary patch delta 226 zcmaFDevdQZ|G#90RE8pk5{68MG$6JGLL&wPAU0*tV=x3_V<5@Pz{QZvkin1$R9OsE zU&5fvkjIb@