[test-only] apiTest. change own password (#4480)
* apiTest. change own password * fix
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@api
|
||||
Feature: an user changes its own password
|
||||
|
||||
Scenario Outline: change own password
|
||||
Given user "Alice" has been created with default attributes and without skeleton files
|
||||
When the user "Alice" changes its own password "<currentPassword>" to "<newPassword>" using the Graph API
|
||||
Then the HTTP status code should be "<code>"
|
||||
Examples:
|
||||
| currentPassword | newPassword | code |
|
||||
| 123456 | validPass | 204 |
|
||||
| 123456 | кириллица | 204 |
|
||||
| 123456 | 密码 | 204 |
|
||||
| 123456 | ?&^%0 | 204 |
|
||||
| 123456 | | 400 |
|
||||
| 123456 | 123456 | 400 |
|
||||
| wrongPass | 123456 | 500 |
|
||||
| | validPass | 400 |
|
||||
@@ -536,4 +536,25 @@ class GraphContext implements Context {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^the user "([^"]*)" changes its own password "([^"]*)" to "([^"]*)" using the Graph API$/
|
||||
* @param string $user
|
||||
* @param string $currentPassword
|
||||
* @param string $newPassword
|
||||
*
|
||||
* @throws GuzzleException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userChangesOwnPassword(string $user, string $currentPassword, $newPassword): void {
|
||||
$response = GraphHelper::changeOwnPassword(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$currentPassword,
|
||||
$newPassword
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user