Skip to content

Add e2e tests for state restoration in Connect#64769

Merged
ravicious merged 13 commits intomasterfrom
r7s/e2e-connect-state
Mar 20, 2026
Merged

Add e2e tests for state restoration in Connect#64769
ravicious merged 13 commits intomasterfrom
r7s/e2e-connect-state

Conversation

@ravicious
Copy link
Copy Markdown
Member

@ravicious ravicious commented Mar 18, 2026

This PR adds e2e for the state restoration section from Connect's test plan.

I skipped the items:

  • Verify that reopening a cluster that has no workspace assigned works.
    • This requires two clusters.
  • Open a db connection tab. Change the db name and port. Close the tab. Restart the app. Open connection tracker and choose said db connection from it. Verify that the newly opened tab uses the same db name and port.
    • This requires a db agent.

Also, #64758 made it so that usageReporting.enabled is false by default so that the app does not show the modal asking about telemetry on start. I added a separate test to verify that this modal is shown when usageReporting.enabled is not set in the config.

- State restoration from disk
- [ ] Verify that the app asks about restoring previous tabs when launched and restores them
properly.
- [ ] Verify that the app opens with the cluster that was active when you closed the app.
- [ ] Verify that the app remembers size & position after restart.
- Verify that this works on:
- [ ] macOS
- [ ] Windows
- [ ] Linux
- [ ] Verify that [reopening a cluster that has no workspace
assigned](https://github.com/gravitational/webapps.e/issues/275#issuecomment-1131663575) works.
- [ ] Verify that reopening the app after removing `~/Library/Application Support/Teleport Connect/tsh` doesn't crash the app.
- [ ] Verify that reopening the app after removing `~/Library/Application Support/Teleport Connect/app_state.json` but not the `tsh` dir doesn't crash the app.
- [ ] Verify that logging out of a cluster and then logging in to the same cluster doesn't
remember previous tabs (they should be cleared on logout).
- [ ] Open a db connection tab. Change the db name and port. Close the tab. Restart the app. Open
connection tracker and choose said db connection from it. Verify that the newly opened tab uses
the same db name and port.
- [ ] Log in to a cluster. Close the DocumentCluster tab. Open a new DocumentCluster tab. Restart
the app. Verify that the app doesn't ask you about restoring previous tabs.

Manual Test Plan

Test Environment

My laptop.

Test Cases

  • The new tests work.

@ravicious ravicious requested a review from gzdunek March 18, 2026 14:49
@ravicious ravicious added the no-changelog Indicates that a PR does not require a changelog entry label Mar 18, 2026
@github-actions github-actions bot requested review from espadolini and tcsc March 18, 2026 14:49
@ravicious ravicious requested review from avatus and removed request for espadolini and tcsc March 18, 2026 14:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 598fdbea07

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/firstLaunch.spec.ts
@ravicious ravicious force-pushed the r7s/e2e-connect-state branch from 598fdbe to eef4289 Compare March 18, 2026 16:12
@ravicious ravicious force-pushed the r7s/e2e-connect-state branch from eef4289 to d34c41b Compare March 18, 2026 16:20
@ravicious ravicious force-pushed the r7s/e2e-connect-state branch from d34c41b to f443df4 Compare March 18, 2026 16:24
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f443df4a65

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts Outdated
Comment thread e2e/tests/connect/stateRestoration.spec.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0bcd68fb1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts Outdated
Comment thread e2e/tests/connect/stateRestoration.spec.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae98dca226

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6802f346b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/firstLaunch.spec.ts
Comment thread e2e/tests/connect/stateRestoration.spec.ts
@ravicious ravicious requested a review from gzdunek March 19, 2026 15:12
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d82a8da1b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c051c8ad7b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75797519b9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93041be939

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts
Comment thread e2e/tests/connect/stateRestoration.spec.ts
@ravicious ravicious mentioned this pull request Mar 20, 2026
8 tasks
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfa5117391

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread e2e/tests/connect/stateRestoration.spec.ts
@ravicious ravicious enabled auto-merge March 20, 2026 12:02
@ravicious ravicious added this pull request to the merge queue Mar 20, 2026
Merged via the queue into master with commit 57ad0fc Mar 20, 2026
43 checks passed
@ravicious ravicious deleted the r7s/e2e-connect-state branch March 20, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants