Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 117 additions & 24 deletions frontend/jupyter/cypress/e2e/main-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Main tables', () => {
});

// We use function () in order to be able to access aliases via this
it('renders every Notebook name into the table', () => {
it('renders every Notebook name into the table', function () {
let i = 0;
const notebooks = this.notebooksRequest.notebooks;
// Table is sorted by Name in ascending order by default
Expand All @@ -49,7 +49,7 @@ describe('Main tables', () => {
});
});

it('checks Status icon for all notebooks', () => {
it('checks Status icon for all notebooks', function () {
let i = 0;
const notebooks = this.notebooksRequest.notebooks;
cy.get('[data-cy-table-id="notebooks-table"]')
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Main tables', () => {
});
});

it.only('should display icon for default notebook', () => {
it('should display icon for default notebook', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('test-pro-b')
Expand All @@ -92,26 +92,92 @@ describe('Main tables', () => {
.should('exist');
});

it('should have icon for oom', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('a-dog-breed-katib')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('exist');
});

it('should not have icon for oom', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('a-test-01')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('not.exist');
describe('warning icon', ()=>{
it('should not have a warning icon', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('a-test-01')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('not.exist');
});

it('should have a warning for OOMKilled', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('a-dog-breed-katib')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('exist');

cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('a-dog-breed-katib')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.invoke('attr', 'aria-describedby')
.then(tooltip=>{
// Couldn't get the test to open the tooltip by hovering, so using the next best thing
cy.get(`#${tooltip}`)
.should('have.text', 'Potential issues with this notebook server:\n* Last restarted because of an Out-Of-Memory error.');
});
});

it('should have a warning for full volume', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('b-culled-notebook')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('exist');

cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('b-culled-notebook')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.invoke('attr', 'aria-describedby')
.then(tooltip=>{
// Couldn't get the test to open the tooltip by hovering, so using the next best thing
cy.get(`#${tooltip}`)
.should('have.text', 'Potential issues with this notebook server:\n* One or more attached volumes are full.');
});
});

it('should have a warning for both OOMKilled and full volume', () => {
cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('test-pro-b')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.should('exist');

cy.get('[data-cy-table-id="notebooks-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('test-pro-b')
.parent()
.parent()
.find('app-warning-icon')
.find('mat-icon')
.invoke('attr', 'aria-describedby')
.then(tooltip=>{
// Couldn't get the test to open the tooltip by hovering, so using the next best thing
cy.get(`#${tooltip}`)
.should('have.text', 'Potential issues with this notebook server:\n* Last restarted because of an Out-Of-Memory error.\n* One or more attached volumes are full.');
});
});
});

it('should start a notebook', () => {
Expand Down Expand Up @@ -645,7 +711,7 @@ describe('Main tables', () => {
);
});

describe('should handle volume pending resize', ()=>{
describe('volume pending resize', ()=>{
it('should display pending resize icon', ()=>{
cy.get('[data-cy-table-id="volumes-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
Expand Down Expand Up @@ -885,6 +951,33 @@ describe('Main tables', () => {
.should('eq', 200);
cy.get('mat-dialog-container').should('not.exist');
});

it('should display usage warning icon when above 95% full', () => {
cy.get('[data-cy-table-id="volumes-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('titanic-ml-47xh5-data-m57vq-2md82')
.scrollIntoView();

// should display icon on volumes with pending resize
cy.get('[data-cy-table-id="volumes-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('test-notebook-volume')
.parent()
.parent()
.find('app-usage')
.find('mat-icon')
.should('exist').and('have.class', 'warning-icon');

// should not display icon when volume has no pending resize
cy.get('[data-cy-table-id="volumes-table"]')
.find(`[data-cy-resource-table-row="Name"]`)
.contains('titanic-ml-47xh5-data-m57vq-2md82')
.parent()
.parent()
.find('app-usage')
.find('mat-icon')
.should('not.exist');
});
});

describe('Kubecost table', () => {
Expand Down
16 changes: 8 additions & 8 deletions frontend/jupyter/cypress/fixtures/pvcs.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,22 @@
"eventMessage": "waiting for first consumer to be created before binding"
},
"age": "2026-02-06T14:57:17Z",
"capacity": "0",
"capacity": "8Gi",
"pendingResize": "0",
"modes": [
"ReadWriteOnce"
],
"class": "default",
"notebooks": [
"test-notebook"
"test-pro-b"
],
"labels": null,
"viewer": {
"status": "",
"url": ""
},
"usage": "",
"usedBytes": ""
"usage": "96",
"usedBytes": "1234560"
},
{
"name": "test-notebook-volume",
Expand All @@ -165,22 +165,22 @@
"eventMessage": "waiting for first consumer to be created before binding"
},
"age": "2026-02-06T14:57:17Z",
"capacity": "0",
"capacity": "4Gi",
"pendingResize": "0",
"modes": [
"ReadWriteOnce"
],
"class": "default",
"notebooks": [
"test-notebook"
"b-culled-notebook"
],
"labels": null,
"viewer": {
"status": "",
"url": ""
},
"usage": "",
"usedBytes": ""
"usage": "97.567",
"usedBytes": "743628800"
},
{
"name":"test-pro-b-volume",
Expand Down
Loading
Loading