Skip to content

Commit

Permalink
feat(project): test cases for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed May 11, 2023
1 parent 70c96a5 commit 41f900d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
13 changes: 13 additions & 0 deletions test-cases/analytics/adv.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Analytics - Advertisement

# `egpovogv` config can be used

Scenario: Watching the video from the beginning with 1 pre-roll ad (the config should have an ad-schedule)
Given Start watching the video "Elephants Dream"
When Watch the video with advertising from "00:00 to 00:25"
Then Expect `i` event to be sent

Scenario: Watching the video from the Continue Watching shelf with 1 pre-roll ad (the config should have an ad-schedule)
Given Start watching the video "Elephants Dream" from the 3:00 minute (from Continue Watching shelf)
When Watch the video with advertising from "03:00 to 03:25"
Then Expect `i` event to be sent
36 changes: 36 additions & 0 deletions test-cases/analytics/init.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Feature: Analytics - Initialization

# `225tvq1i` config can be used
# List of expected params for `e` event: `pss`, `oos`, `oosv`, `sdk`, `aid`, `bun`, `fed`, `id`, `t`, `emi`, `pli`
# List of expected params for `s` event: `pss`, `oos`, `oosv`, `sdk`, `aid`, `bun`, `fed`, `id`, `t`, `emi`, `pli`, `ti`, `pw`, `q`
# Params which have constant values and need to be redifined manually: `pss`, `oos`, `oosv`, `sdk`

Scenario: Watching the video from the beginning (`e` event)
Given Start watching the video "Elephants Dream" (`e` event)
When Watch the video from "00:00 to 00:05"
Then Expect `e` event to be the first event sent
Then Expect `e` event to be sent with params from the list in the comment above
Then Expect sent params to have correct values

Scenario: Watching the video from the beginning (`s` event)
Given Start watching the video "Elephants Dream" (`s` event)
When Watch the video from "00:00 to 00:05"
Then Expect `s` event to be the second event sent (if no ad-schedule is used)
Then Expect `s` event to be sent with params from the list in the comment above
Then Expect `q` param to reflect the number of quantiles, `ti` to equal 0 and `pw` to equal 0 as well.
Then Expect other params from the list to have correct values

Scenario: Watching the video from the Continue Watching section (`e` event)
Given Start watching the video "Elephants Dream" from Continue Watching (`e` event)
When Watch the video from "03:00 to 03:05"
Then Expect `e` event to be the first event sent
Then Expect `e` event to be sent with params from the list in the comment above
Then Expect sent params to have correct values

Scenario: Watching the the video from the Continue Watching section (`s` event)
Given Start watching the video "Elephants Dream" Continue Watching (`s` event)
When Watch the video from "03:00 to 03:05"
Then Expect `s` event to be the second event sent (if no ad-schedule is used)
Then Expect `s` event to be sent with params from the list in the comment above
Then Expect `q` param to reflect the number of quantiles, `ti` to equal 0 and `pw` to equal 0 as well.
Then Expect other sent params to have correct values
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Analytics
Feature: Analytics - Quantiles

# It is possible to see differences in `ti` param value equalling to 1-2 seconds.
# `225tvq1i` config can be used
Expand Down Expand Up @@ -58,12 +58,6 @@ Feature: Analytics
When Click on "Back" button
Then Expect `gab` event to be sent
Scenario: Watching the video from the beginning with 1 pre-roll ad
Given Start watching the video "Elephants Dream" using the config with an ad-schedule set up (`egpovogv`)
When Watch the video with advertising from "00:00 to 00:25"
Then Expect `i` event to be sent
Then Expect `t` event to be sent with a value of 20 as `ti` param
Scenario: Watching the video from the Continue Watching shelf till the end
Given Start watching the video "Elephants Dream" from the 10:00 minute (from Continue Watching shelf)
When Watch the video from "10:00 to 10:53"
Expand Down

0 comments on commit 41f900d

Please sign in to comment.