Cypress test. Search task feature. (#2599)

* Add css class to search task placeholder

* Cypress test. Search task feature.

* Finish write the test.

* Some fix

* Add some options for search

Co-authored-by: Kruchinin <dmitryx.kruchinin@intel.com>
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent e6e6be94f9
commit 8285e8bdd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,7 +25,13 @@ export default function TopBarComponent(props: VisibleTopBarProps): JSX.Element
<Row justify='center' align='middle'>
<Col md={11} lg={9} xl={8} xxl={7}>
<Text className='cvat-title'>Tasks</Text>
<Input.Search defaultValue={searchValue} onSearch={onSearch} size='large' placeholder='Search' />
<Input.Search
className='cvat-task-page-search-task'
defaultValue={searchValue}
onSearch={onSearch}
size='large'
placeholder='Search'
/>
</Col>
<Col md={{ span: 11 }} lg={{ span: 9 }} xl={{ span: 8 }} xxl={{ span: 7 }}>
<Button

@ -0,0 +1,29 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName } from '../../support/const';
context('Search task feature.', () => {
const caseId = '35';
function searchTask(option, result) {
cy.server().route('GET', '/api/v1/tasks**').as('searchTask');
cy.get('.cvat-task-page-search-task').find('[placeholder="Search"]').clear().type(`${option}{Enter}`);
cy.wait('@searchTask').its('status').should('equal', 200);
cy.contains('.cvat-item-task-name', taskName).should(result);
}
describe(`Testing case "${caseId}"`, () => {
it('Type to task search some field and check result.', () => {
searchTask(`${taskName.substring(0, 3)}`, 'exist');
searchTask('121212', 'not.exist');
searchTask(`owner: ${Cypress.env('user')}`, 'exist');
searchTask('mode: annotation', 'exist');
searchTask('status: annotation', 'exist');
searchTask(`mode: interpolation AND owner: ${Cypress.env('user')}`, 'not.exist');
});
});
});
Loading…
Cancel
Save