test(webapp): provide tests in CI

- add url and page as env variables to choice where to test and update the others
- To pass a variable to a job's service, they have to be declared in the "variables" global -> doesn't work (see: [#37])
- use of the deployed image to do E2E test instead of services of gitlab
This commit is contained in:
fastium
2025-06-21 16:22:07 +02:00
parent cecd04dd20
commit e436eb354b
10 changed files with 55 additions and 270 deletions

View File

@@ -1,5 +1,5 @@
import axios, { AxiosResponse } from "axios";
import { BASE, PING, RACLETTE, PONG } from "../const";
import { BASE, PING, PAGE, PONG } from "../const";
export class HttpClient {
private _url: string;
@@ -45,7 +45,7 @@ export class HttpClient {
room: string,
device: string
): Promise<AxiosResponse<any, any>> {
const response = await axios.get(`${BASE}${this._url}/${RACLETTE}`, {
const response = await axios.get(`${BASE}${this._url}/${PAGE}`, {
headers: this.getAuthHeader(),
params: {
user: user,
@@ -62,7 +62,7 @@ export class HttpClient {
device: string
): Promise<AxiosResponse<any, any>> {
const response = await axios.post(
`${BASE}${this._url}/${RACLETTE}`,
`${BASE}${this._url}/${PAGE}`,
{
command: "MEASURE_NEW",
},

View File

@@ -1,10 +1,10 @@
export const APP_NAME = "Home Monitor";
export const URL = "rest.mse.kb28.ch";
export const URL = process.env.VUE_APP_REST_URL;
// load environment varaibles - need to have the prefix VUE_APP
export const USERNAME = process.env.VUE_APP_INFLUXDB_USER;
export const PASSWORD = process.env.VUE_APP_INFLUXDB_PASSWORD;
export const USERNAME = process.env.VUE_APP_REST_USER;
export const PASSWORD = process.env.VUE_APP_REST_PASSWORD;
export const HUMIDITY = "humidity";
export const TEMPERATURE = "temperature";
@@ -17,5 +17,5 @@ export const DEVICE = "Shed";
export const BASE = "https://";
export const PING = "ping";
export const RACLETTE = "raclette";
export const PAGE = process.env.VUE_APP_REST_PAGE;
export const PONG = "pong";