Skip to content

Conversation

@anpingli
Copy link

@anpingli anpingli commented Oct 13, 2025

  • Run Logging UI test using real test data
  • defined an individual entrypoint run-cypress-logging.sh
  • update cypress:run:ci and web/cypress.config.ts to make the CI run as-is.
  • Test Logging using both cluster-admin and common users
  • Run Logging test on both Admin Console and Dev Console
  • Run Logging test on both Observer->Logs, and Pod->aggr logs

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2025
@openshift-ci openshift-ci bot requested review from kyoto and zhuje October 13, 2025 07:28
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 13, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anpingli
Once this PR has been reviewed and has the lgtm label, please assign zhuje for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2025
@anpingli anpingli changed the title Logging-ui-plugin test using real user [WIP]Logging-ui-plugin test using real user Oct 13, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2025
@anpingli anpingli force-pushed the real-user-test branch 8 times, most recently from 86bc31f to 856f0b1 Compare November 24, 2025 10:17
@zhuje
Copy link
Contributor

zhuje commented Nov 24, 2025

/retest

@zhuje
Copy link
Contributor

zhuje commented Nov 24, 2025

@anpingli There are some errors coming from the package-lock.json file, this is from prow logs:

npm error "npm ci" can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with "npm install" before continuing. npm error

@anpingli anpingli force-pushed the real-user-test branch 9 times, most recently from 3294a38 to cf23167 Compare December 3, 2025 13:27
@anpingli anpingli changed the title [WIP]Logging-ui-plugin test using real user ]Logging-ui-plugin test using real data Dec 3, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2025
@anpingli anpingli changed the title ]Logging-ui-plugin test using real data Logging-ui-plugin test using real data Dec 3, 2025
@anpingli
Copy link
Author

anpingli commented Dec 3, 2025

/retest-required

@zhuje
Copy link
Contributor

zhuje commented Dec 3, 2025

/retest

@anpingli anpingli force-pushed the real-user-test branch 11 times, most recently from a5011dc to 9a13df3 Compare December 4, 2025 06:13
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 4, 2025

@anpingli: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@anpingli
Copy link
Author

anpingli commented Dec 4, 2025

@zhuje All test pass now.

@anpingli
Copy link
Author

@jgbernalp could you talk a look my PR?

@jgbernalp
Copy link
Contributor

LGTM
@etmurasaki can you review if this is in line with what we have for other plugins


beforeEach( function() {
// Load the other page to ensure Observe-Logs in clean status
cy.get('section.pf-v6-c-nav__subnav').contains('a','Search').click();
Copy link
Contributor

Choose a reason for hiding this comment

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

we prefer to use test ids, so we don't depend on specific patternfly claseses. Which might change.

const pattern = new RegExp(`${APP_NAMESPACE1}|${APP_NAMESPACE2}`);
cy.getByTestId(TestIds.LogsTable).within(() => {
// Click the first expand button
cy.get('#expand.pf-v5-c-table__td.lv-plugin__table__expand.pf-v5-c-table__toggle', { timeout: 6000 })
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, it seems we are mixing pf6 and pf5 selectors. A better way would be to add a test id to the logs table so we can reference it directly.


it('Log Panel top elements', {tags:['@smoke','@aggr']} , () => {
//load Aggregated Logs for the first pod in APP_NAMESPACE1
cy.get('[data-test-id="namespace-bar-dropdown"]')
Copy link
Contributor

Choose a reason for hiding this comment

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

repeated steps like this we can make them reusable in a "utils.ts" file as a "Page Object" concept where you can pass namespace as parameter and do not hardcode it

.first()
.find('a.co-resource-item__resource-name')
.click();
cy.get('a[data-test-id="horizontal-link-Aggregated Logs"]').click();
Copy link
Contributor

Choose a reason for hiding this comment

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

as @jgbernalp had mentioned before, these data-test-id, data-id (when MaterialUI if Logging also uses), and other locators could be also be in the same /src/test-ids file in another "json object" like DataTestIds, DataIds, Classes, then according to the type you can create different selectors cy.getByDataTestId, cy.getByDataIds, cy.getByClasses and refer to them.

When handling with Classes, you can refer both pf5 and pf6. You can take a look at this file as example: https://github.com/openshift/monitoring-plugin/blob/main/web/src/components/data-test.ts

Copy link
Author

Choose a reason for hiding this comment

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

Good suggestion. Let me define similar data-test.ts for Logging.

.click();
cy.get('a[data-test-id="horizontal-link-Aggregated Logs"]').click();

cy.getByTestId(TestIds.ToggleHistogramButton).should('exist');
Copy link
Contributor

Choose a reason for hiding this comment

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

an example of reusable steps would be these assertions cross different user types or cross different pages, for example Logs and Aggregated Logs probably have many common components. This way, if something breaks one of the pages by any reason, you could also detect and fix it easily in one place.

I didn't take a look at all cypress test files, but I have a feeling they are very similar in general and maybe one or another difference depending on the page (Logs or Agg Logs) and/or per user type. So, these steps could become more than reused.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it would be a pain now to refactor, decouple all these steps, but I am sure it worth as a short/mid/long term, specially if you need to backport all these files of 2 Logging versions and/or upgrade patternfly from 4/5 to 6 and future ones.

Copy link
Author

Choose a reason for hiding this comment

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

I had defined a common function in this cypress/e2e/logging/logs-common-test.cy.ts which can be called in different page.

}
})
cy.get('[data-test-id="perspective-switcher-toggle"]').invoke('text').then((text) => {
if (text == "Administrator" ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

already in 4.21 nightly builds, you are going to see "Core platform" instead of Administrator.
Monitoring-plugin and distributed tracing repos, we have something like https://github.com/openshift/monitoring-plugin/blob/e35027e4e122dc1b70ce2584a13d1f20e5948576/web/cypress/support/commands/auth-commands.ts#L120 to pass in your test instead of hardcode in your test file.

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.

5 participants