Skip to content

Conversation

@laura-codess
Copy link

Change

This PR sets up the structure for the new E2E UI Testing Framework. The directory is currently structured as follows:

amazonq
└── test
└── e2e_new/amazonq
├── framework
│ ├── chatHelper.ts
│ ├── cleanupHelper.ts
│ ├── generalHelper.ts
│ └── loginHelper.ts
└── chat.test.ts

I took my old "VET.test.ts" files and split them up into the files above.


  • 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 16, 2025 18:17
@laura-codess laura-codess changed the base branch from master to feature/ui-e2e-tests July 16, 2025 18:17
@github-actions
Copy link

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

@laura-codess
Copy link
Author

hmm, it looks like 10 checks didn't fail but were not run at all?

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 on the abstractions. I like how you organized everything.

let webviewView: WebviewView

before(async function () {
webviewView = testContext.webviewView!
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to assert defined here?

Copy link
Author

Choose a reason for hiding this comment

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

sorry, Im a bit confused on what you mean by assert defined?

the testContext is used to keep track of the state that we're in. So we need to grab the webview from testContext because that testContext.webview can be updated depending on what webview we're looking at.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, thanks for the link!

return true
}

/* Waits for a chat response and outputs whether the response is "correct"
Copy link
Contributor

Choose a reason for hiding this comment

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

what is 'correct'? Based on the implementation it looks like its checking for any response.

Copy link
Author

Choose a reason for hiding this comment

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

yes, we are just checking for any response. Since I cant actually read the content of the response, i just check if a response exists. is there a different way you recommend doing this?

): Promise<WebElement | WebElement[]> {
const driver = webview.getDriver()
await driver.wait(until.elementsLocated(locator), timeout)
return multiple ? await webview.findWebElements(locator) : await webview.findWebElement(locator)
Copy link
Contributor

Choose a reason for hiding this comment

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

if multiple is false, which element does it pick? What gives one element higher priority over another?

Copy link
Author

Choose a reason for hiding this comment

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

if multiple is false, it will just pick the first element it finds. my goal for the waitForElement function when multiple is false when the writer knows that there is a single element (ie. a button) but the function is flexible enough that it can also be used to find multiple elements (ie. a menu list)

Copy link
Contributor

Choose a reason for hiding this comment

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

not blocking, but I am also curious what might make something the 'first' element it finds. For example, does it mean it appears first the in the raw html? If so, do we know what determines that?

@Hweinstock
Copy link
Contributor

hmm, it looks like 10 checks didn't fail but were not run at all?

Ah yeah I believe this because of the merge conflicts. You'll have to rebase onto the target branch. When Github can't merge in the changes its not able to run some of the GitHub actions so it stays pending forever. (bad UI if you ask me).

```
5. **Ensure Auto-login Happens Early** (`packages/amazonq/src/lsp/activation.ts`):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you meant to modify this file? Might have to explicitly exclude it from PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

If its happening on pre-commit hook, you can use -n to bypass that.

let webviewView: WebviewView

before(async function () {
webviewView = testContext.webviewView!
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, thanks for the link!

): Promise<WebElement | WebElement[]> {
const driver = webview.getDriver()
await driver.wait(until.elementsLocated(locator), timeout)
return multiple ? await webview.findWebElements(locator) : await webview.findWebElement(locator)
Copy link
Contributor

Choose a reason for hiding this comment

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

not blocking, but I am also curious what might make something the 'first' element it finds. For example, does it mean it appears first the in the raw html? If so, do we know what determines that?

@laura-codess laura-codess deleted the initializing_framework branch July 23, 2025 14:43
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.

3 participants