@@ -47,6 +47,13 @@ describe('obfuscate rules', () => {
4747 } )
4848
4949 it ( 'should apply to all payloads' , async ( ) => {
50+ await browser . url ( await browser . testHandle . assetURL ( 'obfuscate-pii.html' , config ) )
51+ . then ( ( ) => browser . waitForAgentLoad ( ) )
52+ await browser . execute ( function ( ) {
53+ // test log custom attributes added after PVE
54+ newrelic . setCustomAttribute ( 'foo' , 'foo pii' )
55+ console . log ( 'Test' )
56+ } )
5057 const [ rumHarvests , timingEventsHarvests , ajaxEventsHarvests , errorsHarvests , insightsHarvests , tracesHarvests , interactionEventsHarvests , logsHarvests ] = await Promise . all ( [
5158 rumCapture . waitForResult ( { timeout : 10000 } ) ,
5259 timingEventsCapture . waitForResult ( { timeout : 10000 } ) ,
@@ -55,9 +62,7 @@ describe('obfuscate rules', () => {
5562 insightsCapture . waitForResult ( { timeout : 10000 } ) ,
5663 tracesCapture . waitForResult ( { timeout : 10000 } ) ,
5764 interactionEventsCapture . waitForResult ( { timeout : 10000 } ) ,
58- logsCapture . waitForResult ( { timeout : 10000 } ) ,
59- browser . url ( await browser . testHandle . assetURL ( 'obfuscate-pii.html' , config ) )
60- . then ( ( ) => browser . waitForAgentLoad ( ) )
65+ logsCapture . waitForResult ( { timeout : 10000 } )
6166 ] )
6267
6368 expect ( rumHarvests . length ) . toBeGreaterThan ( 0 )
@@ -89,7 +94,7 @@ describe('obfuscate rules', () => {
8994 checkPayload ( harvest . request . body )
9095 checkPayload ( harvest . request . query )
9196 } )
92- expect ( logsHarvests . length ) . toBeGreaterThan ( 0 )
97+ expect ( logsHarvests . length ) . toBe ( 2 )
9398 logsHarvests . forEach ( harvest => {
9499 checkPayload ( harvest . request . body )
95100 checkPayload ( harvest . request . query )
0 commit comments