Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
38 changes: 29 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,46 @@ jobs:
defaults:
run:
working-directory: AdminPortal
env:
# Integration tests run against a real Chrome in headless mode.
CHROME_BIN: /usr/bin/google-chrome
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: '20'
cache: npm
cache-dependency-path: AdminPortal/package-lock.json

- name: Install dependencies
run: npm ci

- name: Production build
run: npx ng build

# The Angular 4 karma/Jasmine specs are legacy scaffolding and are not yet
# a hard gate; the suite is run for visibility and will become blocking as
# part of the Phase 7 frontend upgrade. See PR description for details.
- name: Unit tests (Karma/Jasmine)
continue-on-error: true
run: npx ng test --single-run --browsers ChromeHeadlessCI
run: npx ng test --watch=false --browsers=ChromeHeadlessCI

e2e:
name: AdminPortal (Angular) e2e (Playwright)
runs-on: ubuntu-latest
defaults:
run:
working-directory: AdminPortal
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: AdminPortal/package-lock.json

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Run Playwright smoke tests
run: npx playwright test
57 changes: 0 additions & 57 deletions AdminPortal/.angular-cli.json

This file was deleted.

13 changes: 10 additions & 3 deletions AdminPortal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
/dist
/tmp
/out-tsc
/bazel-out

# Angular cache
/.angular/cache
.angular/

# dependencies
/node_modules
Expand Down Expand Up @@ -33,9 +38,11 @@ npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map
# e2e (Playwright)
/playwright-report
/test-results
/blob-report
/playwright/.cache

# System Files
.DS_Store
Expand Down
102 changes: 102 additions & 0 deletions AdminPortal/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "npm"
},
"newProjectRoot": "projects",
"projects": {
"admin-portal": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/admin-portal",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "admin-portal:build:production"
},
"development": {
"buildTarget": "admin-portal:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
}
}
14 changes: 0 additions & 14 deletions AdminPortal/e2e/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions AdminPortal/e2e/app.po.ts

This file was deleted.

13 changes: 13 additions & 0 deletions AdminPortal/e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test, expect } from '@playwright/test';

/**
* Smoke test: the SPA boots and the default route redirects to the login page.
* No backend is required — this exercises routing and rendering only.
*/
test('redirects to the login page and renders the login form', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveURL(/\/login$/);
await expect(page.getByRole('heading', { name: 'Please login' })).toBeVisible();
await expect(page.getByPlaceholder('Username')).toBeVisible();
await expect(page.getByPlaceholder('Password')).toBeVisible();
});
12 changes: 0 additions & 12 deletions AdminPortal/e2e/tsconfig.e2e.json

This file was deleted.

36 changes: 17 additions & 19 deletions AdminPortal/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
// https://karma-runner.github.io/6.4/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
client: {
jasmine: {},
clearContext: false,
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
jasmineHtmlReporter: {
suppressAll: true,
},
angularCli: {
environment: 'dev'
coverageReporter: {
dir: require('path').join(__dirname, './coverage/admin-portal'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'Chrome',
flags: ['--headless=new', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage']
}
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
},
},
singleRun: false
restartOnFileChange: true,
});
};
Loading
Loading