-
Notifications
You must be signed in to change notification settings - Fork 746
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
feat(amazonq): Initializing E2E UI Testing Framework #7685
Conversation
…as webpack.NormalModuleReplacementPlugin that needed to be there in order for the amazonq to compile
…he checks. have to commit to check since the build compiles with no errors
…e tests are done running
…lkit-vscode into feature/ui-e2e-tests
|
|
hmm, it looks like 10 checks didn't fail but were not run at all? |
Hweinstock
left a comment
There was a problem hiding this 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! |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
he's asking why did you use this https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
packages/amazonq/test/e2e_new/amazonq/framework/cleanupHelper.ts
Outdated
Show resolved
Hide resolved
| ): Promise<WebElement | WebElement[]> { | ||
| const driver = webview.getDriver() | ||
| await driver.wait(until.elementsLocated(locator), timeout) | ||
| return multiple ? await webview.findWebElements(locator) : await webview.findWebElement(locator) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
packages/amazonq/test/e2e_new/amazonq/framework/generalHelper.ts
Outdated
Show resolved
Hide resolved
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`): | ||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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! |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
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.
feature/xbranches will not be squash-merged at release time.