Skip to content
Snippets Groups Projects
Commit 90d9d7ea authored by Danial Hezarkhani's avatar Danial Hezarkhani
Browse files

added puppeteer for testing

parent d0063214
No related branches found
No related tags found
1 merge request!1Features/initial setup
stages:
- pre-build
- build
- test
- deploy
default:
image: node:18
variables:
pre-build:
stage: pre-build
script:
- rm -rf node_modules/
build-ui-service:
stage: build
script:
- npm ci
- npm run build
- npm prune --omit=dev
when: always
artifacts:
expire_in: 1 hour
paths:
- dist/
- node_modules/
run-unittest:
stage: test
allow_failure: true
script:
- apt-get update
- apt-get install -y chromium
- npm install
- npm run test --coverage
artifacts:
expire_in: 1 hour
when: always
paths:
- coverage/
deploy:
stage: deploy
only:
- master
- /^dev.*$/
- /^stage.*$/
script:
- running
dependencies:
- build-ui-service
when: manual
\ No newline at end of file
......@@ -95,7 +95,8 @@
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [],
"karmaConfig": "karma.conf.js"
}
}
}
......
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = '/usr/bin/chromium-browser'; // Update the path as needed
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/graphene-ui'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
browsers: ['Puppeteer'],
customLaunchers: {
Puppeteer: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox', // Use this flag in Linux environments
'--disable-setuid-sandbox', // Use this flag in Linux environments
],
},
},
restartOnFileChange: true
});
};
This diff is collapsed.
{
"name": "graphene-ui",
"version": "0.0.0",
"version": "0.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
"test": "ng test",
"test-headless": "ng test --no-watch --no-progress --browsers=ChromeHeadless"
},
"private": true,
"dependencies": {
......@@ -33,6 +34,7 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"puppeteer": "^21.5.0",
"typescript": "~5.1.3"
}
}
export * from './api-config';
\ No newline at end of file
......@@ -29,5 +29,8 @@
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"paths": {
"@config": ["app/config"],
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment