Skip to content

Commit

Permalink
testing more buttons in modal dialog (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Martinoli <[email protected]>
  • Loading branch information
dmartinol authored Oct 4, 2024
1 parent 7c506a2 commit 8480168
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/nimModelDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ class NIMDeployModal extends Modal {
findNIMToDeploy() {
return this.find().findByTestId('nim-model-list-selection');
}

findNimStorageSizeInput() {
return cy.get('[data-testid="pvc-size"] input');
}

findStorageSizeMinusButton() {
return this.find().findByTestId('pvc-size').findByRole('button', { name: 'Minus' });
}

findStorageSizePlusButton() {
return this.find().findByTestId('pvc-size').findByRole('button', { name: 'Plus' });
}

findNimModelReplicas() {
return cy.get('[id="model-server-replicas"]');
}

findNimModelReplicasMinusButton() {
return this.find().find('button[aria-label="Minus"]').eq(1);
}

findNimModelReplicasPlusButton() {
return this.find().find('button[aria-label="Plus"]').eq(1);
}
}

export const nimDeployModal = new NIMDeployModal();
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ describe('NIM Model Serving', () => {
.click();
nimDeployModal.findSubmitButton().should('be.enabled');

nimDeployModal.findNimStorageSizeInput().should('have.value', '30');
nimDeployModal.findStorageSizeMinusButton().click();
nimDeployModal.findNimStorageSizeInput().should('have.value', '29');
nimDeployModal.findStorageSizePlusButton().click();
nimDeployModal.findNimStorageSizeInput().should('have.value', '30');

nimDeployModal.findNimModelReplicas().should('have.value', '1');
nimDeployModal.findNimModelReplicasPlusButton().click();
nimDeployModal.findNimModelReplicas().should('have.value', '2');
nimDeployModal.findNimModelReplicasMinusButton().click();
nimDeployModal.findNimModelReplicas().should('have.value', '1');

nimDeployModal.findSubmitButton().click();

//dry run request
Expand Down

0 comments on commit 8480168

Please sign in to comment.