Miner: cypress - fixed failing cypress in main (#14275)

This commit is contained in:
Shailesh Parmar 2023-12-06 20:49:13 +05:30 committed by GitHub
parent d6a01ca5b1
commit 2a5042cf21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 14 deletions

View File

@ -10,7 +10,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BASE_WAIT_TIME, RETRY_TIMES } from './common';
import { RETRY_TIMES } from './common';
const BASE_WAIT_TIME = 4000;
export const checkDataInsightSuccessStatus = (
count = 1,
@ -27,7 +29,7 @@ export const checkDataInsightSuccessStatus = (
$ingestionStatus.text() !== 'Failed' &&
count <= RETRY_TIMES
) {
// retry after waiting with log1 method [20s,40s,80s,160s,320s]
// retry after waiting with log1 method [4s,8s,16s,32s,64s]
cy.wait(timer);
timer *= 2;
cy.reload();

View File

@ -573,21 +573,41 @@ export const visitEntityDetailsPage = ({
.first()
.click();
} else {
// if term is not available in search suggestion,
// hitting enter to search box so it will redirect to explore page
cy.get('body').click(1, 1);
cy.get('[data-testid="searchBox"]').type('{enter}');
verifyResponseStatusCode('@explorePageSearch', 200);
cy.get(`[data-testid="global-search-suggestion-box"]`)
.contains(term)
.then(($body) => {
if ($body.length) {
cy.get(`[data-testid="global-search-suggestion-box"]`)
.contains(term)
.click();
} else {
// if term is not available in search suggestion,
// hitting enter to search box so it will redirect to explore page
cy.get('body').click(1, 1);
cy.get('[data-testid="searchBox"]').type('{enter}');
verifyResponseStatusCode('@explorePageSearch', 200);
const tabName = EXPLORE_PAGE_TABS?.[entity] ?? entity;
const tabName = EXPLORE_PAGE_TABS?.[entity] ?? entity;
cy.get(`[data-testid="${tabName}-tab"]`).click();
cy.get(`[data-testid="${tabName}-tab"]`).click();
verifyResponseStatusCode('@explorePageTabSearch', 200);
verifyResponseStatusCode('@explorePageTabSearch', 200);
cy.get(`[data-testid="${id}"] [data-testid="entity-link"]`)
.scrollIntoView()
.click();
if (
$body.find(`[data-testid="${id}"] [data-testid="entity-link"]`)
.length
) {
cy.get(`[data-testid="${id}"] [data-testid="entity-link"]`)
.scrollIntoView()
.click();
} else {
cy.get(`[data-testid="entity-link"]`)
.contains(term)
.eq(0)
.click();
}
}
});
}
});

View File

@ -128,6 +128,10 @@ describe('Postgres Ingestion', () => {
.scrollIntoView()
.contains('Usage Ingestion')
.click();
cy.get('#root\\/filterCondition')
.scrollIntoView()
.type(`s.query like '%${tableName}%'`);
cy.get('[data-testid="submit-btn"]')
.scrollIntoView()
.should('be.visible')

View File

@ -148,7 +148,7 @@ const Suggestions = ({
const getEntitiesSuggestions = () => {
return (
<div role="none">
<div data-testid="global-search-suggestion-box" role="none">
{[
{ suggestions: tableSuggestions, searchIndex: SearchIndex.TABLE },
{ suggestions: topicSuggestions, searchIndex: SearchIndex.TOPIC },