blob: 3035c899bf40c86572d5b3bef85e7d0d2fb642b1 [file] [log] [blame]
<!--
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="header">
<div class="back-button-label">Individual Tests</div>
<h1 class="subtitle">
<button mat-icon-button (click)="back()" #backButton id="back-button"
matTooltip="Return to test suites page"
aria-label="Return to test suites page">
<mat-icon class="back-button-icon">arrow_back</mat-icon>
</button>
Schedule a Test Run
</h1>
</div>
<!-- Stepper -->
<mat-horizontal-stepper linear="true" #stepper
(selectionChange)="resetStepCompletion($event.selectedIndex, stepCompletionStatusMap, totalSteps)"
>
<ng-template matStepperIcon="edit">
<mat-icon>check</mat-icon>
</ng-template>
<!-- First step: Configure Test Run -->
<mat-step [completed]="!!stepCompletionStatusMap[step.CONFIGURE_TEST_RUN]">
<ng-template matStepLabel>Configure Test Run</ng-template>
<!-- Loading Spinner -->
<mat-spinner
class="loading-spinner" color="accent" *ngIf="isLoading">
</mat-spinner>
<test-run-config-form [class.loading-mask]="isLoading"
[testMap]="mttObjectMap.testMap"
[(testRunConfig)]="testRunConfig"
[prevTestRunId]="prevTestRunId"
(rerunContext)="rerunContext = $event"
(testRunConfigChange)="updateTestResources()">
</test-run-config-form>
<!-- Labels Field -->
<mat-form-field fxFlex="600px">
<mat-chip-grid #chipList aria-label="Labels">
<mat-chip-row
*ngFor="let label of labels"
(removed)="removeLabel(label)">
{{ label }}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip-row>
<input
placeholder="Labels"
[matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeyCodes"
[matChipInputAddOnBlur]="true"
(matChipInputTokenEnd)="addLabel($event)"/>
</mat-chip-grid>
</mat-form-field>
<div>
<button mat-flat-button
(click)="goForward(stepper)"
color="accent">
Next Step
</button>
<button mat-button (click)="back()" color="accent">Cancel</button>
<!-- Error messages after validation -->
<form-error-info [invalidInputs]="invalidInputs"></form-error-info>
<form-error-info [errorMessage]="errorMessage"></form-error-info>
</div>
</mat-step>
<!-- Second step: Select Devices -->
<mat-step [completed]="!!stepCompletionStatusMap[step.SELECT_DEVICES]">
<ng-template matStepLabel>Select Devices</ng-template>
<test-run-target-picker [(deviceSpecs)]="testRunConfig.device_specs"
[(shardCount)]="testRunConfig.shard_count"
[autoUpdate]="true"
(deviceSpecsChange)="updateSelectedDeviceActions($event)"
[(allowPartialDeviceMatch)]="testRunConfig.allow_partial_device_match">
</test-run-target-picker>
<div>
<button mat-stroked-button matStepperPrevious color="accent">
Previous Step
</button>
<button mat-flat-button (click)="goForward(stepper)"
color="accent">
Next Step
</button>
<button mat-button (click)="back()" color="accent">Cancel</button>
<form-error-info [errorMessage]="errorMessage">
</form-error-info>
</div>
</mat-step>
<!-- Third step: Add Actions -->
<mat-step [completed]="!!stepCompletionStatusMap[step.ADD_ACTIONS]">
<ng-template matStepLabel>Add Actions</ng-template>
<mat-spinner
class="loading-spinner" color="accent" *ngIf="isLoading">
</mat-spinner>
<h2>Device Actions</h2>
<device-action-picker [class.loading-mask]="isLoading"
[deviceActions]="mttObjectMap.deviceActionMap | values"
[selectedDeviceActions]="selectedDeviceActions"
(selectionChange)="updateConfigDeviceActionIds()"
>
</device-action-picker>
<h2>Test Run Actions</h2>
<test-run-action-picker [class.loading-mask]="isLoading"
[actions]="mttObjectMap.testRunActionMap | values"
[selectedActions]="selectedTestRunActions"
(selectionChange)="updateConfigTestRunActionIds()">
</test-run-action-picker>
<mat-divider></mat-divider>
<div>
<button mat-stroked-button matStepperPrevious color="accent">
Previous Step
</button>
<button mat-flat-button (click)="goForward(stepper)" color="accent">
Next Step
</button>
<button mat-button (click)="back()" color="accent">Cancel</button>
</div>
</mat-step>
<!-- Fourth step: Set Test Resources -->
<mat-step [completed]="!!stepCompletionStatusMap[step.SET_TEST_RESOURCES]">
<ng-template matStepLabel>Set Test Resources</ng-template>
<mat-spinner
class="loading-spinner" color="accent"
*ngIf="isLoading || isStartingTestRun">
</mat-spinner>
<test-resource-form
[class.loading-mask]="isLoading"
[data]="testRunConfig.test_resource_objs"
[canAdd]="false"
[canDelete]="false"
[buildChannels]="mttObjectMap.buildChannelMap | values"
testResourceClassType="TestResourceClassType.TEST_RESOURCE_OBJ"
>
</test-resource-form>
<div>
<button mat-stroked-button matStepperPrevious color="accent">
Previous Step
</button>
<button mat-flat-button (click)="goForward(stepper)" color="accent">
Next Step
</button>
<button mat-button (click)="back()" color="accent">Cancel</button>
</div>
</mat-step>
<!-- Fifth step: Add Rerun Configs -->
<mat-step [completed]="!!stepCompletionStatusMap[step.ADD_RERUN_CONFIGS]">
<ng-template matStepLabel>Add Rerun Configs</ng-template>
<mat-spinner class="loading-spinner" color="accent" *ngIf="isLoading || isStartingTestRun">
</mat-spinner>
<test-run-config-summary [config]="testRunConfig" [editable]="false"
[title]="'Primary Test Run Config'">
</test-run-config-summary>
<h3>
Add rerun configurations
</h3>
<div class="description">
Add configurations here to schedule reruns after the primary run using different devices,
actions, or test resources.
</div>
<test-run-config-list [(data)]="rerunConfigs" [configTitle]="'Rerun Config'"
[configTemplate]="testRunConfig">
</test-run-config-list>
<div>
<button mat-stroked-button matStepperPrevious color="accent">Previous Step</button>
<button
[disabled]="isStartingTestRun"
mat-flat-button
color="accent"
id="start-test-run-button"
(click)="startTestRun(!!warningMessage.length)"
>
Start Test Run <ng-container *ngIf="warningMessage.length">(Ignore Warnings)</ng-container>
</button>
<button mat-button (click)="back()" color="accent">Cancel</button>
<form-error-info
[warningMessage]="warningMessage"
[invalidInputs]="invalidInputs"
></form-error-info>
</div>
</mat-step>
</mat-horizontal-stepper>