From 7aa594853346382b6865f895d0fe1b5b35210b92 Mon Sep 17 00:00:00 2001 From: Satyajit Bulage Date: Thu, 18 Apr 2024 13:33:14 +0530 Subject: [PATCH] Added filter logic (need some tweak) Signed-off-by: Satyajit Bulage --- tests/cypress/support/commands.ts | 7 ++++++- tests/cypress/support/e2e.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/cypress/support/commands.ts b/tests/cypress/support/commands.ts index be11e3e5..f4e0e523 100644 --- a/tests/cypress/support/commands.ts +++ b/tests/cypress/support/commands.ts @@ -182,7 +182,12 @@ Cypress.Commands.add('checkApplicationStatus', (appName, namespace, clusterName= cypressLib.burgerMenuToggle(); cypressLib.accesMenu(clusterName); cy.clickNavMenu(['Workloads', 'Pods']); - cy.nameSpaceMenuToggle(namespace); + if (namespace) { + cy.nameSpaceMenuToggle(namespace); + } + // Type application name in filter + let newAppName = new RegExp(appName + "(?=.*[a-zA-Z])(?=.*[0-9])[A-Za-z0-9]+") + cy.get('.search.row').should('exist').type(newAppName); cy.contains('tr.main-row[data-testid="sortable-table-0-row"]').should('not.be.empty', { timeout: 25000 }); cy.get(`table > tbody > tr.main-row[data-testid="sortable-table-0-row"]`) .children({ timeout: 60000 }) diff --git a/tests/cypress/support/e2e.ts b/tests/cypress/support/e2e.ts index c1f13a92..a464c04d 100644 --- a/tests/cypress/support/e2e.ts +++ b/tests/cypress/support/e2e.ts @@ -31,7 +31,7 @@ declare global { deleteAll(fleetCheck?: boolean): Chainable; deleteAllFleetRepos(): Chainable; checkGitRepoStatus(repoName: string, bundles?: string, resources?: string): Chainable; - checkApplicationStatus(appName: string, namespace?: string, clusterName?: string): Chainable; + checkApplicationStatus(appName: string, clusterName?: string): Chainable; deleteApplicationDeployment(clusterName?: string): Chainable; modifyDeployedApplication(appName: string, clusterName?: string): Chainable; }