Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions e2e/src/features/user-data-api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ Feature: User Data API
Background:
Given I am authenticated as "flex"

Scenario: Create user for tests
When I send a post to '/user/123' with the body '{"appId":"123", "serviceName": "app"}'
Then I should recieve a successful response
Then the response status should be 201

Scenario: Successfully add data
When I send a post to '/user/123/topics' with the body '{"data":{"test":"data"}}'
When I send a post to '/user/123/topics' with the body '{"test":"data"}'
Then I should recieve a successful response
Then The response will contain message 'Entity saved successfully'

Scenario: Successfully Retrive data
When i send a get to '/user/123/topics'
Then I should recieve a successful response
Then The response body contain body '{"data":{"test":"data"}, "pk":"123","sk":"topics"}'
Then The response body contain body '{"data":{"test":"data"}}'

Scenario: Successfully delete data
When i send a delete to '/user/123/topics'
Expand Down
4 changes: 0 additions & 4 deletions e2e/src/helpers/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ export class ApiClient {
body: body ? JSON.stringify(body) : undefined,
});

if (!response.ok) {
console.log({ response });
}

let data: T;
const contentType = response.headers.get('content-type');
if (contentType?.includes('application/json')) {
Expand Down
2 changes: 0 additions & 2 deletions e2e/src/helpers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export async function getAccessToken(clientName?: string): Promise<string> {
`${clientConfig.clientId}:${clientConfig.clientSecret}`,
).toString('base64');

console.log({ credentials });

const response = await fetch(tokenEndpoint, {
method: 'POST',
headers: {
Expand Down