Skip to content

Commit

Permalink
Merge branch 'feat/chat-monorepo' of github.com:epam/ai-dial-chat int…
Browse files Browse the repository at this point in the history
…o feat/chat-monorepo
  • Loading branch information
mikitabut committed Jan 30, 2024
2 parents 652c16f + 5eb21b7 commit 04605c6
Show file tree
Hide file tree
Showing 7 changed files with 1,182 additions and 216 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pnpm-lock.yaml
# e2e
/apps/chat-e2e/test-results/
/apps/chat-e2e/allure-results/
e2e
/apps/chat-e2e/auth/
/apps/chat-e2e/html-report/
/apps/chat-e2e/src/testData/export/
Expand Down
9 changes: 7 additions & 2 deletions apps/chat-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ When run tests on CI, `E2E_USERNAME` and `E2E_PASSWORD` CI variable should be se
## Run tests locally

Run `nx e2e chat-e2e` to execute the tests locally.
Installation of default browsers may be required, when run for the 1st time: `npx playwright install`.
Installation of default browsers may be required, when run for the 1st time.

Local version of application is automatically started before execution the tests on `http://localhost:3000`.
Config file used for local run is `local.playwright.config.ts`.
Expand All @@ -20,6 +20,10 @@ After tests execution finished, 2 kind of reports are generated: html, allure.

Before generating Allure report, install it on your local machine following the guide: https://docs.qameta.io/allure/#_get_started.

To open html report, run the command `npx playwright show-report apps\chat-e2e\html-report`.

Allure report is opened in default browser using `allure serve apps/chat-e2e/allure-results`.

Every test inside local report contains video recording and trace attached.

If need to execute tests inside docker container run:
Expand Down Expand Up @@ -53,11 +57,12 @@ CI report includes screenshots for failed tests.

## Environment variables

The following variables should be placed inside `chat-e2e/.env.local` file in order to run tests locally

| Variable | Required | Description | Available Values | Default values |
| -------------- | -------- | ------------------------------------ | ---------------- | -------------- |
| `E2E_HOST` | No | The host URL for end-to-end testing. | Any string | |
| `E2E_USERNAME` | No | A username for e2e authentification | Any string | |
| `E2E_PASSWORD` | No | A password for e2e authentification | Any string | |
| `TRACES_URL` | No | Traces URL | Any string | |
| `TMS_URL` | No | TMS URL | Any string | |
| `ISSUE_URL` | No | Issue URL | Any string | |
5 changes: 4 additions & 1 deletion apps/chat-e2e/config/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default defineConfig({
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['list'],
['allure-playwright', { detail: true, outputFolder: 'e2e/allure-results' }],
[
'allure-playwright',
{ detail: true, outputFolder: 'apps/chat-e2e/allure-results' },
],
],
outputDir: '../test-results',
timeout: 60000,
Expand Down
2 changes: 1 addition & 1 deletion apps/chat-e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"next-env.d.ts",
"postcss.config.js",
],
"exclude": ["node_modules", "src/**/*.spec.ts", "src/**/*.test.ts"],
"exclude": ["node_modules", "src/**/*.spec.ts"],
}
4 changes: 2 additions & 2 deletions apps/chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This project leverages environment variables for configuration.
**Note: for development we have some predefined variables located in `.env.development`**

| Variable | Required | Description | Available Values | Default values |
| ----------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------ |
|-------------------------------------|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|--------------------|
| `DIAL_API_HOST` | Yes | Dial API Host | Any string | |
| `DIAL_API_KEY` | Yes | Dial API Key | Any string | |
| `DIAL_API_VERSION` | No | Dial API Version | Any string | 2023-03-15-preview |
Expand All @@ -127,7 +127,7 @@ This project leverages environment variables for configuration.
| `SHOW_TOKEN_SUB` | No | Show token sub in refresh login error logs | `true`, `false` | false |
| `STORAGE_TYPE` | No | Type of storage used for getting and saving information generated by user. Now supported only `browserStorage` | `browserStorage`, `api`,`apiMock` | `browserStorage` |
| `KEEP_ALIVE_TIMEOUT` | No | Determines the maximum time in milliseconds in seconds that a connection may be idle before it is closed by the server. This is needed because infrastructure usually have default keep alive timeout 60 seconds and next server should have bigger value. Used only when running dockerfile. | Any number string | 61000 |

| `TRACES_URL` | No | Traces URL | Any string | |
The .env file contains environment variables that can be used to configure your app's settings and behavior. These values can be changed as needed to suit your specific requirements.

Also we have a lot of auth specific env variables:
Expand Down
Loading

0 comments on commit 04605c6

Please sign in to comment.