Skip to content

RI-6570 Verify read operations for all key types in the browsers module #4723

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

Open
wants to merge 9 commits into
base: feature/RI-6570/PlayWright
Choose a base branch
from

Conversation

valkirilov
Copy link
Collaborator

@valkirilov valkirilov commented Jul 16, 2025

Description

Add new E2E tests to check the read functionality for different key types in the Browsers module. These tests make sure that when you click on a key, all its details show up correctly in the Details Panel (name, value(s), TTL, etc.).

How the tests work

  • First, prepare the data for the test using the Redis API (it's easier and faster and also, the UI flow for creating keys is already covered in another test suite)
  • Then we open the Details Panel by clicking on the key we just added (in the table in the UI)
  • Finally, we check that all the key information is displayed correctly, like "Key name", "Value(s)", "TTL", etc.
image

Code Changes

  • Extend the API to support adding various key types, enabling us to easily assemble test data
  • Extend browser page locators to provide helpers for checking the state of the keys details drawer
  • Add e2e tests to verify that the information related to the various key types is properly displayed in the details drawer

How to run the tests

You can always refer to the README, but simply running the following command should do the trick for you

# From the root directory
yarn dev:api

# In a new tab, again from the root directory
yarn dev:ui

# In a new tab, but this time go to tests/playwright directory
yarn test:chromium:local-web browser/keys-read 

# The, check the detailed report an all the video recordings
yarn playwright show-report
image

* extend the API to support adding string keys
* extend browser page locators to provide helper for checking the state of the keys details drawer
* added e2e test to verify whether the information related to a string key is proplery displayed in the details drawer

re #RI-6570
Copy link
Contributor

github-actions bot commented Jul 16, 2025

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.34% 13787/14931
🟡 Branches 74% 4147/5604
🟢 Functions 85.82% 2124/2475
🟢 Lines 92.13% 13180/14306

Test suite run success

2941 tests passing in 286 suites.

Report generated by 🧪jest coverage report action from 76052ac

* extend the API to support adding ttl to the hash keys
* extend browser page locators to provide helper for checking the state of the hash keys details drawer
* added e2e test to verify whether the information related to a hash key is proplery displayed in the details drawer

re #RI-6570
* extend the API to support adding list keys
* extend browser page locators to provide helper for checking the state of the list keys details drawer
* added e2e test to verify whether the information related to a list key is proplery displayed in the details drawer

re #RI-6570
@valkirilov valkirilov force-pushed the feature/RI-6570/e2e-playwright-browser-keys-read branch from 1c596e2 to f551b57 Compare July 16, 2025 08:55
Copy link
Contributor

github-actions bot commented Jul 16, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 81.37% 18402/22616
🟡 Branches 67% 8068/12042
🟡 Functions 75.13% 4866/6477
🟢 Lines 81.75% 18005/22024

Test suite run success

4792 tests passing in 628 suites.

Report generated by 🧪jest coverage report action from 0b2f581

* extend the API to support adding ttl to set keys
* extend browser page locators to provide helper for checking the state of the set keys details drawer
* added e2e test to verify whether the information related to a set key is proplery displayed in the details drawer

re #RI-6570
* extend the API to support adding sorted set keys
* extend browser page locators to provide helper for checking the state of the sorted set keys details drawer
* added e2e test to verify whether the information related to a sorted set key is proplery displayed in the details drawer

re #RI-6570
* extend the API to support adding json keys
* added e2e test to verify whether the information related to a json key is proplery displayed in the details drawer

re #RI-6570
* extend the API to support adding ttl to stream keys
* extend browser page locators to provide helper for checking the state of the stream keys details drawer
* added e2e test to verify whether the information related to a stream key is proplery displayed in the details drawer

re #RI-6570
@valkirilov valkirilov self-assigned this Jul 17, 2025
const requestBody = {
keyName: Buffer.from(keyParameters.keyName, 'utf-8'),
members: keyParameters.members.map((member) => ({
name: Buffer.from(member.name, 'utf-8'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Buffer.from(member.name, 'utf-8') can be probably abstracted as a helper function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done 👍

async isKeyDetailsClosed(): Promise<boolean> {
try {
// Give a small moment for UI transitions to complete
await this.page.waitForTimeout(100)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is flaky. Better wait for an element to show

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Totally agree, fixed.

}
}

async getKeyTTL(): Promise<string | null> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is function declared in constructor with very similar name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch, refactored.

- remove fixed timeouts causing flaky results sometimes
- export common logic for building string buffers and reuse it, as a helper function
- cleanup unncesessary helper frunction in the browser objects
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