Skip to content

Commit

Permalink
refactor: Add destinationWorkspace to move experiment function.
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodallacqua-hpe committed Oct 16, 2024
1 parent 273410f commit b255ca9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions webui/react/src/e2e/tests/experimentList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ProjectDetails } from 'e2e/models/pages/ProjectDetails';
import { detExecSync, fullPath } from 'e2e/utils/detCLI';
import { safeName } from 'e2e/utils/naming';
import { repeatWithFallback } from 'e2e/utils/polling';
import { V1Project } from 'services/api-ts-sdk';
import { V1Project, V1Workspace } from 'services/api-ts-sdk';
import { ExperimentBase } from 'types';

test.describe('Experiment List', () => {
Expand Down Expand Up @@ -563,10 +563,12 @@ test.describe('Experiment List', () => {

test.describe('Row Actions', () => {
let destinationProject: V1Project;
let destinationWorkspace: V1Workspace;
let experimentId: number;

// create a new project, workspace and experiment
test.beforeAll(async ({ backgroundApiProject, newProject: { response: { project } } }) => {
test.beforeAll(async ({ backgroundApiProject, backgroundApiWorkspace, newProject: { response: { project } } }) => {
destinationWorkspace = (await backgroundApiWorkspace.createWorkspace(backgroundApiWorkspace.new())).workspace;
destinationProject = (await backgroundApiProject.createProject(
project.workspaceId,
backgroundApiProject.new({ projectProps: { workspaceId: project.workspaceId } }),
Expand All @@ -580,13 +582,14 @@ test.describe('Experiment List', () => {
});

// cleanup
test.afterAll(async ({ backgroundApiProject }) => {
test.afterAll(async ({ backgroundApiProject, backgroundApiWorkspace }) => {
if (experimentId !== undefined) {
detExecSync(`experiment kill ${experimentId}`);
detExecSync(`experiment delete ${experimentId} --y`);
}

await backgroundApiProject.deleteProject(destinationProject.id);
await backgroundApiWorkspace.deleteWorkspace(destinationWorkspace.id);
});

test('move experiment', async () => {
Expand All @@ -597,9 +600,15 @@ test.describe('Experiment List', () => {
const menuMove = await newExperimentRow.experimentActionDropdown.open();

await menuMove.menuItem('Move').pwLocator.click();
await menuMove.moveModal.destinationWorkspace.pwLocator.fill(destinationProject.workspaceName ?? '');
await menuMove.moveModal.destinationProject.pwLocator.waitFor({ state: 'visible' });
await menuMove.moveModal.destinationProject.pwLocator.fill(destinationProject.name);
await menuMove.moveModal.footer.submit.pwLocator.click();
// TODO: check why it's failing on submit (somehow the check bellow isn' passing)
/**
* const handleSubmit = async () => {
if (workspaceId === sourceWorkspaceId && projectId === sourceProjectId) {
*/
await menuMove.moveModal.pwLocator.waitFor({ state: 'hidden' });

await newExperimentRow.pwLocator.waitFor({ state: 'hidden' });
Expand Down

0 comments on commit b255ca9

Please sign in to comment.