Skip to content

Conversation

@laura-codess
Copy link

@laura-codess laura-codess commented Jul 2, 2025

Changes

This is the initial commit for UI Tests using the framework vscode-extension-tester. It instantiates the VSCode instance which opens Amazon Q and goes through some basic flows to login. This is done using the VSCode-Extension-Tester Framework. (Note: It is missing full authentication and stops working once Amazon Q needs to open the browser).

To run these tests

Please follow the steps outlined in this document:
Setup Instruction for Amazon Q

For information why each dependency / webpack change is needed, please see here.

Demo Video:

UI.Tests.Screen.Recording.mov

  • 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.

@laura-codess laura-codess requested a review from a team as a code owner July 2, 2025 18:50
@github-actions
Copy link

github-actions bot commented Jul 2, 2025

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

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.

Nice start!

"@types/node": "^22.7.5",
"jaro-winkler": "^0.2.8",
"buffer": "^6.0.3",
"mocha": "^11.7.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think most of these can be dev-dependencies. Also same comment as above.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think mocha should already be getting pulled in (

"mocha": "^10.1.0",
). buffer might be able to be a devDependency but we can look into this as a follow up.

@Hweinstock
Copy link
Contributor

looks like the buffer dependency was needed:

ERROR in ../../node_modules/buffer-xor/index.js 3:19-25
  Module not found: Error: Can't resolve 'buffer' in '/codebuild/output/src1044368460/src/github.com/aws/aws-toolkit-vscode/node_modules/buffer-xor'

…as webpack.NormalModuleReplacementPlugin that needed to be there in order for the amazonq to compile
"vscode-nls": "^5.2.0",
"vscode-nls-dev": "^4.0.4"
},
"engines": {
Copy link
Contributor

Choose a reason for hiding this comment

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

curious as to what these actually do, might be worth calling out in PR description with maybe a link to VET docs explaining?

@Hweinstock
Copy link
Contributor

Hweinstock commented Jul 3, 2025

I think after removing that try-catch, adding some doc links, and updating the PR description for how to run + what to expect, this looks good to me as a start. We should create tracking issues for:

  • investigate the webpack and dependencies changes to understand why they are needed. We can't be making changes here we don't understand when trying to merge code to the mainline.
  • investigate timeout requirements. I suspect someone has solved this problem so might just require some research of finding someone else's solution rather than somewhat arbitrary timeouts between actions.

These PR descriptions can eventually serve a "work-log" for the project so I think its important to make them solid now while we have context.

@laura-codess
Copy link
Author

It looks like 2 tests are failing even after the webpack addition, but the code has no trouble compiling. My initial commit passed all the checks so I'm going to try adding back some lines to see what was necessary. I'll add all of that information in the PR and work on writing a doc about why each dependency / webpack change is needed.

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.

Nice!

@Hweinstock Hweinstock merged commit d374531 into aws:feature/ui-e2e-tests Jul 8, 2025
22 checks passed
surajrdy-aws pushed a commit to surajrdy-aws/aws-toolkit-vscode that referenced this pull request Jul 15, 2025
## Changes
This is the initial commit for UI Tests using the framework
vscode-extension-tester. It instantiates the VSCode instance which opens
Amazon Q and goes through some basic flows to login. This is done using
the [VSCode-Extension-Tester
Framework](https://github.com/redhat-developer/vscode-extension-tester/wiki/).
(Note: It is missing full authentication and stops working once Amazon Q
needs to open the browser).

**To run this test**

1. First compile the test files
`npm run testCompile`
2. Then run the test setup
`node_modules/.bin/extest setup-tests`
2. Then run the script (NOTE: this js file should be generated when you
compile the test files)
`node_modules/.bin/extest run-tests
aws-toolkit-vscode/packages/amazonq/dist/test/e2e/amazonq/VET.test.js`

For information why each dependency / webpack change is needed, please
see
[here](https://quip-amazon.com/lCuBAOGibHzm/UI-Tests-PR-Explanation).

Demo Video:


https://github.com/user-attachments/assets/f1c6e59f-d4e3-4ae0-a164-1da389ec1339




---

- 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.
laura-codess added a commit to laura-codess/aws-toolkit-vscode that referenced this pull request Aug 10, 2025
This is the initial commit for UI Tests using the framework
vscode-extension-tester. It instantiates the VSCode instance which opens
Amazon Q and goes through some basic flows to login. This is done using
the [VSCode-Extension-Tester
Framework](https://github.com/redhat-developer/vscode-extension-tester/wiki/).
(Note: It is missing full authentication and stops working once Amazon Q
needs to open the browser).

**To run this test**

1. First compile the test files
`npm run testCompile`
2. Then run the test setup
`node_modules/.bin/extest setup-tests`
2. Then run the script (NOTE: this js file should be generated when you
compile the test files)
`node_modules/.bin/extest run-tests
aws-toolkit-vscode/packages/amazonq/dist/test/e2e/amazonq/VET.test.js`

For information why each dependency / webpack change is needed, please
see
[here](https://quip-amazon.com/lCuBAOGibHzm/UI-Tests-PR-Explanation).

Demo Video:

https://github.com/user-attachments/assets/f1c6e59f-d4e3-4ae0-a164-1da389ec1339

---

- 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.
laura-codess added a commit to laura-codess/aws-toolkit-vscode that referenced this pull request Aug 11, 2025
This is the initial commit for UI Tests using the framework
vscode-extension-tester. It instantiates the VSCode instance which opens
Amazon Q and goes through some basic flows to login. This is done using
the [VSCode-Extension-Tester
Framework](https://github.com/redhat-developer/vscode-extension-tester/wiki/).
(Note: It is missing full authentication and stops working once Amazon Q
needs to open the browser).

**To run this test**

1. First compile the test files
`npm run testCompile`
2. Then run the test setup
`node_modules/.bin/extest setup-tests`
2. Then run the script (NOTE: this js file should be generated when you
compile the test files)
`node_modules/.bin/extest run-tests
aws-toolkit-vscode/packages/amazonq/dist/test/e2e/amazonq/VET.test.js`

For information why each dependency / webpack change is needed, please
see
[here](https://quip-amazon.com/lCuBAOGibHzm/UI-Tests-PR-Explanation).

Demo Video:

https://github.com/user-attachments/assets/f1c6e59f-d4e3-4ae0-a164-1da389ec1339

---

- 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.

2 participants