123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- describe('autoComplete', () => {
- it('key press', () => {
- cy.visit('http://127.0.0.1:6006/iframe.html?id=autocomplete--basic-usage&args=&viewMode=story');
- cy.get('body').tab();
- cy.get('input').type('123');
- // open panel
- cy.get('input').type('{enter}');
- cy.get('.semi-popover');
- // close panel
- cy.get('input').type('{enter}');
- cy.get('.semi-popover').not('.exit');
- cy.get('input').should('have.value', '123');
-
- // test downArrow and upArrow
- cy.get('input').type('{enter}');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{upArrow}');
- cy.get('input').type('{esc}');
- cy.get('input').should('have.value', '123');
- // test downArrow when panel hidden
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{enter}');
- cy.get('input').should('have.value', '[email protected]');
- // test upArrow when panel hidden
- cy.get('input').type('{upArrow}');
- cy.get('input').type('{upArrow}');
- cy.get('input').type('{enter}');
- cy.get('input').should('have.value', '[email protected]');
- cy.get('input').trigger('mouseover');
- cy.get('.semi-input-clearbtn').click();
- cy.get('#root').click('right');
- cy.get('input').should('have.value', '');
- // test enter
- // cy.get('input').click();
- // cy.get('input').type('456');
- // cy.get('input').type('{downArrow}');
- // cy.get('input').type('{enter}');
- // cy.get('#root').click('right');
- // cy.get('input').should('have.value', '[email protected]');
- });
- it('mouse over option ', () => {
- cy.visit('http://127.0.0.1:6006/iframe.html?id=autocomplete--basic-usage&args=&viewMode=story');
- cy.get('input').type('123');
- cy.get('.semi-portal').contains('[email protected]').trigger('mouseover');
- cy.get('input').type('{downArrow}');
- cy.get('input').type('{enter}');
- cy.get('input').should('have.value', '[email protected]');
- });
- });
|