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

UI visual regression testing to cover UI widgets visibility #674

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

Conversation

Ygnas
Copy link
Contributor

@Ygnas Ygnas commented Sep 18, 2024

Issue link

https://issues.redhat.com/browse/RHOAIENG-12525

Depends on:

What changes have been made

Added I visual regression testing to cover UI widgets visibility

Verification steps

Passing tests.
At the moment I have made a separate workflow but I think it would be best to integrate them into the guided notebook tests, as my workflow is almost identical to that one.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

@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 Sep 18, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@Ygnas Ygnas force-pushed the RHOAIENG-12525 branch 7 times, most recently from 942fb9f to 89ac3c3 Compare September 19, 2024 08:22
@Ygnas Ygnas marked this pull request as ready for review September 19, 2024 08:36
@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 Sep 19, 2024
@Ygnas Ygnas requested review from KPostOffice and Bobbins228 and removed request for MichaelClifford September 19, 2024 08:37
.github/workflows/ui_notebooks_test.yaml Outdated Show resolved Hide resolved
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip" # caching pip dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to use pip over poetry here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this one as that's how it was done in the guided notebook tests workflow

.github/workflows/ui_notebooks_test.yaml Outdated Show resolved Hide resolved
ui-tests/tests/0_basic_ray.test.ts Outdated Show resolved Hide resolved
@Ygnas Ygnas force-pushed the RHOAIENG-12525 branch 6 times, most recently from baf4658 to cee54a1 Compare September 19, 2024 15:58
@Ygnas Ygnas force-pushed the RHOAIENG-12525 branch 2 times, most recently from f62e61a to ad221de Compare September 19, 2024 16:43
Copy link
Collaborator

@KPostOffice KPostOffice left a comment

Choose a reason for hiding this comment

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

I have a few comments on the test

@Ygnas Ygnas force-pushed the RHOAIENG-12525 branch 3 times, most recently from be97842 to c0e616f Compare September 20, 2024 10:50
Copy link
Contributor

@Bobbins228 Bobbins228 left a comment

Choose a reason for hiding this comment

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

Just a nit on the notebook name and verification on cluster deletion.

demo-notebooks/guided-demos/widget_notebook_example.ipynb Outdated Show resolved Hide resolved
.github/workflows/ui_notebooks_test.yaml Outdated Show resolved Hide resolved
demo-notebooks/guided-demos/widget_notebook_example.ipynb Outdated Show resolved Hide resolved
ui-tests/tests/widget_notebook_example.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

openshift-ci bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from bobbins228. For more information see the Kubernetes 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

@Ygnas Ygnas added the test-ui-notebooks Run PR check to verify UI notebooks label Sep 20, 2024
@Ygnas Ygnas added test-ui-notebooks Run PR check to verify UI notebooks and removed test-ui-notebooks Run PR check to verify UI notebooks labels Sep 20, 2024
Comment on lines +85 to +94
const successMessage = await page.waitForSelector('text=Ray Cluster: \'raytest\' has successfully been created', { timeout: 10000 });
expect(successMessage).not.toBeNull();

const resourcesMessage = await page.waitForSelector('text=Waiting for requested resources to be set up...');
expect(resourcesMessage).not.toBeNull();

const upAndRunningMessage = await page.waitForSelector('text=Requested cluster is up and running!');
expect(upAndRunningMessage).not.toBeNull();

const dashboardReadyMessage = await page.waitForSelector('text=Dashboard is ready!');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use timeouts for all of these just incase the Dashboard doesn't come up (or someone changes the text but forgets to change the test)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will still wait for the timeout of the set time out

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's fine. I just mean so that if the changes are pushed the test doesn't hang indefinitely waiting for the condition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if it wait's for the cluster to be ready and it can take sometime or even fail, what is the timeout for that? The cluster is ready at different time every single time

Copy link
Collaborator

@KPostOffice KPostOffice left a comment

Choose a reason for hiding this comment

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

2 small comments, other than that, I think this is g2g

}
}

async function runLastCell(page, cellCount, expectedMessage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
async function runLastCell(page, cellCount, expectedMessage) {
async function runPreviousCell(page, cellCount, expectedMessage) {

Small nit

import { expect } from "@playwright/test";
import * as path from "path";

test.setTimeout(460000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

add to playwright config as discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-ui-notebooks Run PR check to verify UI notebooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants