From 076f6b4af5d821f2432431d2aa97e7ed975cf039 Mon Sep 17 00:00:00 2001 From: vinutha karanth Date: Wed, 25 May 2022 12:48:45 -0700 Subject: [PATCH 1/3] update Signed-off-by: vinutha karanth --- .../causalAnalysis/describeAggregateCausalAffects.ts | 10 ++++------ .../individualFeatureImportance/describeSubBarChart.ts | 7 ++++--- .../describeSubLineChart.ts | 4 +++- .../whatIfCounterfactuals/describeSubBarChart.ts | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/libs/e2e/src/lib/describer/modelAssessment/causalAnalysis/describeAggregateCausalAffects.ts b/libs/e2e/src/lib/describer/modelAssessment/causalAnalysis/describeAggregateCausalAffects.ts index 4dfdff7bcc..2b7017b194 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/causalAnalysis/describeAggregateCausalAffects.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/causalAnalysis/describeAggregateCausalAffects.ts @@ -59,12 +59,10 @@ export function describeAggregateCausalAffects( }); it("should render feature names on x-axis that are passed in from SDK", () => { - cy.get(Locators.CausalChartXAxisValues) - .its("length") - .should( - "be", - dataShape.causalAnalysisData?.featureListInCausalTable?.length - ); + cy.get(Locators.CausalChartXAxisValues).should( + "have.length", + dataShape.causalAnalysisData?.featureListInCausalTable?.length + ); cy.get(`${Locators.CausalChartXAxisValues}`) .last() .invoke("text") diff --git a/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubBarChart.ts b/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubBarChart.ts index 6a3a720deb..639c395dcc 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubBarChart.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubBarChart.ts @@ -35,9 +35,10 @@ export function describeSubBarChart(dataShape: IModelAssessmentData): void { ); }); it("should have right number of x axis labels", () => { - cy.get(Locators.IFIXAxisValue) - .its("length") - .should("be", props.dataShape.featureNames?.length); + cy.get(Locators.IFIXAxisValue).should( + "have.length", + props.dataShape.featureNames?.length + ); }); it("should update x axis labels on changing top features by their importance number", () => { diff --git a/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubLineChart.ts b/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubLineChart.ts index bd284fbc62..ca0cead326 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubLineChart.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/featureImportances/individualFeatureImportance/describeSubLineChart.ts @@ -24,7 +24,9 @@ export function describeSubLineChart( selectRow("Index", "4"); }); it("should have more than one point", () => { - cy.get(Locators.ICENoOfPoints).its("length").should("be.gte", 1); + cy.get(Locators.ICENoOfPoints).then(($noOfPoints) => { + expect($noOfPoints).length.to.be.at.least(1); + }); }); it("should update x-axis value when 'Feature' dropdown is changed", () => { diff --git a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeSubBarChart.ts b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeSubBarChart.ts index 5918245dcd..58c184135e 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeSubBarChart.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeSubBarChart.ts @@ -30,9 +30,9 @@ export function describeSubBarChart(dataShape: IModelAssessmentData): void { ).should("contain.text", "Feature importance"); }); it("should have right number of x axis labels", () => { - cy.get("#WhatIfFeatureImportanceBar g.highcharts-xaxis-labels text") - .its("length") - .should("be", props.dataShape.featureNames?.length); + cy.get( + "#WhatIfFeatureImportanceBar g.highcharts-xaxis-labels text" + ).should("have.length", props.dataShape.featureNames?.length); }); }); } From 8113257dd7d5349fa6ceafbdfeea995a3b93eb35 Mon Sep 17 00:00:00 2001 From: vinutha karanth Date: Wed, 25 May 2022 15:47:42 -0700 Subject: [PATCH 2/3] update Signed-off-by: vinutha karanth --- libs/e2e/src/lib/describer/modelAssessment/Constants.ts | 1 + .../modelAssessment/whatIfCounterfactuals/describeAxisFlyouts.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/libs/e2e/src/lib/describer/modelAssessment/Constants.ts b/libs/e2e/src/lib/describer/modelAssessment/Constants.ts index 29fa148c49..65a220c48a 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/Constants.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/Constants.ts @@ -44,6 +44,7 @@ export enum Locators { WhatIfScatterChartYAxis = "#IndividualFeatureContainer div[class^='rotatedVerticalBox']", WhatIfScatterChartFlyoutCancel = "#AxisConfigPanel button:contains('Cancel')", WhatIfScatterChartFlyoutSelect = "#AxisConfigPanel button:contains('Select')", + WhatIfScatterChartSelectFeatureCaretButton = "#AxisConfigPanel i[data-icon-name='ChevronDown']", WhatIfAxisPanel = "#AxisConfigPanel", AxisFeatureDropdown = "#AxisConfigPanel div.ms-ComboBox-container", AxisFeatureDropdownOption = "div.ms-ComboBox-optionsContainerWrapper button[role='option']", diff --git a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeAxisFlyouts.ts b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeAxisFlyouts.ts index 0466d52a0e..a448dc676f 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeAxisFlyouts.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeAxisFlyouts.ts @@ -22,6 +22,7 @@ export function describeAxisFlyouts(dataShape: IModelAssessmentData): void { "have.length", dataShape.featureNames?.length ); + cy.get(Locators.WhatIfScatterChartSelectFeatureCaretButton).click(); cy.get(Locators.WhatIfScatterChartFlyoutCancel).click(); }); it("should be able to select different feature", () => { From 410066c3202e2e56d2a4ecf7084e86ac4a232069 Mon Sep 17 00:00:00 2001 From: vinutha karanth Date: Wed, 25 May 2022 16:09:33 -0700 Subject: [PATCH 3/3] skip what-if create tests for AML Signed-off-by: vinutha karanth --- .../describeWhatIfCreate.ts | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeWhatIfCreate.ts b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeWhatIfCreate.ts index 83e470a000..fe02b5fc27 100644 --- a/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeWhatIfCreate.ts +++ b/libs/e2e/src/lib/describer/modelAssessment/whatIfCounterfactuals/describeWhatIfCreate.ts @@ -10,35 +10,35 @@ export function describeWhatIfCreate( dataShape: IModelAssessmentData, name?: keyof typeof modelAssessmentDatasets ): void { - describe("What if Create counterfactual", () => { - before(() => { - cy.get(Locators.WICDatapointDropbox).click(); - getSpan( - dataShape.whatIfCounterfactualsData?.selectedDatapoint || "Index 1" - ).click(); - cy.get(Locators.CreateWhatIfCounterfactualButton) - .click() - .get(Locators.WhatIfCounterfactualPanel) - .should("exist"); - }); - after(() => { - cy.get(Locators.WhatIfCloseButton).click(); - }); + // AML do not need to execute below tests, as these options are not available for static view + if (name) { + describe("What if Create counterfactual", () => { + before(() => { + cy.get(Locators.WICDatapointDropbox).click(); + getSpan( + dataShape.whatIfCounterfactualsData?.selectedDatapoint || "Index 1" + ).click(); + cy.get(Locators.CreateWhatIfCounterfactualButton) + .click() + .get(Locators.WhatIfCounterfactualPanel) + .should("exist"); + }); + after(() => { + cy.get(Locators.WhatIfCloseButton).click(); + }); - it("should filter by included letters in search query", () => { - cy.get(Locators.WhatIfSearchBar).type( - dataShape.whatIfCounterfactualsData?.searchBarQuery || "" - ); - cy.get(Locators.WhatIfColumnHeaders) - .eq(2) - .contains(dataShape.whatIfCounterfactualsData?.searchBarQuery || ""); - cy.get(Locators.WhatIfSearchBarClearTextButton).click(); - cy.get(Locators.WhatIfColumnHeaders).contains( - dataShape.whatIfCounterfactualsData?.columnHeaderAfterSort || "" - ); - }); - // AML do not need to execute below tests, as these options are not available for static view - if (name) { + it("should filter by included letters in search query", () => { + cy.get(Locators.WhatIfSearchBar).type( + dataShape.whatIfCounterfactualsData?.searchBarQuery || "" + ); + cy.get(Locators.WhatIfColumnHeaders) + .eq(2) + .contains(dataShape.whatIfCounterfactualsData?.searchBarQuery || ""); + cy.get(Locators.WhatIfSearchBarClearTextButton).click(); + cy.get(Locators.WhatIfColumnHeaders).contains( + dataShape.whatIfCounterfactualsData?.columnHeaderAfterSort || "" + ); + }); it("Should have 'Create your own counterfactual' section and it should be editable", () => { cy.get(Locators.CreateYourOwnCounterfactualInputField) .eq(2) @@ -72,8 +72,8 @@ export function describeWhatIfCreate( dataShape.whatIfCounterfactualsData?.whatIfNameLabelUpdated ); }); - } - }); + }); + } describe.skip("What-If save scenario", () => { before(() => {