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

task/WMAQA-45 Shared Workspace Tests #23

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

shayanaijaz
Copy link
Collaborator

@shayanaijaz shayanaijaz commented Jan 22, 2024

Overview

Added tests for shared workspaces. Also added a teardown project that deals with deleting shared workspaces directly using tapis

Changes

  • Added shared workspace tests which include adding, editing, and searching shared workspaces
  • Added a teardown project. This project runs at the end after all tests are ran. The shared workspace teardown authenticates with tapis using the test users authentication, gets the users shared workspace systems for the specific portal and deletes those systems

Testing

  • Run tests normally using npx playwright test and ensure all tests pass
  • As an addition, also try manually logging onto the portal the tests were ran on and ensure no shared workspaces exist

Notes

In the shared workspace teardown there's a new function page.evaluate being used when doing external http calls. More details about why this is needed and what it does can be found here

Copy link
Collaborator

@fnets fnets left a comment

Choose a reason for hiding this comment

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

There's a couple of bugs I found, but the skip and teardown are working great!

test('Cleanup shared workspaces', async ({ page, baseURL }) => {
const {USERNAME: username, PASSWORD: password} = process.env;

const tenant = 'https://portals.tapis.io';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is ok for now, but we're going to need to parameterize this if we want to test portals on different tenants.

utils/pythonHelper.py Show resolved Hide resolved
Copy link
Collaborator

@fnets fnets left a comment

Choose a reason for hiding this comment

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

I think I have one change to make this more secure and another short research task for myself.

tests/teardown/data-files-shared-workspaces.teardown.js Outdated Show resolved Hide resolved

}

async function getSystems(page, tenant, projectPrefix, accessToken) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to delete all the shared systems, or just the one we created in these tests? Is there an easy or free way to get that system id at system creation? I'll take a look to try and save you a headache.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, it looks like it's available in the Shared Workspaces view and in the URL.

@fnets fnets self-requested a review December 9, 2024 20:48
@fnets fnets self-requested a review January 6, 2025 18:22
Copy link
Collaborator

@fnets fnets left a comment

Choose a reason for hiding this comment

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

In practice, it seems like the 'Edit Shared Workspace Name and Description' test is a little flaky, but I was able to get it to pass 3 times in a row.

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.

2 participants