@@ -18,6 +18,7 @@ const {
1818 goToPage,
1919 getAllDataFields,
2020 fillInput,
21+ waitForTimeout,
2122} = require ( '../defaults' ) ;
2223
2324const { expect } = chai ;
@@ -84,7 +85,7 @@ module.exports = () => {
8485
8586 it ( 'Should display the correct items counter at the bottom of the page' , async ( ) => {
8687 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
87- await page . waitForTimeout ( 100 ) ;
88+ await waitForTimeout ( 100 ) ;
8889
8990 expect ( await page . $eval ( '#firstRowIndex' , ( element ) => parseInt ( element . innerText , 10 ) ) ) . to . equal ( 1 ) ;
9091 expect ( await page . $eval ( '#lastRowIndex' , ( element ) => parseInt ( element . innerText , 10 ) ) ) . to . equal ( 2 ) ;
@@ -93,23 +94,23 @@ module.exports = () => {
9394
9495 it ( 'can set how many data passes is available per page' , async ( ) => {
9596 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
96- await page . waitForTimeout ( 500 ) ;
97+ await waitForTimeout ( 500 ) ;
9798 // Expect the amount selector to currently be set to 10 (because of the defined page height)
9899 const amountSelectorButton = await page . $ ( '.dropup button' ) ;
99100 const amountSelectorButtonText = await amountSelectorButton . evaluate ( ( element ) => element . innerText ) ;
100- await page . waitForTimeout ( 300 ) ;
101+ await waitForTimeout ( 300 ) ;
101102 expect ( amountSelectorButtonText . trim ( ) . endsWith ( '9' ) ) . to . be . true ;
102103
103104 // Expect the dropdown options to be visible when it is selected
104105 await amountSelectorButton . evaluate ( ( button ) => button . click ( ) ) ;
105- await page . waitForTimeout ( 100 ) ;
106+ await waitForTimeout ( 100 ) ;
106107 const amountSelectorDropdown = await page . $ ( '.dropup' ) ;
107108 expect ( Boolean ( amountSelectorDropdown ) ) . to . be . true ;
108109
109110 // Expect the amount of visible lhcfills to reduce when the first option (5) is selected
110111 const menuItem = await page . $ ( '.dropup .menu-item' ) ;
111112 await menuItem . evaluate ( ( button ) => button . click ( ) ) ;
112- await page . waitForTimeout ( 100 ) ;
113+ await waitForTimeout ( 100 ) ;
113114
114115 const tableRows = await page . $$ ( 'table tr' ) ;
115116 expect ( tableRows . length - 1 ) . to . equal ( 2 ) ;
@@ -121,22 +122,22 @@ module.exports = () => {
121122 el . value = '1111' ;
122123 el . dispatchEvent ( new Event ( 'input' ) ) ;
123124 } ) ;
124- await page . waitForTimeout ( 100 ) ;
125+ await waitForTimeout ( 100 ) ;
125126 expect ( Boolean ( await page . $ ( '.dropup input:invalid' ) ) ) . to . be . true ;
126127 } ) ;
127128
128129 it ( 'can sort by name column in ascending and descending manners' , async ( ) => {
129130 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
130131 // Expect a sorting preview to appear when hovering over a column header
131132 await page . hover ( 'th#name' ) ;
132- await page . waitForTimeout ( 100 ) ;
133+ await waitForTimeout ( 100 ) ;
133134 const sortingPreviewIndicator = await page . $ ( '#name-sort-preview' ) ;
134135 expect ( Boolean ( sortingPreviewIndicator ) ) . to . be . true ;
135136
136137 // Sort by name in an ascending manner
137138 const nameHeader = await page . $ ( 'th#name' ) ;
138139 await nameHeader . evaluate ( ( button ) => button . click ( ) ) ;
139- await page . waitForTimeout ( 300 ) ;
140+ await waitForTimeout ( 300 ) ;
140141
141142 // Expect the names to be in alphabetical order
142143 const firstNames = await getAllDataFields ( page , 'name' ) ;
@@ -147,14 +148,14 @@ module.exports = () => {
147148 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
148149 // Expect a sorting preview to appear when hovering over a column header
149150 await page . hover ( 'th#reconstructedEventsCount' ) ;
150- await page . waitForTimeout ( 100 ) ;
151+ await waitForTimeout ( 100 ) ;
151152 const sortingPreviewIndicator = await page . $ ( '#reconstructedEventsCount-sort-preview' ) ;
152153 expect ( Boolean ( sortingPreviewIndicator ) ) . to . be . true ;
153154
154155 // Sort by year in an ascending manner
155156 const reconstructedEventsCountHeader = await page . $ ( 'th#reconstructedEventsCount' ) ;
156157 await reconstructedEventsCountHeader . evaluate ( ( button ) => button . click ( ) ) ;
157- await page . waitForTimeout ( 300 ) ;
158+ await waitForTimeout ( 300 ) ;
158159
159160 // Expect the year to be in order
160161 const firstReconstructedEventsCounts = await getAllDataFields ( page , 'reconstructedEventsCount' ) ;
@@ -165,14 +166,14 @@ module.exports = () => {
165166 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
166167 // Expect a sorting preview to appear when hovering over a column header
167168 await page . hover ( 'th#outputSize' ) ;
168- await page . waitForTimeout ( 100 ) ;
169+ await waitForTimeout ( 100 ) ;
169170 const sortingPreviewIndicator = await page . $ ( '#outputSize-sort-preview' ) ;
170171 expect ( Boolean ( sortingPreviewIndicator ) ) . to . be . true ;
171172
172173 // Sort by avgCenterOfMassEnergy in an ascending manner
173174 const outputSizeHeader = await page . $ ( 'th#outputSize' ) ;
174175 await outputSizeHeader . evaluate ( ( button ) => button . click ( ) ) ;
175- await page . waitForTimeout ( 300 ) ;
176+ await waitForTimeout ( 300 ) ;
176177
177178 // Expect the avgCenterOfMassEnergy to be in order
178179 const firstOutputSize = await getAllDataFields ( page , 'outputSize' ) ;
@@ -181,22 +182,22 @@ module.exports = () => {
181182
182183 it ( 'should successfuly apply data pass name filter' , async ( ) => {
183184 await goToPage ( page , 'data-passes-per-lhc-period-overview' , { queryParameters : { lhcPeriodId : 2 } } ) ;
184- await page . waitForTimeout ( 100 ) ;
185+ await waitForTimeout ( 100 ) ;
185186 const filterToggleButton = await page . $ ( '#openFilterToggle' ) ;
186187 expect ( filterToggleButton ) . to . not . be . null ;
187188
188189 await filterToggleButton . evaluate ( ( button ) => button . click ( ) ) ;
189190 await fillInput ( page , 'div.flex-row.items-baseline:nth-of-type(2) input[type=text]' , 'LHC22b_apass1' ) ;
190191
191- await page . waitForTimeout ( 100 ) ;
192+ await waitForTimeout ( 100 ) ;
192193
193194 let allDataPassesNames = await getAllDataFields ( page , 'name' ) ;
194195 expect ( allDataPassesNames ) . to . has . all . deep . members ( [ 'LHC22b_apass1' ] ) ;
195196
196197 const resetFiltersButton = await page . $ ( '#reset-filters' ) ;
197198 expect ( resetFiltersButton ) . to . not . be . null ;
198199 await resetFiltersButton . evaluate ( ( button ) => button . click ( ) ) ;
199- await page . waitForTimeout ( 100 ) ;
200+ await waitForTimeout ( 100 ) ;
200201
201202 allDataPassesNames = await getAllDataFields ( page , 'name' ) ;
202203 expect ( allDataPassesNames ) . to . has . all . deep . members ( [ 'LHC22b_apass1' , 'LHC22b_apass2' ] ) ;
0 commit comments