Skip to content

Commit b020364

Browse files
committed
editting the actions
1 parent ff60989 commit b020364

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

.github/workflows/node.js.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,24 @@ jobs:
214214
verbose: true
215215
file: ./coverage/${{ matrix.package }}/lcov.info
216216
token: ${{ secrets.CODECOV_TOKEN }}
217+
218+
e2e:
219+
needs: lint-commits
220+
name: test E2E
221+
runs-on: ubuntu-latest
222+
strategy:
223+
matrix:
224+
node-version: [18.x]
225+
env:
226+
NODE_OPTIONS: '--max-old-space-size=8192'
227+
steps:
228+
- uses: actions/checkout@v4
229+
- name: Use Node.js ${{ matrix.node-version }}
230+
uses: actions/setup-node@v4
231+
with:
232+
node-version: ${{ matrix.node-version }}
233+
- run: npm ci
234+
- name: E2E Tests
235+
uses: coactions/setup-xvfb@v1
236+
with:
237+
run: npm run test:ui

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/*.test.js 2>&1 | tee packages/amazonq/test/e2e_new/amazonq/logs/ui_e2e_testlog_$(date +%Y%m%d_%H%M%S).log",
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",

packages/amazonq/test/e2e_new/amazonq/utils/authUtils.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
import { Workbench, By, WebviewView } from 'vscode-extension-tester'
6-
import { findItemByText, sleep, waitForElements } from './generalUtils'
5+
import { Workbench, By, WebviewView, ModalDialog } from 'vscode-extension-tester'
6+
import { findItemByText, printElementHTML, sleep, waitForElements } from './generalUtils'
77
import { testContext } from './testContext'
8+
import { until } from 'selenium-webdriver'
89

910
/* Completes the entire Amazon Q login flow
1011
@@ -43,6 +44,15 @@ export async function signInToAmazonQ(): Promise<void> {
4344
await UrlContinue.click()
4445

4546
console.log('Waiting for manual authentication...')
47+
await webviewView.switchBack()
48+
await sleep(5000)
49+
const driver = workbench.getDriver()
50+
const body = await driver.findElement(By.css('body'))
51+
await printElementHTML(body)
52+
const modalWnd = By.className('monaco-dialog-box')
53+
await driver.wait(until.elementLocated(modalWnd), 10_000)
54+
const dialog = new ModalDialog()
55+
await dialog.pushButton('Open')
4656
await sleep(12000)
4757
console.log('Manual authentication should be done')
4858
await webviewView.switchBack()

0 commit comments

Comments
 (0)