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

[Percy] Example Imagery tests are non-deterministic because the camera rotates randomly #7830

Open
unlikelyzero opened this issue Sep 10, 2024 · 1 comment
Assignees
Labels
type:maintenance tests, chores, or project maintenance
Milestone

Comments

@unlikelyzero
Copy link
Collaborator

unlikelyzero commented Sep 10, 2024

Summary

The cam embedded in images is being rotated randomly. We should inject a property of 30deg

/**
 * Rotates the camera element to a fixed 30 degrees.
 * This function addresses the non-deterministic behavior of camera rotation
 * in visual tests, as discussed in the GitHub issue.
 *
 * @param {import('@playwright/test').Page} page - The Playwright page object.
 * @see {@link https://github.com/nasa/openmct/issues/7830} for more details.
 */
async function rotateCamToFixedRotation(page) {
  await page.locator('.c-cr-cam-and-body').evaluate((element) => {
    element.style.transform = 'rotate(30deg)';
  });
}
@unlikelyzero unlikelyzero added the type:maintenance tests, chores, or project maintenance label Sep 10, 2024
@unlikelyzero unlikelyzero added this to the Target:4.0.1 milestone Sep 10, 2024
@ozyx ozyx self-assigned this Sep 10, 2024
@ozyx
Copy link
Member

ozyx commented Sep 10, 2024

we could also seed our random number generators based on the time. this would just be affecting example telemetry so should not have a huge impact on production environments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants