diff --git a/src/app/modules/ix-table/utils.ts b/src/app/modules/ix-table/utils.ts index 100d7f27282..136dd62ddaa 100644 --- a/src/app/modules/ix-table/utils.ts +++ b/src/app/modules/ix-table/utils.ts @@ -2,7 +2,7 @@ import { get } from 'lodash-es'; import { Column, ColumnComponent } from 'app/modules/ix-table/interfaces/column-component.class'; import { TableFilter } from 'app/modules/ix-table/interfaces/table-filter.interface'; -function convertStringToId(inputString: string): string { +export function convertStringToId(inputString: string): string { let result = inputString; if (!result || result.includes('undefined')) { diff --git a/src/app/pages/services/components/service-state-column/service-state-column.component.html b/src/app/pages/services/components/service-state-column/service-state-column.component.html index 9ddc29e7192..70e0afd76c3 100644 --- a/src/app/pages/services/components/service-state-column/service-state-column.component.html +++ b/src/app/pages/services/components/service-state-column/service-state-column.component.html @@ -4,7 +4,7 @@ *ixRequiresRoles="requiredRoles()" color="primary" [aria-label]="isRunning() ? ('Stop service' | translate) : ('Start service' | translate)" - [ixTest]="['service', 'running', service().name, 'toggle']" + [ixTest]="['service', 'running', testIdServiceName, 'toggle']" [checked]="isRunning()" (change)="onSlideToggleChanged($event)" (click)="$event.stopPropagation()" diff --git a/src/app/pages/services/components/service-state-column/service-state-column.component.ts b/src/app/pages/services/components/service-state-column/service-state-column.component.ts index dd31d9abec0..79162350df3 100644 --- a/src/app/pages/services/components/service-state-column/service-state-column.component.ts +++ b/src/app/pages/services/components/service-state-column/service-state-column.component.ts @@ -11,6 +11,7 @@ import { ServiceStatus } from 'app/enums/service-status.enum'; import { ServiceRow } from 'app/interfaces/service.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { ColumnComponent } from 'app/modules/ix-table/interfaces/column-component.class'; +import { convertStringToId } from 'app/modules/ix-table/utils'; import { AppLoaderService } from 'app/modules/loader/app-loader.service'; import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service'; import { ErrorHandlerService } from 'app/services/error-handler.service'; @@ -33,6 +34,10 @@ export class ServiceStateColumnComponent extends ColumnComponent { protected readonly isRunning = computed(() => this.service().state === ServiceStatus.Running); + get testIdServiceName(): string { + return convertStringToId(this.service().name).replace(/\./g, ''); + } + private servicesService = inject(ServicesService); private ws = inject(WebSocketService); private dialogService = inject(DialogService);