Skip to content

Commit

Permalink
Merge pull request #971 from spryker/feature/frw-9071/master-adjusted…
Browse files Browse the repository at this point in the history
…-validation-rules

FRW-9071 Fixing tests
  • Loading branch information
asmarovydlo authored Dec 11, 2024
2 parents 27a4530 + d329986 commit 53ef343
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 180 deletions.
4 changes: 2 additions & 2 deletions resources/common/common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Common_suite_setup
${random_id}= Generate Random String 5 [NUMBERS]
${random_str}= Generate Random String 5 [LETTERS]
${random_str_store}= Generate Random String 2 [UPPER]
${random_str_password}= Generate Random String 2 [LETTERS]
${random_id_password}= Generate Random String 2 [NUMBERS]
${random_str_password}= Generate Random String 5 [LETTERS]
${random_id_password}= Generate Random String 5 [NUMBERS]

Set Global Variable ${random_id}
Set Global Variable ${random_str}
Expand Down
20 changes: 19 additions & 1 deletion resources/environments/environments_api_suite.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"first_name":"Sonia",
"last_name":"Wagner",
"password":"change123",
"password_new":"qweRTY_123",
"password_new":"qweRTY_123456",
"password_new_additional":"Change!23456",
"reference":"DE--21",
"salutation":"Ms"
},
Expand All @@ -40,6 +41,7 @@
"first_name":"Max",
"last_name":"Musterman",
"password":"change123",
"password_new":"Change!23456",
"salutation":"Mr"
},
"yves_fourth_user":{
Expand All @@ -63,6 +65,22 @@
"email":"[email protected]",
"password":"change123"
},
"yves_eighth_user":{
"email":"[email protected]",
"password":"change123",
"password_new":"Change!23456",
"password_new_additional":"qweRTY_123456",
"reference":"DE--2"
},
"yves_ninth_user":{
"email":"[email protected]",
"first_name":"Maggie",
"last_name":"May",
"password":"Change!23456",
"password_new":"qweRTY_123456",
"reference":"DE--3",
"salutation":"Ms"
},
"zed_admin":{
"email":"[email protected]",
"email_de":"[email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Get_acess_token_with_empty_type
When I send a POST request: /access-tokens {"data":{"type":"","attributes":{"username":"${yves_second_user.email}","password":"${yves_second_user.password}"}}}
Then Response status code should be: 400
And Response reason should be: Bad Request
And Response should return error message: Invalid type.
And Response should return error message: Invalid type.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Refresh_token_with_deleted_refresh_token
And Response should return error message: Failed to refresh token.

#######DELETE#######
# Spryker is designed so removing non-existent refresh token will return 204 for security reasons
# Spryker is designed so removing non-existent refresh token will return 204 for security reasons
Delete_refresh_token_with_invalid_refresh_token
[Setup] Run Keywords I get access token for the customer: ${yves_user.email}
... AND I set Headers: Authorization=${token}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ Get_token_using_refresh_token_for_customer_with_invalid_refresh_token
Then Response status code should be: 400
And Response reason should be: Bad Request
And Response body parameter should be: [error] invalid_request
And Response body parameter should be: [error_description] The refresh token is invalid.
And Response body parameter should be: [error_description] The refresh token is invalid.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Customer_confirmation_with_empty_type
And Response header parameter should be: Content-Type ${default_header_content_type}

Customer_confirmation_with_already_used_confirmation_key
[Setup] Run Keywords I send a POST request: /customers {"data":{"type":"customers","attributes":{"firstName":"${yves_third_user.first_name}","lastName":"${yves_third_user.last_name}","gender":"${gender.male}","salutation":"${yves_third_user.salutation}","email":"${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com","password":"${yves_third_user.password}","confirmPassword":"${yves_third_user.password}","acceptedTerms":True}}}
[Setup] Run Keywords I send a POST request: /customers {"data":{"type":"customers","attributes":{"firstName":"${yves_third_user.first_name}","lastName":"${yves_third_user.last_name}","gender":"${gender.male}","salutation":"${yves_third_user.salutation}","email":"${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com","password":"${yves_third_user.password_new}","confirmPassword":"${yves_third_user.password_new}","acceptedTerms":True}}}
... AND Response status code should be: 201
... AND Save value to a variable: [data][id] user_reference_id
... AND Save the result of a SELECT DB query to a variable: select registration_key from spy_customer where customer_reference = '${user_reference_id}' confirmation_key
Expand All @@ -47,8 +47,8 @@ Customer_confirmation_with_already_used_confirmation_key
Then Response status code should be: 422
And Response should return error code: 423
And Response should return error message: This email confirmation code is invalid or has been already used.
[Teardown] Run Keywords I get access token for the customer: ${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com
[Teardown] Run Keywords I get access token for the customer: ${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com ${yves_third_user.password_new}
... AND I set Headers: Content-Type=${default_header_content_type} Authorization=${token}
... AND I send a DELETE request: /customers/${user_reference_id}
... AND Response status code should be: 204
... AND Response reason should be: No Content
... AND Response reason should be: No Content
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ENABLER


Customer_confirmation
[Setup] Run Keywords I send a POST request: /customers {"data":{"type":"customers","attributes":{"firstName":"${yves_third_user.first_name}","lastName":"${yves_third_user.last_name}","gender":"${gender.male}","salutation":"${yves_third_user.salutation}","email":"${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com","password":"${yves_third_user.password}","confirmPassword":"${yves_third_user.password}","acceptedTerms":True}}}
[Setup] Run Keywords I send a POST request: /customers {"data":{"type":"customers","attributes":{"firstName":"${yves_third_user.first_name}","lastName":"${yves_third_user.last_name}","gender":"${gender.male}","salutation":"${yves_third_user.salutation}","email":"${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com","password":"${yves_third_user.password_new}","confirmPassword":"${yves_third_user.password_new}","acceptedTerms":True}}}
... AND Response status code should be: 201
... AND Save value to a variable: [data][id] user_reference_id
... AND Save the result of a SELECT DB query to a variable: select registration_key from spy_customer where customer_reference = '${user_reference_id}' confirmation_key
When I send a POST request: /customer-confirmation {"data":{"type":"customer-confirmation","attributes":{"registrationKey":"${confirmation_key}"}}}
Then Response status code should be: 204
And Response reason should be: No Content
[Teardown] Run Keywords I get access token for the customer: ${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com
[Teardown] Run Keywords I get access token for the customer: ${yves_third_user.first_name}.${yves_third_user.last_name}${random}@spryker.com ${yves_third_user.password_new}
... AND I set Headers: Content-Type=${default_header_content_type} Authorization=${token}
... AND I send a DELETE request: /customers/${user_reference_id}
... AND Response status code should be: 204
... AND Response reason should be: No Content
... AND Response reason should be: No Content
Loading

0 comments on commit 53ef343

Please sign in to comment.