git clone [email protected]:lagomus/lec-automation.git # Or equivalent with HTTPS URL
npm install
npm test
# Test the API
npm run test:api
# Test the Admin App
npm run test:admin
# Test the Store App
npm run test:store
Automation configuration is done via environment variables, that can be also set in a file .env located at the root of the project.
HEADLESS_BROWSER, optional. Flag to indicate if should use a headless browser in UI tests. If true, don't shows the execution of test in a new browser instance.
Possibles values: false, true.
Default value: false
Default behavior, (if not present or exists): Open an execute the test in a new browser instance.
Usage: Admin, Storefront.
STORE_HOST, required. The base URL of the Store app.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Store tests fails.
Usage: Storefront.
STORE_USER, required. Username of customer to login and get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Store tests fails.
Usage: Storefront.
STORE_PASSWORD, required. Password of customer to login and get auth credentials.
Possibles values*: string.
Default value: none.
Default behavior, (if not present or exists): Store tests fails.
Usage: Storefront.
ADMIN_HOST, required. The base URL of the Admin app.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Admin tests fails.
Usage: Admin.
ADMIN_USER, required. Username of operator to login and get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Admin tests fails.
Usage: Admin.
ADMIN_PASSWORD, required. Password of operator to login and get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Admin tests fails.
Usage: Admin.
ADMIN_USER_MULTI, required. Username of operator to perform multitenant login test.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Admin tests fails.
Usage: Admin.
ADMIN_PASSWORD_MULTI, required. Password of operator to perform multitenant login test
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Admin tests fails.
Usage: Admin.
API_HOST, required. The base URL of the API services.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails, connection refused error.
Usage: Api.
TENANT_ID, required. The id of the company where the tests will be run.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails with code 401.
Usage: General.
OPERATOR_ACCESS_TOKEN_URL, required. The base URL of the authorization service for operators.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: General.
CUSTOMER_ACCESS_TOKEN_URL, required. The base URL of the authorization service for customers.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: General.
GUEST_ACCESS_TOKEN_URL, required. The base URL of the authorization service for guests.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: General.
ADMIN_AUTH_COOKIE_NAME, required. Name of cookie created when login.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: Admin.
ADMIN_AUTH_REFRESH_COOKIE_NAME, required. Name of refresh cookie created when login.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: Admin.
STORE_AUTH_COOKIE_NAME, required. Name of cookie created when login.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: Storefront.
STORE_AUTH_REFRESH_COOKIE_NAME, required. Name of refresh cookie created when login.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Tests fails throwing error.
Usage: Storefront.
CUSTOMER_USER, required. Username of customer to get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Api tests fails with code 422.
Usage: Storefront.
CUSTOMER_PASSWORD, required. Password of customer to get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Api tests fails with code 422.
Usage: Storefront.
OPERATOR_USER, required. Username of operator to get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Api tests fails with code 422.
Usage: Storefront.
OPERATOR_PASSWORD, required. Password of operator to get auth credentials.
Possibles values: string.
Default value: none.
Default behavior, (if not present or exists): Api tests fails with code 422.
Usage: Storefront.
General
HEADLESS_BROWSER=false
TENANT_ID=d4b1a55b-7e08-4896-b295-b63d4e16854d
Admin
ADMIN_HOST=http://localhost:3000
ADMIN_USER=op1shop1
ADMIN_PASSWORD=op1shop1
ADMIN_USER_MULTI=op1shop2
ADMIN_PASSWORD_MULTI=op1shop2
Store
STORE_HOST=http://localhost:3000
STORE_USER=cu1shop1
STORE_PASSWORD=cu1shop1
STORE_CLIENT_ID=storefront
API
API_HOST=https://core.dev.streto.io/
USER_TYPE=operator
Users credentials
ROOT_USERNAME=root
ROOT_PASSWORD=root
OPERATOR_USERNAME=op1shop1
OPERATOR_PASSWORD=op1shop1
CUSTOMER_USERNAME=cu1shop1
CUSTOMER_PASSWORD=cu1shop1
Auth Token URLs
OPERATOR_ACCESS_TOKEN_URL=https://core.dev.streto.io/auth/operator/signin
CUSTOMER_ACCESS_TOKEN_URL=https://core.dev.streto.io/auth/customer/signin
GUEST_ACCESS_TOKEN_URL=https://core.dev.streto.io/auth/guest/signin
ADMIN_AUTH_COOKIE_NAME=auth_token
ADMIN_AUTH_REFRESH_COOKIE_NAME=auth_refresh_token
STORE_AUTH_COOKIE_NAME=auth_token.user
STORE_AUTH_REFRESH_COOKIE_NAME=auth_refresh_token.user
For more details to develop Automation tests check this documents: