@@ -18,62 +18,62 @@ test.describe("search bar tests", () => {
1818 await browser . closeBrowser ( ) ;
1919 } ) ;
2020
21- // searchData.slice(0, 2).forEach(({ searchInput }) => {
22- // test(`Verify search bar auto-complete behavior for input: ${searchInput} via UI`, async () => {
23- // const codeGraph = await browser.createNewPage(CodeGraph, urls.baseUrl);
24- // await codeGraph.selectGraph(GRAPHRAG_SDK);
25- // await codeGraph.fillSearchBar(searchInput);
26- // await delay(1000);
27- // const textList = await codeGraph.getSearchBarElementsText();
28- // textList.forEach((text) => {
29- // expect(text.toLowerCase()).toContain(searchInput);
30- // });
31- // });
32- // });
21+ searchData . slice ( 0 , 2 ) . forEach ( ( { searchInput } ) => {
22+ test ( `Verify search bar auto-complete behavior for input: ${ searchInput } via UI` , async ( ) => {
23+ const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
24+ await codeGraph . selectGraph ( GRAPHRAG_SDK ) ;
25+ await codeGraph . fillSearchBar ( searchInput ) ;
26+ await delay ( 1000 ) ;
27+ const textList = await codeGraph . getSearchBarElementsText ( ) ;
28+ textList . forEach ( ( text ) => {
29+ expect ( text . toLowerCase ( ) ) . toContain ( searchInput ) ;
30+ } ) ;
31+ } ) ;
32+ } ) ;
3333
34- // searchData.slice(2, 4).forEach(({ searchInput, completedSearchInput }) => {
35- // test(`Validate search bar updates with selected element: ${searchInput}`, async () => {
36- // const codeGraph = await browser.createNewPage(CodeGraph, urls.baseUrl);
37- // await codeGraph.selectGraph(GRAPHRAG_SDK);
38- // await codeGraph.fillSearchBar(searchInput);
39- // await codeGraph.selectSearchBarOptionBtn("1");
40- // expect(await codeGraph.getSearchBarInputValue()).toBe(
41- // completedSearchInput
42- // );
43- // });
44- // });
34+ searchData . slice ( 2 , 4 ) . forEach ( ( { searchInput, completedSearchInput } ) => {
35+ test ( `Validate search bar updates with selected element: ${ searchInput } ` , async ( ) => {
36+ const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
37+ await codeGraph . selectGraph ( GRAPHRAG_SDK ) ;
38+ await codeGraph . fillSearchBar ( searchInput ) ;
39+ await codeGraph . selectSearchBarOptionBtn ( "1" ) ;
40+ expect ( await codeGraph . getSearchBarInputValue ( ) ) . toBe (
41+ completedSearchInput
42+ ) ;
43+ } ) ;
44+ } ) ;
4545
46- // searchData.slice(0, 2).forEach(({ searchInput }) => {
47- // test(`Verify auto-scroll scroll in search bar list for: ${searchInput}`, async () => {
48- // const codeGraph = await browser.createNewPage(CodeGraph, urls.baseUrl);
49- // await codeGraph.selectGraph(GRAPHRAG_SDK);
50- // await codeGraph.fillSearchBar(searchInput);
51- // await codeGraph.scrollToBottomInSearchBarList();
52- // expect(await codeGraph.isScrolledToBottomInSearchBarList()).toBe(true);
53- // });
54- // });
46+ searchData . slice ( 0 , 2 ) . forEach ( ( { searchInput } ) => {
47+ test ( `Verify auto-scroll scroll in search bar list for: ${ searchInput } ` , async ( ) => {
48+ const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
49+ await codeGraph . selectGraph ( GRAPHRAG_SDK ) ;
50+ await codeGraph . fillSearchBar ( searchInput ) ;
51+ await codeGraph . scrollToBottomInSearchBarList ( ) ;
52+ expect ( await codeGraph . isScrolledToBottomInSearchBarList ( ) ) . toBe ( true ) ;
53+ } ) ;
54+ } ) ;
5555
56- // specialCharacters.forEach(({ character, expectedRes }) => {
57- // test(`Verify entering special characters behavior in search bar for: ${character}`, async () => {
58- // const codeGraph = await browser.createNewPage(CodeGraph, urls.baseUrl);
59- // await codeGraph.selectGraph(GRAPHRAG_SDK);
60- // await codeGraph.fillSearchBar(character);
61- // await delay(1000);
62- // expect((await codeGraph.getSearchBarInputValue()).includes(character)).toBe(expectedRes);
63- // });
64- // });
56+ specialCharacters . forEach ( ( { character, expectedRes } ) => {
57+ test ( `Verify entering special characters behavior in search bar for: ${ character } ` , async ( ) => {
58+ const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
59+ await codeGraph . selectGraph ( GRAPHRAG_SDK ) ;
60+ await codeGraph . fillSearchBar ( character ) ;
61+ await delay ( 1000 ) ;
62+ expect ( ( await codeGraph . getSearchBarInputValue ( ) ) . includes ( character ) ) . toBe ( expectedRes ) ;
63+ } ) ;
64+ } ) ;
6565
66- // searchData.slice(0, 2).forEach(({ searchInput}) => {
67- // test(`search bar auto complete via ui and validating via api for: ${searchInput}`, async () => {
68- // const codeGraph = await browser.createNewPage(CodeGraph, urls.baseUrl);
69- // await codeGraph.selectGraph(GRAPHRAG_SDK);
70- // await codeGraph.fillSearchBar(searchInput);
71- // const count = await codeGraph.getSearchAutoCompleteCount();
72- // const api = new ApiCalls();
73- // const response = await api.searchAutoComplete(GRAPHRAG_SDK, searchInput);
74- // expect(count).toBe(response.result.completions.length);
75- // });
76- // })
66+ searchData . slice ( 0 , 2 ) . forEach ( ( { searchInput} ) => {
67+ test ( `search bar auto complete via ui and validating via api for: ${ searchInput } ` , async ( ) => {
68+ const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
69+ await codeGraph . selectGraph ( GRAPHRAG_SDK ) ;
70+ await codeGraph . fillSearchBar ( searchInput ) ;
71+ const count = await codeGraph . getSearchAutoCompleteCount ( ) ;
72+ const api = new ApiCalls ( ) ;
73+ const response = await api . searchAutoComplete ( GRAPHRAG_SDK , searchInput ) ;
74+ expect ( count ) . toBe ( response . result . completions . length ) ;
75+ } ) ;
76+ } )
7777
7878 nodes . forEach ( ( { nodeName} ) => {
7979 test ( `Verify canvas focuses on node ${ nodeName } after search` , async ( ) => { //here
0 commit comments