github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/features/Login.feature (about) 1 Feature: Login to API management section of the system. 2 3 Scenario: Try to login with valid credentials 4 Given request JSON payload: 5 """ 6 { 7 "username":"admin", 8 "password":"admin" 9 } 10 """ 11 And request header "Content-Type" is set to "application/json" 12 When I request "/login" API path with "POST" method 13 Then I should receive 200 response code 14 And the response should contain "token" 15 And the response should contain "expire" 16 17 Scenario: Try to login with invalid credentials 18 Given request JSON payload: 19 """ 20 { 21 "username":"admin111", 22 "password":"admin111" 23 } 24 """ 25 And request header "Content-Type" is set to "application/json" 26 When I request "/login" API path with "POST" method 27 Then I should receive 401 response code 28 29 Scenario: Try to login with missed credentials 30 Given request header "Content-Type" is set to "application/json" 31 And request JSON payload: 32 """ 33 { 34 "username":"admin111" 35 } 36 """ 37 When I request "/login" API path with "POST" method 38 Then I should receive 401 response code 39 40 Given request header "Content-Type" is set to "application/json" 41 And request JSON payload: 42 """ 43 { 44 "password":"admin111" 45 } 46 """ 47 When I request "/login" API path with "POST" method 48 Then I should receive 401 response code 49 50 Given request header "Content-Type" is set to "application/json" 51 And request JSON payload: 52 """ 53 {} 54 """ 55 When I request "/login" API path with "POST" method 56 Then I should receive 401 response code