sign (#102)
This commit is contained in:
Родитель
7ee2c8c83b
Коммит
e00b2a8855
|
@ -9,7 +9,7 @@ const testName = "Cohort";
|
|||
|
||||
export function describeCohort(dataShape: IInterpretData): void {
|
||||
describe(testName, () => {
|
||||
it("show hide cohort edit panel by default", () => {
|
||||
it("should hide cohort edit panel by default", () => {
|
||||
cy.get("#cohortEditPanel").should("not.exist");
|
||||
});
|
||||
if (
|
||||
|
@ -17,11 +17,11 @@ export function describeCohort(dataShape: IInterpretData): void {
|
|||
!dataShape.noLocalImportance ||
|
||||
!dataShape.noY
|
||||
) {
|
||||
it("show cohort edit panel when click create", () => {
|
||||
it("should cohort edit panel when click create", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
cy.get("#cohortEditPanel").should("exist");
|
||||
});
|
||||
describeCreateCohort();
|
||||
describeCreateCohort(dataShape);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
export function describeCreateCohort(): void {
|
||||
it("show have no filter by default", () => {
|
||||
import { IInterpretData } from "../IInterpretData";
|
||||
|
||||
export function describeCreateCohort(dataShape: IInterpretData): void {
|
||||
it("should have no filter by default", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
cy.get('#cohortEditPanel span:contains("No filters added yet")').should(
|
||||
"exist"
|
||||
);
|
||||
});
|
||||
it("show able to add filter", () => {
|
||||
it("should able to add filter", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").type("CohortCreateE2E");
|
||||
|
@ -19,7 +21,19 @@ export function describeCreateCohort(): void {
|
|||
"not.exist"
|
||||
);
|
||||
});
|
||||
it("show able to delete filter", () => {
|
||||
it("should able to add multiple filters", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").type("CohortCreateE2E");
|
||||
cy.get('#cohortEditPanel [type="radio"]').first().check();
|
||||
cy.get('button:contains("Add Filter")').click();
|
||||
|
||||
cy.get('#cohortEditPanel [type="radio"]').first().check();
|
||||
cy.get('button:contains("Add Filter")').click();
|
||||
|
||||
cy.get("#removeFilterBtn-1").should("exist");
|
||||
});
|
||||
it("should able to delete filter", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").type("CohortCreateE2E");
|
||||
|
@ -30,7 +44,27 @@ export function describeCreateCohort(): void {
|
|||
"exist"
|
||||
);
|
||||
});
|
||||
it("show create new cohort", () => {
|
||||
it("should show error message with no cohort name", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").clear();
|
||||
cy.get('#cohortEditPanel [type="radio"]').first().check();
|
||||
cy.get('button:contains("Add Filter")').click();
|
||||
|
||||
cy.get('#cohortEditPanel span:contains("Missing cohort name")').should(
|
||||
"exist"
|
||||
);
|
||||
});
|
||||
it("should not create cohort with no name", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").clear();
|
||||
cy.get('#cohortEditPanel [type="radio"]').first().check();
|
||||
cy.get('button:contains("Add Filter")').click();
|
||||
cy.get('button:contains("Save")').click();
|
||||
cy.get("#cohortEditPanel").should("exist");
|
||||
});
|
||||
it("should create new cohort", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
|
||||
cy.get("#cohortEditPanel input:eq(0)").type("CohortCreateE2E");
|
||||
|
@ -39,4 +73,10 @@ export function describeCreateCohort(): void {
|
|||
cy.get('button:contains("Save")').click();
|
||||
cy.get('span:contains("CohortCreateE2E")').should("exist");
|
||||
});
|
||||
if (dataShape.noDataset) {
|
||||
it("should not have options of dataset", () => {
|
||||
cy.get('button:contains("New Cohort")').click();
|
||||
cy.get('#cohortEditPanel span:contains("Dataset")').should("not.exist");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче