Skip to content

feat(amazonq): Initializing E2E UI Testing Framework #7685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: feature/ui-e2e-tests
Choose a base branch
from

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

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)

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

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