@@ -30,7 +30,7 @@ const dummyQueue = [
30
30
describe ( "Session tests " , ( ) => {
31
31
it ( "Checks if session start, extension and ending works with a dummy queue" , ( ) => {
32
32
hp . haltAndClearStorage ( ( ) => {
33
- // initialize countly
33
+ // initialize countly
34
34
initMain ( ) ;
35
35
// begin session
36
36
Countly . begin_session ( ) ;
@@ -50,7 +50,7 @@ describe("Session tests ", () => {
50
50
} ) ;
51
51
it ( "Checks if session start, extension and ending works" , ( ) => {
52
52
hp . haltAndClearStorage ( ( ) => {
53
- // initialize countly
53
+ // initialize countly
54
54
initMain ( ) ;
55
55
// begin session
56
56
Countly . begin_session ( ) ;
@@ -97,9 +97,7 @@ describe("Browser session tests, auto", () => {
97
97
describe ( "Browser session tests, manual 1" , ( ) => {
98
98
it ( "Single sessions test with manual sessions" , ( ) => {
99
99
cy . visit ( "./cypress/fixtures/session_test_manual_1.html?use_session_cookie=true" ) ;
100
- cy . contains ( "Start" ) . click ( ) . wait ( waitTime ) ;
101
- cy . contains ( "Event" ) . click ( ) . wait ( 300 ) ;
102
- cy . contains ( "End" ) . click ( ) . wait ( 300 ) ;
100
+ cy . wait ( waitTime + 1000 ) ;
103
101
cy . visit ( "./cypress/fixtures/base.html" ) ;
104
102
cy . fetch_local_request_queue ( app_key ) . then ( ( rq ) => {
105
103
cy . log ( rq ) ;
@@ -109,10 +107,10 @@ describe("Browser session tests, manual 1", () => {
109
107
cy . check_session ( rq [ 0 ] , undefined , undefined , app_key ) ;
110
108
// third object of the queue should be about session extension, also input the expected duration
111
109
cy . check_session ( rq [ 2 ] , 5 , undefined , app_key ) ;
112
- // fourth object of the queue should be about event sent
113
- cy . check_event ( JSON . parse ( rq [ 3 ] . events ) [ 0 ] , eventObj , undefined , false ) ;
114
110
// fifth object of the queue should be about session extension, also input the expected duration
115
- cy . check_session ( rq [ 4 ] , 1 , undefined , app_key ) ;
111
+ cy . check_session ( rq [ 3 ] , 1 , undefined , app_key ) ;
112
+ // fourth object of the queue should be about event sent
113
+ cy . check_event ( JSON . parse ( rq [ 4 ] . events ) [ 0 ] , eventObj , undefined , false ) ;
116
114
} ) ;
117
115
} ) ;
118
116
} ) ;
@@ -160,12 +158,7 @@ describe("Browser session tests, auto, no cookie", () => {
160
158
describe ( "Browser session tests, manual 1, no cookie" , ( ) => {
161
159
it ( "Single bounce test with manual sessions with no cookies" , ( ) => {
162
160
cy . visit ( "./cypress/fixtures/session_test_manual_1.html" ) ;
163
- cy . contains ( "Start" ) . click ( ) ;
164
- cy . wait ( waitTime ) ;
165
- cy . contains ( "Event" ) . click ( ) ;
166
- cy . wait ( 300 ) ;
167
- cy . contains ( "End" ) . click ( ) ;
168
- cy . wait ( 300 ) ;
161
+ cy . wait ( waitTime + 1000 ) ;
169
162
cy . visit ( "./cypress/fixtures/base.html" ) ;
170
163
cy . fetch_local_request_queue ( app_key ) . then ( ( rq ) => {
171
164
cy . log ( rq ) ;
@@ -175,10 +168,10 @@ describe("Browser session tests, manual 1, no cookie", () => {
175
168
cy . check_session ( rq [ 0 ] , undefined , undefined , app_key ) ;
176
169
// third object of the queue should be about session extension, also input the expected duration
177
170
cy . check_session ( rq [ 2 ] , 5 , undefined , app_key ) ;
178
- // fourth object of the queue should be about event sent
179
- cy . check_event ( JSON . parse ( rq [ 3 ] . events ) [ 0 ] , eventObj , undefined , false ) ;
180
171
// fifth object of the queue should be about session extension, also input the expected duration
181
- cy . check_session ( rq [ 4 ] , 1 , true , app_key ) ;
172
+ cy . check_session ( rq [ 3 ] , 1 , true , app_key ) ;
173
+ // fourth object of the queue should be about event sent
174
+ cy . check_event ( JSON . parse ( rq [ 4 ] . events ) [ 0 ] , eventObj , undefined , false ) ;
182
175
} ) ;
183
176
} ) ;
184
177
} ) ;
@@ -205,7 +198,7 @@ describe("Browser session tests, manual 2, no cookie", () => {
205
198
describe ( "Check request related functions" , ( ) => {
206
199
it ( "Check if prepareRequest forms a proper request object" , ( ) => {
207
200
hp . haltAndClearStorage ( ( ) => {
208
- // initialize countly
201
+ // initialize countly
209
202
initMain ( ) ;
210
203
let reqObject = { } ;
211
204
Countly . _internals . prepareRequest ( reqObject ) ;
@@ -215,7 +208,7 @@ describe("Check request related functions", () => {
215
208
} ) ;
216
209
it ( "Check if prepareRequest forms a proper request object from a bad one " , ( ) => {
217
210
hp . haltAndClearStorage ( ( ) => {
218
- // initialize countly
211
+ // initialize countly
219
212
initMain ( ) ;
220
213
let reqObject = { app_key : null , device_id : null } ;
221
214
Countly . _internals . prepareRequest ( reqObject ) ;
@@ -225,7 +218,7 @@ describe("Check request related functions", () => {
225
218
} ) ;
226
219
it ( "Check if prepareRequest forms a proper request object and not erase an extra value " , ( ) => {
227
220
hp . haltAndClearStorage ( ( ) => {
228
- // initialize countly
221
+ // initialize countly
229
222
initMain ( ) ;
230
223
let reqObject = { extraKey : "value" } ;
231
224
Countly . _internals . prepareRequest ( reqObject ) ;
0 commit comments