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

test: [M3-7510] - Cypress tests for Databases create page for restricted users #11912

Merged

Conversation

dmcintyr-akamai
Copy link
Contributor

Description 📝

Add Cypress tests for Databases create page for restricted users

How to test 🧪

pnpm cy:e2e -s "cypress/e2e/core/databases/create-database.spec.ts"

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

Commit message and pull request title format standards

Note: Remove this section before opening the pull request
Make sure your PR title and commit message on squash and merge are as shown below

<commit type>: [JIRA-ticket-number] - <description>

Commit Types:

  • feat: New feature for the user (not a part of the code, or ci, ...).
  • fix: Bugfix for the user (not a fix to build something, ...).
  • change: Modifying an existing visual UI instance. Such as a component or a feature.
  • refactor: Restructuring existing code without changing its external behavior or visual UI. Typically to improve readability, maintainability, and performance.
  • test: New tests or changes to existing tests. Does not change the production code.
  • upcoming: A new feature that is in progress, not visible to users yet, and usually behind a feature flag.

Example: feat: [M3-1234] - Allow user to view their login history


@dmcintyr-akamai dmcintyr-akamai marked this pull request as ready for review March 24, 2025 17:56
@dmcintyr-akamai dmcintyr-akamai requested review from a team as code owners March 24, 2025 17:56
@dmcintyr-akamai dmcintyr-akamai requested review from jdamore-linode, bnussman-akamai, hasyed-akamai and cliu-akamai and removed request for a team March 24, 2025 17:56
@bnussman-akamai bnussman-akamai changed the title test [M3-7510]: Cypress tests for Databases create page for restricted users test: [M3-7510] - Cypress tests for Databases create page for restricted users Mar 24, 2025
Copy link
Contributor

@hasyed-akamai hasyed-akamai left a comment

Choose a reason for hiding this comment

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

Thanks @dmcintyr-akamai, apart from only checking the Button to be disable with tooltip Text we can also check for the resource section to be available similar to be this and check there is no presence of table for the database for empty state similar to this

  • Also for the restricted user Access are we planning for the non-empty state as well reference as this is also a use case in which we need to check that the action menu buttons should also be disabled when having read-only access which is implemented recently in the PR ?

@dmcintyr-akamai
Copy link
Contributor Author

  1. added verification that resource links are present on empty page for restricted user
  2. verified table is not present (and also added aria-label in react component to make this easier)

I didn't do anything about "Validate the action menu items are disabled for restricted user" bc afaik this isnt relevant yet. If no rows are retrieved then the table is not present, and if there is no table then there is no action menu afaik.

@hasyed-akamai
Copy link
Contributor

Thanks @dmcintyr-akamai for implementing the changes.

You're right that there won't be an action menu for the empty-state landing page. Do we have a PR or ticket addressing the non-empty state landing page where we can check for the table and action menu? Please refer to the description of this ticket for details.

@dmcintyr-akamai
Copy link
Contributor Author

Thanks @dmcintyr-akamai for implementing the changes.

You're right that there won't be an action menu for the empty-state landing page. Do we have a PR or ticket addressing the non-empty state landing page where we can check for the table and action menu? Please refer to the description of this ticket for details.

M3-9623 is inaccurate about current behavior afaik. My restricted user account can't view any databases, linodes, or images, whereas my non-restricted user account can view them. The steps in M3-9623 seem appropriate for a read-only user but not a restricted one. If i login w/ my readonly account, i can view the table items. in most of the pages the action menu is disabled but it is NOT disabled in the databases page (tho if u click on the action menu item it takes you to a page where it properly tells u it's disabled). this is a bug i assume?

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 536 passing tests on test run #8 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing536 Passing4 Skipped104m 27s

Copy link
Contributor

@hasyed-akamai hasyed-akamai left a comment

Choose a reason for hiding this comment

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

Thanks @dmcintyr-akamai 🚀

@hasyed-akamai hasyed-akamai added the Approved Multiple approvals and ready to merge! label Mar 26, 2025
@dmcintyr-akamai dmcintyr-akamai merged commit 3871670 into linode:develop Mar 31, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants