@@ -25,6 +25,7 @@ import {
2525} from '../test-utils'
2626
2727const getReport = ( page : Page ) => page . getByTestId ( 'report-behaviours' )
28+ const LAST_30MIN_PILL = 'last 30min'
2829
2930test ( 'special goals' , async ( { page, request } , testInfo ) => {
3031 test . slow (
@@ -564,8 +565,8 @@ test('goals breakdown', async ({ page, request }) => {
564565 revenue_reporting_currency : 'EUR' ,
565566 timestamp : { minutesAgo : 59 }
566567 } ,
567- { user_id : 124 , name : 'add_site' , timestamp : { minutesAgo : 50 } } ,
568- { user_id : 125 , name : 'add_site' , timestamp : { minutesAgo : 50 } }
568+ { user_id : 124 , name : 'add_site' , timestamp : { minutesAgo : 15 } } ,
569+ { user_id : 125 , name : 'add_site' , timestamp : { minutesAgo : 2 } }
569570 ]
570571 } )
571572
@@ -709,6 +710,32 @@ test('goals breakdown', async ({ page, request }) => {
709710
710711 await closeModalButton ( page ) . click ( )
711712 } )
713+
714+ await test . step ( 'realtime goal index breakdown displays stats from last 30min' , async ( ) => {
715+ await page . goto ( '/' + domain + '?period=realtime' , { waitUntil : 'commit' } )
716+ await report . getByTestId ( 'report-end' ) . scrollIntoViewIfNeeded ( )
717+
718+ await expect ( goalsTabButton ) . toHaveAttribute ( 'data-active' , 'true' )
719+ await expect ( report . getByText ( LAST_30MIN_PILL ) ) . toBeVisible ( )
720+
721+ await expectHeaders ( report , [ 'Goal' , 'Uniques' , 'Total' , 'CR' ] )
722+
723+ await expectRows ( report , [ 'Add a site' ] )
724+ await expectMetricValues ( report , 'Add a site' , [ '2' , '2' , '100%' ] )
725+ } )
726+
727+ await test . step ( 'realtime goals modal displays stats from last 30min' , async ( ) => {
728+ await detailsLink ( report ) . click ( )
729+
730+ await expect (
731+ modal ( page ) . getByRole ( 'heading' , { name : 'Goal conversions' } )
732+ ) . toBeVisible ( )
733+
734+ await expectRows ( modal ( page ) , [ 'Add a site' ] )
735+ await expectMetricValues ( modal ( page ) , 'Add a site' , [ '2' , '2' , '100%' ] )
736+
737+ await closeModalButton ( page ) . click ( )
738+ } )
712739} )
713740
714741test ( 'props breakdown' , async ( { page, request } ) => {
@@ -722,6 +749,7 @@ test('props breakdown', async ({ page, request }) => {
722749 {
723750 name : 'pageview' ,
724751 pathname : '/page' ,
752+ timestamp : { minutesAgo : 15 } ,
725753 'meta.key' : [
726754 'logged_in' ,
727755 'browser_language' ,
@@ -752,12 +780,14 @@ test('props breakdown', async ({ page, request }) => {
752780 {
753781 name : 'pageview' ,
754782 pathname : '/page' ,
783+ timestamp : { minutesAgo : 1 } ,
755784 'meta.key' : [ 'logged_in' , 'browser_language' ] ,
756785 'meta.value' : [ 'false' , 'en_US' ]
757786 } ,
758787 {
759788 name : 'pageview' ,
760789 pathname : '/page' ,
790+ timestamp : { minutesAgo : 2 } ,
761791 'meta.key' : [ 'logged_in' , 'browser_language' ] ,
762792 'meta.value' : [ 'true' , 'es' ]
763793 }
@@ -768,7 +798,7 @@ test('props breakdown', async ({ page, request }) => {
768798
769799 await addAllCustomProps ( { page, domain } )
770800
771- await page . goto ( '/' + domain , { waitUntil : 'commit' } )
801+ await page . goto ( `/ ${ domain } ?period=all` , { waitUntil : 'commit' } )
772802
773803 const propsTabButton = tabButtonWithDropdown ( report , 'Properties' )
774804
@@ -854,6 +884,36 @@ test('props breakdown', async ({ page, request }) => {
854884 await expectMetricValues ( report , 'en_US' , [ '2' , '2' , '66.7%' ] )
855885 await expectMetricValues ( report , 'es' , [ '1' , '1' , '33.3%' ] )
856886 } )
887+
888+ await page . goto ( '/' + domain + '?period=realtime' , { waitUntil : 'commit' } )
889+ await report . getByTestId ( 'report-end' ) . scrollIntoViewIfNeeded ( )
890+
891+ await test . step ( 'realtime props index breakdown displays stats from last 5min' , async ( ) => {
892+ await propsTabButton . click ( )
893+ await dropdown ( report )
894+ . getByRole ( 'button' , { name : 'browser_language' } )
895+ . click ( )
896+
897+ await expect ( report . getByText ( LAST_30MIN_PILL ) ) . toBeHidden ( )
898+
899+ await expectHeaders ( report , [ 'browser_language' , 'Visitors' , 'Events' , '%' ] )
900+
901+ await expectRows ( report , [ 'en_US' , 'es' ] )
902+ await expectMetricValues ( report , 'en_US' , [ '1' , '1' , '50%' ] )
903+ } )
904+
905+ await test . step ( 'realtime props details modal displays stats from last 5min' , async ( ) => {
906+ await detailsLink ( report ) . click ( )
907+
908+ await expect (
909+ modal ( page ) . getByRole ( 'heading' , { name : 'Custom property breakdown' } )
910+ ) . toBeVisible ( )
911+
912+ await expectRows ( modal ( page ) , [ 'en_US' , 'es' ] )
913+ await expectMetricValues ( modal ( page ) , 'en_US' , [ '1' , '1' , '50%' ] )
914+
915+ await closeModalButton ( page ) . click ( )
916+ } )
857917} )
858918
859919test ( 'funnels' , async ( { page, request } ) => {
0 commit comments