Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cypress test for workspace overview page #1633

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

Hailong-am
Copy link
Collaborator

@Hailong-am Hailong-am commented Nov 8, 2024

Description

Add cypress test for essential/search/analytics overview page

image

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@Hailong-am Hailong-am changed the title cypress test for use case overview page Add cypress test for workspace overview page Nov 11, 2024
@Hailong-am Hailong-am marked this pull request as ready for review November 11, 2024 09:52
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Comment on lines +20 to +35
const createWorkspace = (datasourceId) => {
cy.createWorkspace({
name: workspaceName,
description: workspaceDescription,
features: workspaceFeatures,
settings: {
permissions: {
library_write: { users: ['%me%'] },
write: { users: ['%me%'] },
},
...(datasourceId ? { dataSources: [datasourceId] } : {}),
},
}).then((value) => {
workspaceId = value;
});
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const createWorkspace = (datasourceId) => {
cy.createWorkspace({
name: workspaceName,
description: workspaceDescription,
features: workspaceFeatures,
settings: {
permissions: {
library_write: { users: ['%me%'] },
write: { users: ['%me%'] },
},
...(datasourceId ? { dataSources: [datasourceId] } : {}),
},
}).then((value) => {
workspaceId = value;
});
};
const createWorkspace = (datasourceId) => {
cy.createWorkspace({
name: workspaceName,
description: workspaceDescription,
features: workspaceFeatures,
settings: {
permissions: {
library_write: { users: ['%me%'] },
write: { users: ['%me%'] },
},
...(datasourceId ? { dataSources: [datasourceId] } : {}),
},
}).then((value) => {
workspaceId = value;
});
};

We can move the function to a util function maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cy.createWorkspace already been a util function, and this createWorkspace function just utilized the cy.createWorkspace to create workspace with and without datasource. To move it to a common place as util function may not benefits other test cases.

Signed-off-by: Hailong Cui <[email protected]>
@wanglam
Copy link
Collaborator

wanglam commented Nov 13, 2024

@Hailong-am The workspace_analytics_overviews failed on workspace test workflow. Could you help to take a look?

Signed-off-by: Hailong Cui <[email protected]>
@Hailong-am Hailong-am merged commit 295636c into opensearch-project:main Nov 13, 2024
57 of 65 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 13, 2024
* cypress test for use case overview page

Signed-off-by: Hailong Cui <[email protected]>

* add cypress test for analytics overview page

Signed-off-by: Hailong Cui <[email protected]>

* add sample data cleanup

Signed-off-by: Hailong Cui <[email protected]>

* support mds is not enabled

Signed-off-by: Hailong Cui <[email protected]>

* remove alerts cards

Signed-off-by: Hailong Cui <[email protected]>

* fix failed test case

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit 295636c)
Hailong-am added a commit that referenced this pull request Nov 15, 2024
* cypress test for use case overview page

Signed-off-by: Hailong Cui <[email protected]>

* add cypress test for analytics overview page

Signed-off-by: Hailong Cui <[email protected]>

* add sample data cleanup

Signed-off-by: Hailong Cui <[email protected]>

* support mds is not enabled

Signed-off-by: Hailong Cui <[email protected]>

* remove alerts cards

Signed-off-by: Hailong Cui <[email protected]>

* fix failed test case

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit 295636c)

Co-authored-by: Hailong Cui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants