@@ -4,104 +4,102 @@ import { sentryTest } from '../../../utils/fixtures';
4
4
import { expectedClickBreadcrumb } from '../../../utils/replayEventTemplates' ;
5
5
import { getReplayRecordingContent , shouldSkipReplayTest , waitForReplayRequest } from '../../../utils/replayHelpers' ;
6
6
7
- for ( let i = 0 ; i < 100 ; i ++ ) {
8
- sentryTest (
9
- `replay should have correct click breadcrumbs${ i } ` ,
10
- async ( { forceFlushReplay, getLocalTestPath, page, browserName } ) => {
11
- // TODO(replay): This is flakey on firefox and webkit where we do not always get the latest mutation.
12
- if ( shouldSkipReplayTest ( ) || [ 'firefox' , 'webkit' ] . includes ( browserName ) ) {
13
- sentryTest . skip ( ) ;
14
- }
7
+ sentryTest (
8
+ 'replay should have correct click breadcrumbs' ,
9
+ async ( { forceFlushReplay, getLocalTestPath, page, browserName } ) => {
10
+ // TODO(replay): This is flakey on firefox and webkit where we do not always get the latest mutation.
11
+ if ( shouldSkipReplayTest ( ) || [ 'firefox' , 'webkit' ] . includes ( browserName ) ) {
12
+ sentryTest . skip ( ) ;
13
+ }
15
14
16
- const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
17
- const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
15
+ const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
16
+ const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
18
17
19
- await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
20
- return route . fulfill ( {
21
- status : 200 ,
22
- contentType : 'application/json' ,
23
- body : JSON . stringify ( { id : 'test-id' } ) ,
24
- } ) ;
18
+ await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
19
+ return route . fulfill ( {
20
+ status : 200 ,
21
+ contentType : 'application/json' ,
22
+ body : JSON . stringify ( { id : 'test-id' } ) ,
25
23
} ) ;
24
+ } ) ;
26
25
27
- const url = await getLocalTestPath ( { testDir : __dirname } ) ;
26
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
28
27
29
- await page . goto ( url ) ;
30
- await reqPromise0 ;
28
+ await page . goto ( url ) ;
29
+ await reqPromise0 ;
31
30
32
- await page . click ( '#error' ) ;
33
- await page . click ( '#img' ) ;
34
- await page . click ( '.sentry-unmask' ) ;
35
- await forceFlushReplay ( ) ;
36
- const req1 = await reqPromise1 ;
37
- const content1 = getReplayRecordingContent ( req1 ) ;
38
- expect ( content1 . breadcrumbs ) . toEqual (
39
- expect . arrayContaining ( [
40
- {
41
- ...expectedClickBreadcrumb ,
42
- message : 'body > div#error.btn.btn-error[aria-label="An Error"]' ,
43
- data : {
44
- nodeId : expect . any ( Number ) ,
45
- node : {
46
- attributes : {
47
- 'aria-label' : '** *****' ,
48
- class : 'btn btn-error' ,
49
- id : 'error' ,
50
- role : 'button' ,
51
- } ,
52
- id : expect . any ( Number ) ,
53
- tagName : 'div' ,
54
- textContent : '** *****' ,
31
+ await page . click ( '#error' ) ;
32
+ await page . click ( '#img' ) ;
33
+ await page . click ( '.sentry-unmask' ) ;
34
+ await forceFlushReplay ( ) ;
35
+ const req1 = await reqPromise1 ;
36
+ const content1 = getReplayRecordingContent ( req1 ) ;
37
+ expect ( content1 . breadcrumbs ) . toEqual (
38
+ expect . arrayContaining ( [
39
+ {
40
+ ...expectedClickBreadcrumb ,
41
+ message : 'body > div#error.btn.btn-error[aria-label="An Error"]' ,
42
+ data : {
43
+ nodeId : expect . any ( Number ) ,
44
+ node : {
45
+ attributes : {
46
+ 'aria-label' : '** *****' ,
47
+ class : 'btn btn-error' ,
48
+ id : 'error' ,
49
+ role : 'button' ,
55
50
} ,
51
+ id : expect . any ( Number ) ,
52
+ tagName : 'div' ,
53
+ textContent : '** *****' ,
56
54
} ,
57
55
} ,
58
- ] ) ,
59
- ) ;
56
+ } ,
57
+ ] ) ,
58
+ ) ;
60
59
61
- expect ( content1 . breadcrumbs ) . toEqual (
62
- expect . arrayContaining ( [
63
- {
64
- ...expectedClickBreadcrumb ,
65
- message : 'body > button > img#img[alt="Alt Text"]' ,
66
- data : {
67
- nodeId : expect . any ( Number ) ,
68
- node : {
69
- attributes : {
70
- alt : 'Alt Text' ,
71
- id : 'img' ,
72
- } ,
73
- id : expect . any ( Number ) ,
74
- tagName : 'img' ,
75
- textContent : '' ,
60
+ expect ( content1 . breadcrumbs ) . toEqual (
61
+ expect . arrayContaining ( [
62
+ {
63
+ ...expectedClickBreadcrumb ,
64
+ message : 'body > button > img#img[alt="Alt Text"]' ,
65
+ data : {
66
+ nodeId : expect . any ( Number ) ,
67
+ node : {
68
+ attributes : {
69
+ alt : 'Alt Text' ,
70
+ id : 'img' ,
76
71
} ,
72
+ id : expect . any ( Number ) ,
73
+ tagName : 'img' ,
74
+ textContent : '' ,
77
75
} ,
78
76
} ,
79
- ] ) ,
80
- ) ;
77
+ } ,
78
+ ] ) ,
79
+ ) ;
81
80
82
- expect ( content1 . breadcrumbs ) . toEqual (
83
- expect . arrayContaining ( [
84
- {
85
- ...expectedClickBreadcrumb ,
86
- message : 'body > button.sentry-unmask[aria-label="Unmasked label"]' ,
87
- data : {
88
- nodeId : expect . any ( Number ) ,
89
- node : {
90
- attributes : {
91
- // TODO(rrweb): This is a bug in our rrweb fork!
92
- // This attribute should be unmasked.
93
- // 'aria-label': 'Unmasked label',
94
- 'aria-label' : '******** *****' ,
95
- class : 'sentry-unmask' ,
96
- } ,
97
- id : expect . any ( Number ) ,
98
- tagName : 'button' ,
99
- textContent : 'Unmasked' ,
81
+ expect ( content1 . breadcrumbs ) . toEqual (
82
+ expect . arrayContaining ( [
83
+ {
84
+ ...expectedClickBreadcrumb ,
85
+ message : 'body > button.sentry-unmask[aria-label="Unmasked label"]' ,
86
+ data : {
87
+ nodeId : expect . any ( Number ) ,
88
+ node : {
89
+ attributes : {
90
+ // TODO(rrweb): This is a bug in our rrweb fork!
91
+ // This attribute should be unmasked.
92
+ // 'aria-label': 'Unmasked label',
93
+ 'aria-label' : '******** *****' ,
94
+ class : 'sentry-unmask' ,
100
95
} ,
96
+ id : expect . any ( Number ) ,
97
+ tagName : 'button' ,
98
+ textContent : 'Unmasked' ,
101
99
} ,
102
100
} ,
103
- ] ) ,
104
- ) ;
105
- } ,
106
- ) ;
107
- }
101
+ } ,
102
+ ] ) ,
103
+ ) ;
104
+ } ,
105
+ ) ;
0 commit comments