Skip to content

Commit 7c86b73

Browse files
surajrdy-awslaura-codess
authored andcommitted
fix(amazonq): Inline test after function addition, writeToTextEditor fix, and package.json pathing fix (#7800)
## Problem The inline test cannot be run consecutively with other tests in our suite since it switches its focus to the editorView and textEditorView. Each time the inline test is run, a new driver was launched with caused a new VSCode instance to instantiate. The `package.json` should only target the `.test.js` files. Right now it targets all .js files in the directory. The `writeToTextEditor` function is faulty since it is wrongly indexed due to its element not being accessed before counting and referencing its indices within code. ## Solution Implemented an `after` function which correctly switches back to our webviewView (AmazonQ). Added the true inline test into the suite and fixed driver problem. Changed the path referenced in the `package.json` to `.test.js` files. Fixed the `writeToTextEditor` function such that it includes a "dummy" space input into the textEditor and then counts the number of indices of lines. This then writes the desired text within the correct line without problems. --- - 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.
1 parent 0810e78 commit 7c86b73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"testE2E": "npm run testE2E -w packages/ --if-present",
3131
"test:ui:prepare": "./node_modules/.bin/extest get-vscode -s ~/.vscode-test-resources -n && extest get-chromedriver -s ~/.vscode-test-resources -n",
3232
"test:ui:install": "cd packages/amazonq && npm run package 2>&1 | grep -o 'VSIX Version: [^ ]*' | cut -d' ' -f3 | xargs -I{} bash -c 'cd ../../ && ./node_modules/.bin/extest install-vsix -f amazon-q-vscode-{}.vsix -e packages/amazonq/test/e2e_new/amazonq/resources -s ~/.vscode-test-resources'",
33-
"test:ui:run": "npm run testCompile && ./node_modules/.bin/extest run-tests -s ~/.vscode-test-resources -e packages/amazonq/test/e2e_new/amazonq/resources packages/amazonq/dist/test/e2e_new/amazonq/tests/*.js",
33+
"test:ui:run": "npm run testCompile && ./node_modules/.bin/extest run-tests -s ~/.vscode-test-resources -e packages/amazonq/test/e2e_new/amazonq/resources packages/amazonq/dist/test/e2e_new/amazonq/tests/*.test.js",
3434
"test:ui": "npm run test:ui:prepare && npm run test:ui:install && npm run test:ui:run",
3535
"testInteg": "npm run testInteg -w packages/ --if-present",
3636
"package": "npm run package -w packages/toolkit -w packages/amazonq",

0 commit comments

Comments
 (0)