Skip to content
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

Copilot Chat: Scenario Tests #1376

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add service initialization
  • Loading branch information
TaoChenOSU committed Jun 8, 2023
commit 2520883a45b5560511065a6cf6ba6dc266896a47
14 changes: 13 additions & 1 deletion .github/workflows/copilot-chat-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,28 @@ jobs:
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup .NET
TaoChenOSU marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: yarn install
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Update AIService configuration
working-directory: samples/apps/copilot-chat-app/webapi
run: |
dotnet user-secrets set "AIService:Key" ${{ secrets.AZUREOPENAI__APIKEY }}
dotnet user-secrets set "AIService:Endpoint" ${{ secrets.AZUREOPENAI__ENDPOINT }}
- name: Start service in background
working-directory: samples/apps/copilot-chat-app/webapi
run: dotnet run &
- name: Run Playwright tests
env:
REACT_APP_BACKEND_URI: https://localhost:40443/
Expand Down
62 changes: 62 additions & 0 deletions samples/apps/copilot-chat-app/webapp/playwright-report/index.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions samples/apps/copilot-chat-app/webapp/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ export default defineConfig({
command: 'yarn start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
});
6 changes: 3 additions & 3 deletions samples/apps/copilot-chat-app/webapp/tests/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('login required', async ({ page }) => {
test('login successful', async ({ page }) => {
// Skip this test if the environment variable is not set.
if (!process.env.TEST_USER_ACCOUNT || !process.env.TEST_USER_PASSWORD) {
return;
test.skip();
}

await page.goto('/');
Expand All @@ -21,10 +21,10 @@ test('login successful', async ({ page }) => {
await expect(page).toHaveURL(new RegExp('^' + process.env.REACT_APP_AAD_AUTHORITY));
// Login with the test user.
await page.getByPlaceholder('Email, phone, or Skype').click();
await page.getByPlaceholder('Email, phone, or Skype').fill(process.env.TEST_USER_ACCOUNT);
await page.getByPlaceholder('Email, phone, or Skype').fill(process.env.TEST_USER_ACCOUNT as string);
await page.getByRole('button', { name: 'Next' }).click();
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.TEST_USER_PASSWORD);
await page.getByPlaceholder('Password').fill(process.env.TEST_USER_PASSWORD as string);
await page.getByRole('button', { name: 'Sign in' }).click();

// Select No if asked to stay signed in.
Expand Down