-
Notifications
You must be signed in to change notification settings - Fork 449
Vision Data Explorer Flyout tests #2208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Advitya17
wants to merge
48
commits into
main
Choose a base branch
from
agemawat/vision_flyout_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
ffaf951
ckpt
Advitya17 2efd461
test ckpt
Advitya17 345d3bb
constant button test ckpt
Advitya17 c326fb6
merge conflict fixes
Advitya17 4ba30d6
test ckpt
Advitya17 0bd2f1e
image explorer test ckpt
Advitya17 66f5fb2
merge conflict fix
Advitya17 ec3815a
readding constants
Advitya17 530c630
test fixes
Advitya17 88282ac
Merge branch 'main' of https://github.com/microsoft/responsible-ai-to…
Advitya17 594835f
line limit fix
Advitya17 f83688c
python lint fixes
Advitya17 c657628
added flyout constants
Advitya17 2dd58e2
reverted flyout test
Advitya17 2960f82
auto lint fixes
Advitya17 cdcf3d7
image click ckpt
Advitya17 24cc135
flyout test ckpt
Advitya17 2520b60
Flyout working test ckpt
Advitya17 8a95dcf
removed non-flyout tests/logic
Advitya17 9602285
merge conflict fix
Advitya17 13f11b1
reverted refactor
Advitya17 7d449c7
lint fixes + cy wait
Advitya17 8dea6b0
Merge branch 'main' of https://github.com/microsoft/responsible-ai-to…
Advitya17 213a2f0
flyout test tweak
Advitya17 2972b36
merge conflict fixes
Advitya17 60a489a
typo fix
Advitya17 b5a6a8d
auto lint fixes
Advitya17 e999763
Merge branch 'main' of https://github.com/microsoft/responsible-ai-to…
Advitya17 a234d0d
testing ckpt
Advitya17 e2ac173
notebook example tweak for EA on ubuntu
Advitya17 ce0268c
Merge branch 'main' of https://github.com/microsoft/responsible-ai-to…
Advitya17 d57893e
simplified od test
Advitya17 f0bb62c
trying with wait inside and
Advitya17 71f42e0
syntax fix
Advitya17 6af68aa
added timeout
Advitya17 e0c2d17
wait until logic
Advitya17 bc32b25
tests without image loading
Advitya17 b416db4
waitUntil refactor
Advitya17 173c46b
build fix
Advitya17 7c52d29
condition tweak
Advitya17 c41d0e1
test case tweak
Advitya17 8e42a85
latest dependency update
Advitya17 c3e86a9
added import
Advitya17 d821b24
test tweak with waitUntil
Advitya17 d46b4a0
Merge branch 'main' into agemawat/vision_flyout_tests
Advitya17 f6ce2d2
Merge branch 'main' of https://github.com/microsoft/responsible-ai-to…
Advitya17 270e512
Merge branch 'agemawat/vision_flyout_tests' of https://github.com/mic…
Advitya17 c76bf88
get chained after waitUntil
Advitya17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...nt/responsibleaitoolboxFridgeImageClassificationModelDebugging/visionDataExplorer.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { | ||
| describeVisionDataExplorer, | ||
| modelAssessmentDatasets | ||
| } from "@responsible-ai/e2e"; | ||
| const datasetShape = | ||
| modelAssessmentDatasets.FridgeImageClassificationModelDebugging; | ||
| describeVisionDataExplorer( | ||
| datasetShape, | ||
| "FridgeImageClassificationModelDebugging" | ||
| ); |
9 changes: 9 additions & 0 deletions
9
...ibleaitoolboxFridgeMultilabelImageClassificationModelDebugging/visionDataExplorer.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { | ||
| describeVisionDataExplorer, | ||
| modelAssessmentDatasets | ||
| } from "@responsible-ai/e2e"; | ||
| const datasetShape = modelAssessmentDatasets.FridgeMultilabelModelDebugging; | ||
| describeVisionDataExplorer(datasetShape, "FridgeMultilabelModelDebugging"); |
10 changes: 10 additions & 0 deletions
10
...ssment/responsibleaitoolboxFridgeObjectDetectionModelDebugging/visionDataExplorer.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { | ||
| describeVisionDataExplorer, | ||
| modelAssessmentDatasets | ||
| } from "@responsible-ai/e2e"; | ||
| const datasetShape = | ||
| modelAssessmentDatasets.FridgeObjectDetectionModelDebugging; | ||
| describeVisionDataExplorer(datasetShape, "FridgeObjectDetectionModelDebugging"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
libs/e2e/src/lib/describer/modelAssessment/visionDataExplorer/describeVisionDataExplorer.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { visit } from "../../../../util/visit"; | ||
| import { Locators } from "../Constants"; | ||
| import { modelAssessmentDatasets } from "../datasets/modelAssessmentDatasets"; | ||
| import { IModelAssessmentData } from "../IModelAssessmentData"; | ||
|
|
||
| import { ensureAllVisionDataExplorerFlyoutElementsAfterSelectionArePresent } from "./ensureAllVisionDataExplorerFlyoutElementsAfterSelectionArePresent"; | ||
|
|
||
| const testName = "Vision Data Explorer"; | ||
|
|
||
| export function describeVisionDataExplorer( | ||
| datasetShape: IModelAssessmentData, | ||
| name?: keyof typeof modelAssessmentDatasets, | ||
| isNotebookTest = true | ||
| ): void { | ||
| describe(testName, () => { | ||
| if (isNotebookTest) { | ||
| before(() => { | ||
| visit(name); | ||
| }); | ||
| } else { | ||
| before(() => { | ||
| cy.visit(`#/modelAssessmentVision/${name}/light/english/Version-2`); | ||
| }); | ||
| } | ||
|
|
||
| if (datasetShape.visionDataExplorerData?.hasVisionDataExplorerComponent) { | ||
| it("should should Flyout view components when selected", () => { | ||
| ensureAllVisionDataExplorerFlyoutElementsAfterSelectionArePresent( | ||
| datasetShape | ||
| ); | ||
| }); | ||
| } else { | ||
| it("should not have 'VisionDataExplorer' component", () => { | ||
| cy.get(Locators.VisionDataExplorer).should("not.exist"); | ||
| }); | ||
| } | ||
| }); | ||
| } | ||
58 changes: 58 additions & 0 deletions
58
...t/visionDataExplorer/ensureAllVisionDataExplorerFlyoutElementsAfterSelectionArePresent.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { expect } from "chai"; | ||
|
|
||
| import { Locators } from "../Constants"; | ||
| import { IModelAssessmentData } from "../IModelAssessmentData"; | ||
|
|
||
| export function ensureAllVisionDataExplorerFlyoutElementsAfterSelectionArePresent( | ||
| datasetShape: IModelAssessmentData | ||
| ): void { | ||
| cy.get(Locators.VisionDataExplorerImageExplorerViewButton).click(); | ||
|
|
||
| cy.wait(10000); | ||
|
|
||
| cy.get(Locators.VisionDataExplorerImageExplorerViewSuccessImage) | ||
| .should("be.visible") | ||
| .and(($image) => { | ||
| // verifies the image is loaded | ||
| expect(($image[0] as HTMLImageElement).naturalWidth).to.be.greaterThan(0); | ||
| expect(($image[0] as HTMLImageElement).naturalHeight).to.be.greaterThan( | ||
| 0 | ||
| ); | ||
| }); | ||
| // before | ||
| cy.get(Locators.VisionDataExplorerImageExplorerViewSuccessImage).click(); | ||
|
|
||
| cy.get(Locators.VisionDataExplorerFlyoutPredictionTitle).should("exist"); | ||
|
|
||
| cy.get(Locators.VisionDataExplorerFlyoutPredictionLabel) | ||
| .invoke("text") | ||
| .then((predLabel) => { | ||
| cy.get(Locators.VisionDataExplorerFlyoutGroundTruthLabel) | ||
| .invoke("text") | ||
| .should((gtLabel) => { | ||
| expect(predLabel.split(": ")[1]).to.equal(gtLabel.split(": ")[1]); | ||
| }); | ||
| }); | ||
|
|
||
| cy.get(Locators.VisionDataExplorerFlyoutImage) | ||
| .should("be.visible") | ||
| .and(($image) => { | ||
| // verifies the image is loaded | ||
| expect(($image[0] as HTMLImageElement).naturalWidth).to.be.greaterThan(0); | ||
| expect(($image[0] as HTMLImageElement).naturalHeight).to.be.greaterThan( | ||
| 0 | ||
| ); | ||
| }); | ||
|
|
||
| if (datasetShape.isObjectDetection) { | ||
| cy.get(Locators.VisionDataExplorerFlyoutObjectSelection).should("exist"); | ||
| } else { | ||
| cy.get(Locators.VisionDataExplorerFlyoutExplanationImage).should("exist"); | ||
| } | ||
| cy.get(Locators.VisionDataExplorerFlyoutMetadata).should("exist"); | ||
|
|
||
| cy.get(Locators.VisionDataExplorerFlyoutCloseButton).click(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.