@@ -294,6 +294,33 @@ module.exports = () => {
294294 await page . waitForSelector ( filterPanelSelector , { visible : true } ) ;
295295 } ) ;
296296
297+ it ( 'should successfully filter environments by their related run numbers' , async ( ) => {
298+ /**
299+ * This is the sequence to test filtering the environments based on their related run numbers.
300+ *
301+ * @param {string } selector the filter input selector
302+ * @param {string } inputValue the value to type in the filter input
303+ * @param {string[] } expectedIds the list of expected environment IDs after filtering
304+ * @return {void }
305+ */
306+ const filterOnRunNumbers = async ( selector , inputValue , expectedIds ) => {
307+ await fillInput ( page , selector , inputValue , [ 'change' ] ) ;
308+ await waitForTableLength ( page , expectedIds . length ) ;
309+ expect ( await page . $$eval ( 'tbody tr' , ( rows ) => rows . map ( ( row ) => row . id ) ) ) . to . eql ( expectedIds . map ( id => `row${ id } ` ) ) ;
310+ }
311+
312+ await expectAttributeValue ( page , '.runs-filter input' , 'placeholder' , 'e.g. 553203, 553221, ...' ) ;
313+
314+ await filterOnRunNumbers ( '.runs-filter input' , '10' , [ 'TDI59So3d' , 'Dxi029djX' ] ) ;
315+ await resetFilters ( page ) ;
316+
317+ await filterOnRunNumbers ( '.runs-filter input' , '103' , [ 'TDI59So3d' ] ) ;
318+ await resetFilters ( page ) ;
319+
320+ await filterOnRunNumbers ( '.runs-filter input' , '86, 91' , [ 'KGIS12DS' , 'VODdsO12d' ] ) ;
321+ await resetFilters ( page ) ;
322+ } ) ;
323+
297324 it ( 'should successfully filter environments by their status history' , async ( ) => {
298325 /**
299326 * This is the sequence to test filtering the environments on their status history.
0 commit comments