tests: code review of acceptance tests

This commit is contained in:
Phil Davis
2024-04-29 13:47:08 +05:45
parent aa26c451f7
commit 86b931f176
24 changed files with 161 additions and 238 deletions
@@ -155,8 +155,7 @@ class SettingsContext implements Context {
*/
public function getRoleIdByRoleName(string $user, string $role): string {
// Sometimes the response body is not complete and results invalid json.
// so we try again until we get a valid json.
$tryAgain = false;
// So we try again until we get a valid json.
$retried = 0;
do {
$response = $this->getRoles($user);
@@ -376,6 +375,7 @@ class SettingsContext implements Context {
$headersTable,
['header', 'value']
);
$headers = [];
foreach ($headersTable as $row) {
$headers[$row['header']] = $row ['value'];
}
@@ -409,6 +409,8 @@ class SettingsContext implements Context {
return $value["value"]["listValue"]["values"][0]["stringValue"];
}
}
// if a language setting was still not found, return English
return "en";
}
/**