-
Notifications
You must be signed in to change notification settings - Fork 111
/
stepsTestConstants.ts
104 lines (99 loc) · 2.65 KB
/
stepsTestConstants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* istanbul ignore file */
import {
IStepsThresholds,
IPerfumeOptions,
IPerfumeConfig,
IThresholdTier,
IStepsConfig,
} from '../src/types';
export const STEP_THRESHOLDS: IStepsThresholds = {
[IThresholdTier.instant]: {
vitalsThresholds: [100, 200],
maxOutlierThreshold: 10000,
},
[IThresholdTier.quick]: {
vitalsThresholds: [200, 500],
maxOutlierThreshold: 10000,
},
[IThresholdTier.moderate]: {
vitalsThresholds: [500, 1000],
maxOutlierThreshold: 10000,
},
[IThresholdTier.slow]: {
vitalsThresholds: [1000, 2000],
maxOutlierThreshold: 10000,
},
[IThresholdTier.unavoidable]: {
vitalsThresholds: [2000, 5000],
maxOutlierThreshold: 20000,
},
};
const steps: IStepsConfig = {
load_first_screen_first_journey: {
threshold: IThresholdTier.unavoidable,
marks: ['launch', 'loaded_first_screen_first_journey'],
},
load_second_screen_first_journey: {
threshold: IThresholdTier.instant,
marks: [
'start_navigate_to_second_screen_first_journey',
'loaded_second_screen_first_journey',
],
},
test_load_reusing_marks: {
// step with the same start and end mark as another
threshold: IThresholdTier.instant,
marks: [
'start_navigate_to_fourth_screen_second_journey',
'loaded_third_screen_second_journey',
],
},
load_third_screen_first_journey: {
threshold: IThresholdTier.quick,
marks: [
'start_navigate_to_third_screen_first_journey',
'loaded_third_screen_first_journey',
],
},
load_fourth_screen_first_journey: {
threshold: IThresholdTier.quick,
marks: [
'start_navigate_to_fourth_screen_first_journey',
'loaded_fourth_screen_first_journey',
],
},
load_first_screen_second_journey: {
threshold: IThresholdTier.unavoidable,
marks: ['launch', 'loaded_first_screen_second_journey'],
},
load_second_screen_second_journey: {
threshold: IThresholdTier.instant,
marks: [
'start_navigate_to_second_screen_second_journey',
'loaded_second_screen_second_journey',
],
},
load_third_screen_second_journey: {
threshold: IThresholdTier.quick,
marks: [
'start_navigate_to_third_screen_second_journey',
'loaded_third_screen_second_journey',
],
},
load_fourth_screen_second_journey: {
threshold: IThresholdTier.quick,
marks: [
'start_navigate_to_fourth_screen_second_journey',
'loaded_fourth_screen_second_journey',
],
},
};
export const testConfig: IPerfumeOptions = {
steps,
onMarkStep: jest.fn(),
};
export const navigationTestConfig: IPerfumeOptions = {
steps,
onMarkStep: jest.fn(),
};
export type TestConfig = IPerfumeConfig;