1
- import { test , TestContext } from '.. /test-base' ;
2
- import { queries } from '.. /queries' ;
3
- import { makePrefix } from '.. /utils' ;
4
- import { throttlePage } from '.. /throttle' ;
1
+ import { test , TestContext } from './test-base' ;
2
+ import { queries } from './queries' ;
3
+ import { makePrefix } from './utils' ;
4
+ import { throttlePage } from './throttle' ;
5
5
6
6
type Query = ( typeof queries ) [ number ] ;
7
7
8
+
9
+
8
10
test . describe ( 'ui.adsabs.harvard.edu' , ( ) => {
9
11
test . use ( {
10
12
baseURL : 'https://devui.adsabs.harvard.edu' ,
11
13
} ) ;
12
14
13
15
const perfTest = async (
14
16
prefix : string ,
15
- { page, performance } : Pick < TestContext , 'page' | 'performance' > ,
16
- { query } : Query ,
17
+ { page, performance} : Pick < TestContext , 'page' | 'performance' > ,
18
+ { query, name } : Query ,
17
19
) => {
18
20
performance . sampleStart ( `${ prefix } .pre-load` ) ;
19
- await page . goto ( '/' , { waitUntil : 'commit' } ) ;
21
+ await page . goto ( '/' , { waitUntil : 'commit' } ) ;
20
22
await page . fill ( 'input[name="q"]' , query ) ;
21
23
performance . sampleStart ( `${ prefix } .post-load` ) ;
22
24
await page . getByLabel ( 'submit' ) . click ( ) ;
@@ -25,26 +27,26 @@ test.describe('ui.adsabs.harvard.edu', () => {
25
27
performance . sampleEnd ( `${ prefix } .post-load` ) ;
26
28
} ;
27
29
28
- for ( const { description, name, query } of queries ) {
30
+ for ( const { description, name, query} of queries ) {
29
31
const prefix = makePrefix ( 'bbb' , name , 'normal' ) ;
30
- test ( prefix , async ( { page, performance } ) => {
31
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
32
+ test ( prefix , async ( { page, performance} ) => {
33
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
32
34
} ) ;
33
35
}
34
36
35
- for ( const { description, name, query } of queries ) {
37
+ for ( const { description, name, query} of queries ) {
36
38
const prefix = makePrefix ( 'bbb' , name , '3g-4x' ) ;
37
- test ( prefix , async ( { page, performance, context } ) => {
39
+ test ( prefix , async ( { page, performance, context} ) => {
38
40
await throttlePage ( context , page , '3g-4x' ) ;
39
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
41
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
40
42
} ) ;
41
43
}
42
44
43
- for ( const { description, name, query } of queries ) {
45
+ for ( const { description, name, query} of queries ) {
44
46
const prefix = makePrefix ( 'bbb' , name , 'eth-2x' ) ;
45
- test ( prefix , async ( { page, performance, context } ) => {
47
+ test ( prefix , async ( { page, performance, context} ) => {
46
48
await throttlePage ( context , page , 'eth-2x' ) ;
47
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
49
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
48
50
} ) ;
49
51
}
50
52
} ) ;
@@ -56,11 +58,11 @@ test.describe('scixplorer.org', () => {
56
58
57
59
const perfTest = async (
58
60
prefix : string ,
59
- { page, performance } : Pick < TestContext , 'page' | 'performance' > ,
60
- { query } : Query ,
61
+ { page, performance} : Pick < TestContext , 'page' | 'performance' > ,
62
+ { query, name } : Query ,
61
63
) => {
62
64
performance . sampleStart ( `${ prefix } .pre-load` ) ;
63
- await page . goto ( '/' , { waitUntil : 'commit' } ) ;
65
+ await page . goto ( '/' , { waitUntil : 'commit' } ) ;
64
66
await page . getByTestId ( 'search-input' ) . fill ( query ) ;
65
67
performance . sampleStart ( `${ prefix } .post-load` ) ;
66
68
await page . getByTestId ( 'search-submit' ) . click ( ) ;
@@ -69,26 +71,26 @@ test.describe('scixplorer.org', () => {
69
71
performance . sampleEnd ( `${ prefix } .post-load` ) ;
70
72
} ;
71
73
72
- for ( const { description, name, query } of queries ) {
74
+ for ( const { description, name, query} of queries ) {
73
75
const prefix = makePrefix ( 'scix' , name , 'normal' ) ;
74
- test ( prefix , async ( { page, performance } ) => {
75
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
76
+ test ( prefix , async ( { page, performance} ) => {
77
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
76
78
} ) ;
77
79
}
78
80
79
- for ( const { description, name, query } of queries ) {
81
+ for ( const { description, name, query} of queries ) {
80
82
const prefix = makePrefix ( 'scix' , name , '3g-4x' ) ;
81
- test ( prefix , async ( { page, performance, context } ) => {
83
+ test ( prefix , async ( { page, performance, context} ) => {
82
84
await throttlePage ( context , page , '3g-4x' ) ;
83
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
85
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
84
86
} ) ;
85
87
}
86
88
87
- for ( const { description, name, query } of queries ) {
89
+ for ( const { description, name, query} of queries ) {
88
90
const prefix = makePrefix ( 'scix' , name , 'eth-2x' ) ;
89
- test ( prefix , async ( { page, performance, context } ) => {
91
+ test ( prefix , async ( { page, performance, context} ) => {
90
92
await throttlePage ( context , page , 'eth-2x' ) ;
91
- await perfTest ( prefix , { page, performance } , { query, name, description } ) ;
93
+ await perfTest ( prefix , { page, performance} , { query, name, description} ) ;
92
94
} ) ;
93
95
}
94
96
} ) ;
0 commit comments