Skip to content

Conversation

chavanr2019
Copy link
Contributor

@chavanr2019 chavanr2019 commented Feb 14, 2022

TEST GOAL
Verify if lock workspace feature works as expected.

  • Test case 1: verify if workspace is locked
  • Test case 2: verify if workspace is unlocked.

PR checklist

  • This PR meets the Acceptance Criteria in the JIRA story
  • The JIRA story has been moved to Dev Review
  • This PR includes appropriate unit tests
  • I have run and tested this change locally
  • I have run the E2E tests on ths change against my local UI and/or API server with yarn test-local or yarn test-local-devup
  • If this includes a UI change, I have taken screen recordings or screenshots of the new behavior and notified the PO and UX designer
  • If this includes an API change, I have updated the appropriate Swagger definitions and notified API consumers
  • If this includes a new feature flag, I have created and linked new JIRA tickets to (a) turn on the feature flag and (b) remove it later

Copy link
Contributor Author

@chavanr2019 chavanr2019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmthibault79 @aweng98 Please review, Thanks!

Copy link
Contributor Author

@chavanr2019 chavanr2019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmthibault79 the test steps at line 69-70 have been updated since this file has been refactored: workspace-base.ts

Copy link
Collaborator

@jmthibault79 jmthibault79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except for the tab-selection problem ... I'll wait for you to work that out

});

// function to create cohort, dataset and notebook
async function createDatasetNotebook(page: Page, pyNotebookName: string): Promise<NotebookPreviewPage> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is same as workspace-admin-ui.spec createDatasetNotebook(). I'm editing it in #6342. You can make this a common function in test-utils.ts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok!

Copy link
Contributor Author

@chavanr2019 chavanr2019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update the requested changes as soon as #6342 is merged. Thanks!

});

// function to create cohort, dataset and notebook
async function createDatasetNotebook(page: Page, pyNotebookName: string): Promise<NotebookPreviewPage> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok!

Copy link
Contributor Author

@chavanr2019 chavanr2019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review suggestion have been incorporated and with partial test steps I've been able to run the test successfully. But I would like to merge only when the createWorkspace issue is resolved. Please let me know if that works for both of you. Thanks!

Comment on lines +478 to +489
export async function createDatasetNotebook(page: Page, pyNotebookName: string): Promise<NotebookPreviewPage> {
await findOrCreateDataset(page, { openEditPage: true });

const datasetBuildPage = new DatasetBuildPage(page);
const exportModal = await datasetBuildPage.clickAnalyzeButton();

await exportModal.enterNotebookName(pyNotebookName);
await exportModal.pickLanguage(Language.Python);
await exportModal.clickExportButton();
const notebookPreviewPage = new NotebookPreviewPage(page);
return await notebookPreviewPage.waitForLoad();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aweng98 function moved from the lock-workspace and workspace-admin test file.

Comment on lines +23 to +26
const selected = await getPropValue<string>(element, 'ariaSelected');
return selected !== undefined
? selected === 'true'
: (await getStyleValue<string>(this.page, element, 'border-bottom')) !== null;
Copy link
Contributor Author

@chavanr2019 chavanr2019 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmthibault79 tab file updated with the help of Alex, it gets the aria-selected status. Now the tab-status verification works as expected.

Copy link
Contributor

@aweng98 aweng98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

async getLockedWorkspaceReason(): Promise<string> {
const xpath = '//*[@data-test-id="lock-workspace-msg"]//child::div[2]/div[1]/b';
const element = BaseElement.asBaseElement(this.page, await this.page.waitForXPath(xpath, { visible: true }));
const textContent = element.getTextContent();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a await.

@chavanr2019 chavanr2019 merged commit 0fd1547 into main Mar 3, 2022
@chavanr2019 chavanr2019 deleted the chavanr/lock-workspace-test branch March 3, 2022 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants