Skip to content

Conversation

@torchiaf
Copy link
Collaborator

@torchiaf torchiaf commented Nov 25, 2025

Contributes to #71

This covers point 1. of the issue, by adding the e2e tests suite to test the extension in dev mode.

  • Implement mock Agent to replace the real Agent and LLM during tests
  • Implement the UI assistant e2e tests
  • Add commands to control the mock Agent messages - see cy.enqueueAIAgentResponse
  • commit ad16791 is a porting of rancher/dashboard cypress framework, excluding the tests folder.

Signed-off-by: Francesco Torchia <[email protected]>
…Chat PO and commands

Signed-off-by: Francesco Torchia <[email protected]>
@torchiaf torchiaf force-pushed the feature-e2e branch 17 times, most recently from ad1c7b9 to 18d41cd Compare November 26, 2025 15:15
@torchiaf torchiaf marked this pull request as ready for review November 26, 2025 15:27
@torchiaf torchiaf changed the title E2E tests E2E tests - run the tests suite on new PRs Nov 26, 2025
@torchiaf torchiaf requested a review from rak-phillip November 26, 2025 15:34
Signed-off-by: Francesco Torchia <[email protected]>
Copy link
Collaborator

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

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

I think that this looks good. I tried to rule out the imported POs and to focus on functionality. For the future, do we need to consider how we will keep cypress POs & commands in sync with Dashboard?

I'm able to run the tests, but the first fails with the following error:

  Rancher setup
    (Attempt 1 of 3) First login & Configure
    (Attempt 2 of 3) First login & Configure
    1) First login & Configure
cypress-terminal-report: Wrote html logs to /home/phillip/Development/rancher-ai-ui/browser-logs/out.html. (1ms)


  0 passing (4s)
  1 failing

  1) Rancher setup
       First login & Configure:
     CypressError: `cy.type()` cannot accept an empty string. You need to actually type something.

https://on.cypress.io/type
      at Context.type (https://localhost:8005/__cypress/runner/cypress_runner.js:137615:76)
      at wrapped (https://localhost:8005/__cypress/runner/cypress_runner.js:157819:19)
  From Your Spec Code:
      at ./cypress/e2e/po/components/password.po.ts.PasswordPo.set (webpack:///./cypress/e2e/po/components/password.po.ts:35:0)
      at ./cypress/e2e/po/pages/rancher-setup-login.po.ts.RancherSetupLoginPagePo.bootstrapLogin (webpack:///./cypress/e2e/po/pages/rancher-setup-login.po.ts:39:0)
      at Context.eval (webpack:///./cypress/e2e/tests/rancher-setup.spec.ts:17:0)




  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      0                                                                                │
  │ Failing:      1                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  3                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     3 seconds                                                                        │
  │ Spec Ran:     rancher-setup.spec.ts                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

README.md Outdated
Comment on lines 45 to 47
# Launch Cypress dashboard
API=https://your-rancher VUE_APP_AGENT_MESSAGES_WS_PATH=ws://localhost:8000/ws/agent yarn dev
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we're missing a step. This doesn't launch the cypress dashboard, it starts the dev server. I think we need a line for ➤ TEST_PASSWORD=${ rancher-password } yarn e2e.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, thanks.

Signed-off-by: Francesco Torchia <[email protected]>
Signed-off-by: Francesco Torchia <[email protected]>
@torchiaf
Copy link
Collaborator Author

torchiaf commented Nov 27, 2025

For the future, do we need to consider how we will keep cypress POs & commands in sync with Dashboard?

Definetely, this can also be useful for other extensions.
I'll add an additional point to #71, in theory it should be possible to publish the POs and commands as NPM package.

@torchiaf
Copy link
Collaborator Author

torchiaf commented Nov 27, 2025

I'm able to run the tests, but the first fails with the following error:

@rak-phillip TEST_SKIP=setup usage was wrong and not handled in cypress.config.ts.
The rancher-setup.spec.ts is meant to setup the rancher password and accept the Terms&Conditions at first login.
It's now being excluded when you run tests locally with the TEST_SKIP=setup active.

I also added a new e2e to test the sliding badges.

@torchiaf torchiaf force-pushed the feature-e2e branch 2 times, most recently from 92f03a8 to b0d1131 Compare November 27, 2025 11:27
@torchiaf torchiaf mentioned this pull request Nov 27, 2025
4 tasks
@torchiaf torchiaf requested a review from rak-phillip November 27, 2025 12:20
Signed-off-by: Francesco Torchia <[email protected]>
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