UI Tests for Object Detection Widgets in Model Overview (#2295)

* od widget test ckpt

* auto lint fixes
This commit is contained in:
Advitya Gemawat 2023-08-30 21:45:53 -04:00 коммит произвёл GitHub
Родитель 024d904f1d
Коммит 3b6043a1c0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -149,6 +149,9 @@ export enum Locators {
ModelOverviewMetricChartBars = "#ModelOverview #ModelOverviewMetricChart .highcharts-bar-series > rect", ModelOverviewMetricChartBars = "#ModelOverview #ModelOverviewMetricChart .highcharts-bar-series > rect",
ModelOverviewConfusionMatrix = "#ModelOverview #modelOverviewConfusionMatrix", ModelOverviewConfusionMatrix = "#ModelOverview #modelOverviewConfusionMatrix",
ModelOverviewConfusionMatrixHeatmap = "#ModelOverview #ModelOverviewConfusionMatrix", ModelOverviewConfusionMatrixHeatmap = "#ModelOverview #ModelOverviewConfusionMatrix",
ModelOverviewAggregateMethod = "#ModelOverview #modelOverviewAggregateMethod",
ModelOverviewClassSelector = "#ModelOverview #modelOverviewClassSelection",
ModelOverviewIoUThresholdSlider = "#ModelOverview #modelOverviewIoUThreshold",
MissingParameterPlaceholder = "#ModelOverview #MissingParameterPlaceholder", MissingParameterPlaceholder = "#ModelOverview #MissingParameterPlaceholder",
CounterfactualHeader = "#ModelAssessmentDashboard span:contains('What-If counterfactuals')", CounterfactualHeader = "#ModelAssessmentDashboard span:contains('What-If counterfactuals')",
DataAnalysisPivot = "#dataAnalysisPivot", DataAnalysisPivot = "#dataAnalysisPivot",

Просмотреть файл

@ -55,7 +55,7 @@ export function describeModelOverview(
if (datasetShape.modelOverviewData?.hasModelOverviewComponent) { if (datasetShape.modelOverviewData?.hasModelOverviewComponent) {
it("should have 'Model overview' component in the initial state", () => { it("should have 'Model overview' component in the initial state", () => {
ensureAllModelOverviewBasicElementsArePresent(); ensureAllModelOverviewBasicElementsArePresent(datasetShape);
ensureAllModelOverviewDatasetCohortsViewBasicElementsArePresent( ensureAllModelOverviewDatasetCohortsViewBasicElementsArePresent(
datasetShape, datasetShape,
false, false,
@ -65,7 +65,7 @@ export function describeModelOverview(
}); });
it("should show 'Feature cohorts' view when selected", () => { it("should show 'Feature cohorts' view when selected", () => {
ensureAllModelOverviewBasicElementsArePresent(); ensureAllModelOverviewBasicElementsArePresent(datasetShape);
cy.get(Locators.ModelOverviewCohortViewFeatureCohortViewButton).click(); cy.get(Locators.ModelOverviewCohortViewFeatureCohortViewButton).click();
ensureAllModelOverviewFeatureCohortsViewBasicElementsArePresent( ensureAllModelOverviewFeatureCohortsViewBasicElementsArePresent(
datasetShape, datasetShape,

Просмотреть файл

@ -2,8 +2,11 @@
// Licensed under the MIT License. // Licensed under the MIT License.
import { Locators } from "../Constants"; import { Locators } from "../Constants";
import { IModelAssessmentData } from "../IModelAssessmentData";
export function ensureAllModelOverviewBasicElementsArePresent(): void { export function ensureAllModelOverviewBasicElementsArePresent(
datasetShape: IModelAssessmentData
): void {
cy.get(Locators.ModelOverviewHeader).should("exist"); cy.get(Locators.ModelOverviewHeader).should("exist");
cy.get(Locators.ModelOverviewDescription).should("exist"); cy.get(Locators.ModelOverviewDescription).should("exist");
cy.get(Locators.ModelOverviewCohortViewSelector).should("exist"); cy.get(Locators.ModelOverviewCohortViewSelector).should("exist");
@ -13,4 +16,10 @@ export function ensureAllModelOverviewBasicElementsArePresent(): void {
3 3
); );
cy.get(Locators.ModelOverviewMetricSelection).should("exist"); cy.get(Locators.ModelOverviewMetricSelection).should("exist");
if (datasetShape.isObjectDetection) {
cy.get(Locators.ModelOverviewAggregateMethod).should("exist");
cy.get(Locators.ModelOverviewClassSelector).should("exist");
cy.get(Locators.ModelOverviewIoUThresholdSlider).should("exist");
}
} }

Просмотреть файл

@ -87,7 +87,7 @@ export class ObjectDetectionWidgets extends React.PureComponent<IObjectDetection
styles={FluentUIStyles.smallDropdownStyle} styles={FluentUIStyles.smallDropdownStyle}
/> />
<Slider <Slider
id="iouThreshold" id="modelOverviewIoUThreshold"
label={ label={
localization.ModelAssessment.ModelOverview.iouThresholdDropdown.name localization.ModelAssessment.ModelOverview.iouThresholdDropdown.name
} }