Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

900 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Technical Debt Duplicated Lines (%)

Odds Worklog

API

Swagger

Test trgger

This project was generated with Angular CLI version 6.2.3.

Docker build and run production

Build docker build -t odds-worklog:prod .

Run docker run --name web-odds-worklog -p 80:80 odds-workslog:prod

Navigate to http://localhost

Docker run from image

Login docker login registry.odds.team

Run docker run --name web-odds-worklog -p 80:80 --rm registry.odds.team/worklog/web.odds-worklog:prod

Development server

Set node version

Node version v18.16.0

refs:

  • FROM trion/ng-cli-e2e:15.2.7 in Dockerfile.
  • ngular-cli=15.2.7 node=18.16.0 in trion/ng-cli-e2e:15.2.7
  • engines in package.json

Install node modules

Since our Angular is very old, we need to install with --legacy-peer-deps

npm i --legacy-peer-deps

Run ng serve for a dev server that connects the app to the API on https://worklog-dev.odds.team/.

If you want to connect the app to the API on http://localhost:8080, use the following command:

ng serve --configuration local

Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Alternatively, you can run the command below as well. This will run the ng in the node_modules/.bin folder.

npm run ng serve -- --configuration local

Note: The -- separator means we want to pass the params to the script via the npm command.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

To execute the unit tests via Karma,

make test

If you get an error and want to use your Chrome instead of puppeteer's Chrome

CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" npm t

Running end-to-end tests

E2E tests use Cucumber.js with Playwright.

Prerequisites

  1. Docker services running (MongoDB, Keycloak, Backend API) via docker compose -f api.odds-worklog/deployment/local/docker-compose.yaml up -d
  2. Frontend dev server running on http://localhost:4200 (make run)
  3. Playwright browsers installed: cd e2e/cucumber && npx playwright install

Run tests

make e2e

To run a specific scenario by tag:

make e2e ARGS="--tags @admin-login"

E2E test users

Users are defined in api.odds-worklog/realm-export.json (Keycloak).

Username Password Purpose
e2e s3cr3t Individual user tests (registration, add/edit/get income)
e2e-admin s3cr3t Admin tests (export income)

The admin role is set directly in MongoDB during the test, not through Keycloak or the registration UI.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

12 watching

Forks

Releases

Packages

Contributors

Languages