Skip to content

Commit cc681a8

Browse files
authored
Merge pull request #1 from adjoeio/extended-test-case
Extended test case
2 parents fa11d2c + 33f3e42 commit cc681a8

File tree

3 files changed

+238
-17
lines changed

3 files changed

+238
-17
lines changed

README.md

+39-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,41 @@
1-
# API test task
2-
In order to run the API and the documentation execute
1+
# Senior QA Engineer (API) - Test Task
2+
You have done an awesome job in your first interview! We designed this case study to get to
3+
know you and your way of working a little better.
4+
Please take no more than 2h to solve the following questions. Try to focus on the main
5+
important topics and if you struggle with one task try to continue with another one :-)
6+
7+
Important: we want to hire human intelligence, not artificial intelligence. Therefore do not use
8+
AI-assisted tools like chatbots or AI coding assistants (e.g. ChatGPT or GitHub Copilot) to solve
9+
this task. You are of course free to use any other tool you like such as IDEs, normal
10+
autocomplete, libraries and so on. But keep in mind that the point of this task is not to present
11+
the perfect solution under ideal conditions, but to show us how you work.
12+
Note: please do not upload the task or your solution to GitHub or anywhere else. We want to
13+
keep the experience of working on the task the same for all candidates.
314

4-
docker compose up -d
15+
## Run instructions
16+
Clone this Git repository. You will need docker and docker compose installed.
17+
After doing “docker compose up -d” in the root folder of the repo, the backend API as well as the swagger
18+
documentation will be available. In order to access the swagger documentation, go to
19+
your browser and visit http://localhost:8081. All the backend APIs will be available with
20+
the host http://localhost:8080, you can use Postman or curl to test the API and inspect
21+
requests.
22+
Good luck and have fun! 💫
523

6-
in the root of the folder
24+
## Task description
25+
The backend developer has finished implementing APIs that the frontend should use in
26+
order to get campaigns, make a view and make a click. The backend developers have
27+
also created swagger documentation describing the API.
28+
A user is supposed to make a request to /campaign-distribution/campaigns in order to
29+
get the list of campaigns. A campaign is always related to an app, which has a unique creative.
30+
The frontend will later render this response. When a user
31+
scrolls through the list of campaigns, a request to the ViewURL given in the list should be
32+
executed once and this request will return an empty response. When the user clicks on
33+
the campaign in the list, a request to the ClickURL should be executed and this request
34+
will return in the response the store URL to which the user should then be redirected.
35+
36+
## Todo
37+
When you are done, send us a zip file containing the test report with prioritization of the bugs,
38+
as well as any additional material (for example screenshots or log files). If you wrote code or
39+
scripts please include them as well.
40+
Your task is to test the backend API and not any frontend. After your findings, write down a
41+
list of test cases that should be done for regression testing. Suggestions and improvements to the process are also welcome.

api_spec/api.json

+26-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,31 @@
1111
}
1212
],
1313
"paths": {
14-
"/campaign-distribution/campaigns": {
14+
"/campaign-distribution/android/campaigns": {
1515
"get": {
16-
"summary": "Get list of campaigns",
17-
"description": "Get a list of campaigns",
16+
"summary": "Get list of Android campaigns",
17+
"description": "Get a list of Android campaigns",
18+
"responses": {
19+
"200": {
20+
"description": "Successful operation",
21+
"content": {
22+
"application/json": {
23+
"schema": {
24+
"$ref": "#/components/schemas/CampaignList"
25+
}
26+
}
27+
}
28+
},
29+
"400": {
30+
"description": "Invalid request"
31+
}
32+
}
33+
}
34+
},
35+
"/campaign-distribution/ios/campaigns": {
36+
"get": {
37+
"summary": "Get list of iOS campaigns",
38+
"description": "Get a list of iOS campaigns",
1839
"responses": {
1940
"200": {
2041
"description": "Successful operation",
@@ -81,7 +102,7 @@
81102
"properties": {
82103
"CreativeID": {
83104
"type": "string",
84-
"example": "123"
105+
"example": "ed75c3d6-db84-4b2a-85c0-d5d26fb2fba9"
85106
}
86107
}
87108
},
@@ -114,7 +135,7 @@
114135
},
115136
"CreativeID": {
116137
"type": "string",
117-
"example": 123
138+
"example": "ed75c3d6-db84-4b2a-85c0-d5d26fb2fba9"
118139
},
119140
"ClickURL": {
120141
"type": "string",

wiremock/mappings/mocks.json

+173-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
{
44
"request": {
55
"method": "GET",
6-
"url": "/campaign-distribution/campaigns"
6+
"url": "/campaign-distribution/android/campaigns"
77
},
88

99
"response": {
1010
"status": 200,
11-
"body": "{\"Length\":2,\"Campaigns\":[{\"AppID\":\"553834731\",\"AppName\":\"App1\",\"CreativeID\":\"one\",\"ClickURL\":\"/campaign-click/click/123\",\"ViewURL\":\"/campaign-view/view/123\"}]}",
11+
"body": "{\"Length\":3,\"Campaigns\":[{\"AppID\":\"6458097001\",\"AppName\":\"Archery Clash\",\"CreativeID\":\"31f15623-57c6-450e-82eb-1fda52cade22\",\"ClickURL\":\"/campaign-click/click/123\",\"ViewURL\":\"/campaign-view/view/123\"},{\"AppID\":\"ball.sort.color.puz.game.puzzle\",\"AppName\":\"Ballsort\",\"CreativeID\":\"7f79cb7e-9285-442e-9e64-e861c9b1e60c\",\"ClickURL\":\"/campaign-click/click/321\",\"ViewURL\":\"/campaign-view/view/321\"}]}",
1212
"headers": {
1313
"Content-Type": "text/json"
1414
},
@@ -19,17 +19,122 @@
1919
}
2020
}
2121
},
22+
{
23+
"request": {
24+
"method": "GET",
25+
"url": "/campaign-distribution/ios/campaigns"
26+
},
27+
"response": {
28+
"status": 200,
29+
"body": "{\"Campaigns\":[{\"AppID\":\"6466648550\",\"AppName\":\"Warriors\",\"CreativeID\":\"356054a8-7129-474b-848f-4aa6e164c492\",\"ClickURL\":\"/campaign-click/click/456\",\"ViewURL\":\"/campaign-view/view/456\"},{\"AppID\":\"1494108691\",\"AppName\":\"Sort puzzle\",\"CreativeID\":\"356054a8-7129-474b-848f-4aa6e164c492\",\"ClickURL\":\"/campaign-click/click/567\",\"ViewURL\":\"/campaign-view/view/567\"}]}",
30+
"headers": {
31+
"Content-Type": "text/json"
32+
}
33+
}
34+
},
35+
{
36+
"priority": 1,
37+
"request": {
38+
"method": "POST",
39+
"url": "/campaign-click/click/321",
40+
"bodyPatterns": [
41+
{
42+
"matchesJsonSchema": {
43+
"type": "object",
44+
"required": ["CreativeID"],
45+
"properties": {
46+
"CreativeID": {
47+
"type": "string"
48+
}
49+
}
50+
}
51+
}
52+
]
53+
},
54+
"response": {
55+
"status": 200,
56+
"body": "{\"StoreURL\":\"https://play.google.com/store/apps/details?id=ball.sort.color.puz.game.puzzle\"}",
57+
"headers": {
58+
"Content-Type": "text/json"
59+
}
60+
}
61+
},
2262
{
2363
"priority": 1,
2464
"request": {
2565
"method": "POST",
2666
"url": "/campaign-click/click/123",
27-
"bodyPatterns": [{ "equalToJson": "{\"CreativeID\":\"one\"}" }]
67+
"bodyPatterns": [
68+
{
69+
"matchesJsonSchema": {
70+
"type": "object",
71+
"required": ["CreativeID"],
72+
"properties": {
73+
"CreativeID": {
74+
"type": "string"
75+
}
76+
}
77+
}
78+
}
79+
]
80+
},
81+
"response": {
82+
"status": 200,
83+
"body": "{\"StoreURL\":\"https://apps.apple.com/us/app/id6458097001\"}",
84+
"headers": {
85+
"Content-Type": "text/json"
86+
}
87+
}
88+
},
89+
{
90+
"priority": 1,
91+
"request": {
92+
"method": "POST",
93+
"url": "/campaign-click/click/456",
94+
"bodyPatterns": [
95+
{
96+
"matchesJsonSchema": {
97+
"type": "object",
98+
"required": ["CreativeID"],
99+
"properties": {
100+
"CreativeID": {
101+
"type": "string"
102+
}
103+
}
104+
}
105+
}
106+
]
107+
},
108+
"response": {
109+
"status": 200,
110+
"body": "{\"StoreURL\":\"https://apps.apple.com/us/app/id666648550\"}",
111+
"headers": {
112+
"Content-Type": "text/json"
113+
}
114+
}
115+
},
116+
{
117+
"priority": 1,
118+
"request": {
119+
"method": "POST",
120+
"url": "/campaign-click/click/567",
121+
"bodyPatterns": [
122+
{
123+
"matchesJsonSchema": {
124+
"type": "object",
125+
"required": ["CreativeID"],
126+
"properties": {
127+
"CreativeID": {
128+
"type": "string"
129+
}
130+
}
131+
}
132+
}
133+
]
28134
},
29-
30135
"response": {
31136
"status": 200,
32-
"body": "{\"StoreURL\":\"https://apps.apple.com/us/app/id553834731\"}",
137+
"body": "{\"StoreURL\":\"https://apps.apple.com/us/app/id1494108691\"}",
33138
"headers": {
34139
"Content-Type": "text/json"
35140
}
@@ -83,14 +188,74 @@
83188
"url": "/campaign-view/view/123",
84189
"bodyPatterns": [
85190
{
86-
"equalToJson": "{\"CreativeID\":\"one\"}"
191+
"equalToJson": "{\"CreativeID\":\"31f15623-57c6-450e-82eb-1fda52cade22\"}"
192+
}
193+
]
194+
},
195+
196+
"response": {
197+
"status": 301,
198+
"body": "{\"RedirectURL\":\"https://apps.apple.com/us/app/id6466648550\"}",
199+
"headers": {
200+
"Content-Type": "text/json"
201+
}
202+
}
203+
},
204+
{
205+
"priority": 1,
206+
"request": {
207+
"method": "POST",
208+
"url": "/campaign-view/view/321",
209+
"bodyPatterns": [
210+
{
211+
"equalToJson": "{\"CreativeID\":\"7f79cb7e-9285-442e-9e64-e861c9b1e60c\"}"
212+
}
213+
]
214+
},
215+
216+
"response": {
217+
"status": 301,
218+
"body": "{\"RedirectURL\":\"https://play.google.com/store/apps/details?id=ball.sort.color.puz.game.puzzle\"}",
219+
"headers": {
220+
"Content-Type": "text/json"
221+
}
222+
}
223+
},
224+
{
225+
"priority": 1,
226+
"request": {
227+
"method": "POST",
228+
"url": "/campaign-view/view/456",
229+
"bodyPatterns": [
230+
{
231+
"equalToJson": "{\"CreativeID\":\"356054a8-7129-474b-848f-4aa6e164c492\"}"
87232
}
88233
]
89234
},
90235

91236
"response": {
92237
"status": 301,
93-
"body": "{\"RedirectURL\":\"https://apps.apple.com/us/app/id553834731\"}",
238+
"body": "{\"RedirectURL\":\"https://apps.apple.com/us/app/id6466648550\"}",
239+
"headers": {
240+
"Content-Type": "text/json"
241+
}
242+
}
243+
},
244+
{
245+
"priority": 1,
246+
"request": {
247+
"method": "POST",
248+
"url": "/campaign-view/view/567",
249+
"bodyPatterns": [
250+
{
251+
"equalToJson": "{\"CreativeID\":\"356054a8-7129-474b-848f-4aa6e164c492\"}"
252+
}
253+
]
254+
},
255+
256+
"response": {
257+
"status": 301,
258+
"body": "{\"RedirectURL\":\"https://apps.apple.com/us/app/id1494108691\"}",
94259
"headers": {
95260
"Content-Type": "text/json"
96261
}
@@ -100,7 +265,7 @@
100265
"priority": 2,
101266
"request": {
102267
"method": "POST",
103-
"url": "/campaign-view/view/123",
268+
"url": "/campaign-view/view/[0-9]*",
104269
"bodyPatterns": [
105270
{
106271
"matchesJsonSchema": {

0 commit comments

Comments
 (0)