Fix(cypress): Fix e2e failing on master (#32494)

Этот коммит содержится в:
yasser khan
2025-07-03 10:19:58 +05:30
коммит произвёл GitHub
родитель 6004d15f9e
Коммит 5cd3a3f745
3 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@@ -296,12 +296,12 @@ function verifySearchAutocomplete(index, type = 'user') {
const usernameLength = 12;
const displayName = text.substring(1, usernameLength) + ' ' + text.substring(usernameLength, text.length);
const userAriaLabel = getUserMentionAriaLabel(displayName);
cy.wrap(el).parents('#searchFormContainer').find('.sr-only').should('have.attr', 'aria-live', 'polite').and('have.text', userAriaLabel);
cy.wrap(el).parents('#searchBox').find('.sr-only').should('have.attr', 'aria-live', 'polite').and('contain.text', userAriaLabel);
});
} else if (type === 'channel') {
cy.get('.suggestion-list__ellipsis').invoke('text').then((text) => {
const channel = text.split('~')[1].toLowerCase().trim();
cy.wrap(el).parents('#searchFormContainer').find('.sr-only').should('have.attr', 'aria-live', 'polite').and('have.text', channel);
cy.wrap(el).parents('#searchBox').find('.sr-only').should('have.attr', 'aria-live', 'polite').and('contain.text', channel);
});
}
});

Просмотреть файл

@@ -223,6 +223,6 @@ describe('Verify Guest User Identification in different screens', () => {
});
// # Close and Clear the Search Autocomplete
cy.get('#searchFormContainer').find('.input-clear-x').click({force: true});
cy.findByTestId('searchBoxClose').click({force: true});
});
});

Просмотреть файл

@@ -45,13 +45,11 @@ describe('Search', () => {
// # Verify that the cleared search text does not appear on the search box
cy.uiGetSearchContainer().should('be.visible').click();
cy.uiGetSearchBox().should('be.empty');
cy.uiGetSearchContainer().should('be.visible').click();
cy.uiGetSearchContainer().type('{esc}');
cy.uiGetSearchBox().type('{esc}');
// # Verify that the Search term input box is still cleared and search term does not reappear when RHS opens
cy.uiGetSearchContainer().should('be.visible').click();
cy.uiGetSearchBox().and('be.empty');
cy.uiGetSearchContainer().should('be.visible').click();
cy.uiGetSearchContainer().type('{esc}');
cy.uiGetSearchBox().type('{esc}');
});
});