[Code] search functional test to cover file typeahead query case insensitive (#38012) (#38186)

This commit is contained in:
Mengwei Ding 2019-06-06 15:43:27 -07:00 committed by GitHub
parent 357cae1b11
commit 43946cb12b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 1 deletions

View file

@ -17,6 +17,7 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Tes
describe('Search', () => {
const symbolTypeaheadListSelector = 'codeTypeaheadList-symbol codeTypeaheadItem';
const fileTypeaheadListSelector = 'codeTypeaheadList-file codeTypeaheadItem';
const searchResultListSelector = 'codeSearchResultList codeSearchResultFileItem';
const languageFilterListSelector = 'codeSearchLanguageFilterList codeSearchLanguageFilterItem';
@ -36,7 +37,6 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Tes
it('Trigger symbols in typeahead', async () => {
log.debug('Trigger symbols in typeahead');
// Fill in the search query bar with a common prefix of symbols.
await PageObjects.code.fillSearchQuery('user');
await retry.tryForTime(5000, async () => {
@ -48,6 +48,27 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Tes
});
});
it('File typeahead should be case insensitive', async () => {
log.debug('File typeahead should be case insensitive');
await PageObjects.code.fillSearchQuery('LICENSE');
await retry.tryForTime(5000, async () => {
const symbols = await testSubjects.findAll(fileTypeaheadListSelector);
expect(symbols).to.have.length(1);
expect(await symbols[0].getVisibleText()).to.equal('LICENSE');
});
await PageObjects.code.fillSearchQuery('license');
await retry.tryForTime(5000, async () => {
const symbols = await testSubjects.findAll(fileTypeaheadListSelector);
expect(symbols).to.have.length(1);
expect(await symbols[0].getVisibleText()).to.equal('LICENSE');
});
});
it('Full text search', async () => {
log.debug('Full text search');
// Fill in the search query bar with a common prefix of symbols.

View file

@ -197,3 +197,19 @@
}
}
}
{
"type": "_doc",
"value": {
"index": ".code-document-github.com-microsoft-typescript-node-starter-1",
"type": "_doc",
"id": "4SdMKGsBCG9E0p-YOgIC",
"source": {
"repoUri": "github.com/Microsoft/TypeScript-Node-Starter",
"path": "LICENSE",
"content": " MIT License\r\n\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE\r\n",
"language": "other",
"qnames": []
}
}
}