-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCreation.js
339 lines (320 loc) · 19.1 KB
/
TestCreation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
const axios = require('axios');
const JsonData = require("./DummyData");
const uuid = require('uuid');
//uuid()
var postData= {data:JSON.parse(JsonData.empty)}
// POST
var url = 'https://streams.flamapp.com/flamV2-dev-clickstream'
var testurl = 'https://jsonplaceholder.typicode.com/posts'
function create_UUID(){
var dt = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (dt + Math.random()*16)%16 | 0;
dt = Math.floor(dt/16);
return (c=='x' ? r :(r&0x3|0x8)).toString(16);
});
return uuid;
}
postData.data.log_id = create_UUID();
postData.data.device_id = create_UUID();
postData.data.user_profile_id = create_UUID();;
postData.data.country = "IND";
postData.data.ip = "168.212.226.204";
postData.data.log_time = "2022-09-19 11:30:55.000000";
postData.data.user_details.avatar_testurl = "";
postData.data.user_details.guest_user_profile_id = create_UUID();
postData.data.user_details.is_guest = "true";
postData.data.device_details.device_type = "One Plus 9";
postData.data.device_details.os = "android";
postData.data.device_details.platform = "Android";
postData.data.ui_variant = "1";
postData.data.psid = create_UUID();
postData.data.csid = create_UUID();
postData.data.ssid = create_UUID();
postData.data.meta_data = "false";
postData.data.adjust_event_id = "shareevent";
postData.data.event_id = "eventid";
postData.data.event_category = "Profile";
postData.data.event_type = "Page View Event";
postData.data.event_name = "Create An Experience";
postData.data.data.social_media_platform = "Facebook";
postData.data.event_description = "Back Camera";
postData.data.app_version = "0.1.1";
axios.post(testurl, postData)
.then(function (response) {
console.log("1st req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:05.000786";
postData.data.ssid = create_UUID();
postData.data.log_id = create_UUID();
postData.data.event_name = "Error (No Person Detected / Full Body Required)";
axios.post(testurl, postData).then(()=>{
console.log("2nd req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:15.000786";
postData.data.ssid = create_UUID();
postData.data.log_id = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Flip Camera";
postData.data.event_description = "Front Camera";
axios.post(testurl, postData).then(()=>{
console.log("3rd req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:25.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Record Start";
axios.post(testurl, postData).then(()=>{
console.log("4rth req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:35.000786";
postData.data.log_id = create_UUID();
postData.data.event_name = "Record Stop";
axios.post(testurl, postData).then(()=>{
console.log("5th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:45.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Video Recorded";
postData.data.event_description = "";
axios.post(testurl, postData).then(()=>{
console.log("6th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:31:55.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.user_details.avatar_testurl = "www.newavatar.com";
postData.data.event_name = "Avatar Rendered";
postData.data.data.experience.move_id = create_UUID();
const moveID = postData.data.data.experience.move_id;
axios.post(testurl, postData).then(()=>{
console.log("7th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:05.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "AR Background";
axios.post(testurl, postData).then(()=>{
console.log("8th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:15.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Studio Background";
axios.post(testurl, postData).then(()=>{
console.log("9th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:25.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.user_details.avatar_testurl = "www.changedavatar.com";
postData.data.event_name = "Change Avatar";
axios.post(testurl, postData).then(()=>{
console.log("10th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:35.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Music Options";
axios.post(testurl, postData).then(()=>{
console.log("11th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:45.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
axios.post(testurl, postData).then(()=>{
console.log("12th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:32:55.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Select Music";
axios.post(testurl, postData).then(()=>{
console.log("13th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:05.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Moves Options";
postData.data.data.experience.move_id = "";
postData.data.data.experience.music_id = create_UUID();
const musicID = postData.data.data.experience.music_id;
axios.post(testurl, postData).then(()=>{
console.log("14th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:10.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
axios.post(testurl, postData).then(()=>{
console.log("15th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:15.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Select Move";
postData.data.meta_data = "true";
axios.post(testurl, postData).then(()=>{
console.log("16th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:15.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Warning - Remove Recorded Moves";
postData.data.data.experience.move_id = moveID;
axios.post(testurl, postData).then(()=>{
console.log("17th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:20.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Yes - Remove Recorded Moves";
axios.post(testurl, postData).then(()=>{
console.log("18th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:25.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "No - Remove Recorded Moves";
axios.post(testurl, postData).then(()=>{
console.log("19th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:35.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Scene Options";
axios.post(testurl, postData).then(()=>{
console.log("20th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:45.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
axios.post(testurl, postData).then(()=>{
console.log("21st req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:33:55.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Select Scene";
axios.post(testurl, postData).then(()=>{
console.log("22nd req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:34:05.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Camera Mode";
postData.data.data.experience.scene_id = create_UUID();
axios.post(testurl, postData).then(()=>{
console.log("23rd req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:34:15.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_name = "Finalize Creation";
axios.post(testurl, postData).then(()=>{
console.log("24th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:34:25.000786";
postData.data.log_id = create_UUID();
postData.data.user_details.guest_user_profile_id = postData.data.user_profile_id;
postData.data.user_profile_id = create_UUID();
postData.data.user_details.is_guest = "false";
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
postData.data.data.experience.experience_id = create_UUID();
postData.data.data.experience.is_creation = "true";
postData.data.data.experience.creator_info = create_UUID();
axios.post(testurl, postData).then(()=>{
console.log("25th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:34:30.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Finalize Experience";
axios.post(testurl, postData).then(()=>{
console.log("26th req");
console.log(postData);
postData.data.log_time = "2022-09-19 11:34:45.000786";
postData.data.log_id = create_UUID();
postData.data.ssid = create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Finalized Experience";
axios.post(testurl, postData).then(()=>{
console.log("27th req");
console.log(postData);
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
.catch(function (error) {
console.log(error.data);
})
//console.log(moves)
// console.log(moves);
// .then(res => console.log(res.data))
//let music = apiController.getMusic(getMusicUrl, adminToken);
//let scenes = apiController.getScenes(getScenesUrl, adminToken);
//var movesdata;
//const [resultArray, setResultArray] = useState([]);
// moves.then((res)=>{
// let list = {};
// //console.log(res);
// list = res.data;
// return list;
// });
// console.log(list);
// console.log(music);
// console.log(scenes);
//var user = getUser();
//sendOnBoardingEvent(user);
//sendAppUpdateEvent(user);
//sendOnBoardingEvent();
// function getUser(){
// var user = users[Math.floor(Math.random()*users.length)];
// return user;
// }
// function sendOnBoardingEvent(user, ts){
// url = get_correct_url();
// appUpdate.sendOnBoardingEvent(url, user.user_profile_id, user.user_guest_profile_id, ts);
// }
// function sendAppUpdateEvent(user, ts){
// url = get_correct_url();
// var user = users[Math.floor(Math.random()*users.length)];
// appUpdate.sendAppUpdateEvent(url, user.user_profile_id, user.user_guest_profile_id, ts);
// }
// function sendNudgeEvent(){
// }