-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Elay Aharoni (EXT-Nokia) <elay.aharoni.ext@nokia.com>
- Loading branch information
Elay Aharoni (EXT-Nokia)
committed
Dec 11, 2024
1 parent
9cf6a25
commit 0ad2045
Showing
5 changed files
with
256 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...frontend/src/__tests__/cypress/cypress/tests/mocked/workspaces/filterWorkspacesTest.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { home } from '~/__tests__/cypress/cypress/pages/home'; | ||
|
||
const useFilter = (filterName: string, searchValue: string) => { | ||
cy.get("[id$='filter-workspaces-dropdown']").click(); | ||
cy.get(`[id$='filter-workspaces-dropdown-${filterName}']`).click(); | ||
cy.get("[id$='filter-workspaces-search-input']").type(searchValue); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(filterName); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(searchValue); | ||
}; | ||
|
||
describe('Application', () => { | ||
it('filter rows with single filter', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove one', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[class$='pf-v6-c-label-group__close']").eq(1).click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove all', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get('*').contains('Clear all filters').click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Name'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 4); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.