Skip to content

[UI][Auto] User can update their preferences > Can select login landing page - last visited #411

Description

@yonasberhe23

Failure Details

Framework: Cypress
Suite: User can update their preferences

Failing Environments

Version Environment User
head community @adminUser

Error Summary

Timed out retrying after 10000ms: expected '[RANCHER_URL]' to include '/c/local/explorer/node'

🤖 AI Fix Suggestions

Explanation of Test Failure:

The test is failing because it is expecting the URL to include the path /c/local/explorer/node after selecting the "last visited" landing page preference. However, the URL being returned ([RANCHER_URL]) does not contain the expected path, and the test times out waiting for this condition to be met.

Likely Root Causes:

  1. Landing page preference not being saved correctly: The "last visited" preference might not be persisting due to an issue with the backend or the UI not triggering the save action properly.
  2. Incorrect redirection logic: The application might not be redirecting to the "last visited" page as expected after the preference is set.
  3. Test setup issue: The test might not be navigating to the expected "last visited" page before asserting the URL, or the test might not be simulating the correct user actions.
  4. Environment-specific issue: The [RANCHER_URL] placeholder might indicate a misconfiguration in the test environment, such as an incorrect base URL or missing route.

Suggested Fix:

First, verify the application logic for saving and applying the "last visited" landing page preference. If the logic is correct, adjust the test to ensure it properly sets the preference and waits for the correct redirection.

Here is a concrete code snippet to fix the test:

// Ensure the preference is set before asserting the URL
cy.visit('/preferences'); // Navigate to the preferences page
cy.get('[data-testid="landing-page-select"]').select('Last Visited'); // Select "Last Visited" option
cy.get('[data-testid="save-preferences-button"]').click(); // Save preferences
cy.visit('/'); // Navigate to the base URL to trigger redirection

// Assert that the URL includes the expected path
cy.url().should('include', '/c/local/explorer/node');

Explanation of Fix:

  1. The test explicitly navigates to the preferences page and sets the "Last Visited" option.
  2. It ensures the preferences are saved by clicking the save button.
  3. It navigates back to the base URL to simulate the user starting a new session.
  4. Finally, it asserts that the redirection to the "last visited" page works as expected.

If the issue persists, debug the application logic for saving and applying the "last visited" preference.


Auto-generated by CI Failure Inspector

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions