- 🛠️ Getting started
- 🧪 Testing
The official OS4ML frontend app.
- 📂 Directory overview
- 🛠️ Getting started
- 🧪 Testing
- 🌍 i18n
├── [+] cypress/ # E2E and Integration tests with Cypress
├── [+] nginx/ # Nginx config for environments
├── [+] src/ # Source code of the app
│ ├── app/ # Angular source code
│ ├── assets/ # Project-related files, no code
│ └── environments/ # Configurations for the environments
├── README.md # Inception
└── ...
The first time you're running the project, you need to run the following command:
npm run generate:modelmanager
You don't need to set up environment variables for running the frontend app.
Create a cypress.env.json
file just in case you need to run the E2E tests, with the following content:
{
"dev": "false",
"TEST_USER": "XXX",
"TEST_PASSWORD": "XXX"
}
Here there's a list of the most relevant scripts:
generate:modelmanager
: Builds the Model Manager API CLI in Typescriptprestart
: Runs thegenerate:modelmanager
commandstart
: Starts the appstart-frontend
: Starts the app with proxy configurationbuild
: Generate the bundle of the apptest
: Execute the unit testslint
: Runs the linterformat
: Runs the linter and the formatterprettier
: Runs the formattere2e:run
: Executes E2E tests in headless modee2e:local
: Executes E2E tests in headless and DEV modecypress:open
: Opens Cypress GUI for executing E2E tests in DEV modecypress:open-test
: Opens Cypress GUI for executing E2E test
Run ng generate component component-name
or the short version (ng g c component-name
) to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page or the new homepage.
These types of tests are currently implemented in this project
- ❌ Unit tests
- ❌ Integration tests
- ✅ E2E tests
- ❌ Visual tests
If you need to implement any kind of tests, we recommend you to take a look to the following guide from Testing library, specially to the #priority section, which explains and justifies which kind of checks you should do on the app, taking into account and prioritizing how users interact with your code.
Currently we are still using the ngx-translate package, but since this is not longer maintained, we will switch to the official angular-localize package.
You find the tranlation files in src/assets/i18n
.