Skip to content

Conversation

@surajrdy-aws
Copy link

Problem

The AWS Toolkit repository lacks documentation for the UI testing commands (test:ui:prepare, test:ui:install, test:ui:run, test:ui) and the new e2e_new testing suite. Contributors need clear guidance on how to run UI tests and understand the testing framework structure.

Solution

Added comprehensive UI testing documentation covering:

  • Command usage and workflow for the complete UI test suite

  • Directory structure and organization of the e2e_new testing framework

  • Guidelines for writing new UI tests with example code

  • Troubleshooting common issues and debug techniques

  • Prerequisites and setup requirements


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@surajrdy-aws surajrdy-aws requested a review from a team as a code owner July 24, 2025 16:29
@laura-codess
Copy link

LGTM

Copy link
Contributor

@Hweinstock Hweinstock left a comment

Choose a reason for hiding this comment

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

Great start on the docs! Very clear instructions. Left a few small comments.

docs/TESTPLAN.md Outdated
- Do not use mocks.
- E2E Tests: **slow** tests
- Live in `src/testE2E`
- Live in `packages/amazonq/test/e2e_new`
Copy link
Contributor

Choose a reason for hiding this comment

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

wow these docs are outdated, it doesn't even reference the separate packages.

Also, I think there might be a few tests in the old directory that are still active. For example https://github.com/aws/aws-toolkit-vscode/tree/master/packages/amazonq/test/e2e/lsp, won't be replaced with UI tests AFAIK.

docs/TESTPLAN.md Outdated
- Live in `packages/amazonq/test/e2e_new`
- These tests are heavier than Integration tests.
- Some E2E tests have a more complicated architecture, described in [TEST_E2E](./TEST_E2E.md)
- Some E2E tests have a more complicated architecture, described in [UI_E2E_Test](./UI_E2E_Test.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to distinguish between e2e and e2e ui tests? We may want to write e2e tests for things like the language server, but not rely on UI tests.

Copy link
Author

Choose a reason for hiding this comment

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

Good point

- Compiles test files with `npm run testCompile`
- Runs tests matching `packages/amazonq/dist/test/e2e_new/amazonq/tests/*.js`

#### Directory Structure
Copy link
Contributor

Choose a reason for hiding this comment

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

I would honestly remove this because its tedious to update as the code evolves.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good, thanks for pointing it out

3. Use helpers from `../helpers/`
4. Follow existing patterns for setup/cleanup

#### Example Test Structure
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, this is super helpful.

@@ -0,0 +1,134 @@
## UI Testing
Copy link
Contributor

Choose a reason for hiding this comment

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

is it worth mentioning the manual auth details?


#### Authentication

Currently, authentication is not configured to be automatically logged into AmazonQ due to issues with Authentication credentials and the VET setup running in a new VSCode instance through a packaged VSIX. To bypass this for now (as of July 24th, 2025), you must click the approve/open button that redirects you to a browser in order for tests to be run in an authenticated environment at the start of a new.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this more concise? Maybe just drop due to issues with Authentication credentials and the VET setup running in a new VSCode instance through a packaged VSIX?


1. Create test files in `packages/amazonq/test/e2e_new/amazonq/tests/`
2. Import utilities from `../utils/`
3. Use helpers from `../helpers/`
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention about add helpers to .... also. Tell them how to extend the package in future.


### Individual Commands

#### `test:ui:prepare`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also mention why would we need this?

npm run test:ui:prepare
```

#### `test:ui:install`
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this too.


Note: All of these commands must be run at the root level aws-toolkit-vscode directory.

### Individual Commands
Copy link
Contributor

Choose a reason for hiding this comment

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

need some context regarding why are these commands here in the first place.

@abhraina-aws abhraina-aws enabled auto-merge (squash) July 29, 2025 17:00
@abhraina-aws abhraina-aws disabled auto-merge July 29, 2025 17:00
@laileni-aws
Copy link
Contributor

/retryBuilds

@abhraina-aws abhraina-aws merged commit 9c5f854 into aws:feature/ui-e2e-tests Jul 29, 2025
22 checks passed
laura-codess pushed a commit to laura-codess/aws-toolkit-vscode that referenced this pull request Aug 10, 2025
…sts w/ vscode-extension-tester (aws#7750)

## Problem
The AWS Toolkit repository lacks documentation for the UI testing
commands (test:ui:prepare, test:ui:install, test:ui:run, test:ui) and
the new e2e_new testing suite. Contributors need clear guidance on how
to run UI tests and understand the testing framework structure.

## Solution
Added comprehensive UI testing documentation covering:

- Command usage and workflow for the complete UI test suite

- Directory structure and organization of the e2e_new testing framework

- Guidelines for writing new UI tests with example code

- Troubleshooting common issues and debug techniques

- Prerequisites and setup requirements

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
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.

5 participants