Skip to content

Commit

Permalink
Merge branch 'cypress-test/-ag-grid' into cypress-test/-failing-test-…
Browse files Browse the repository at this point in the history
…and-a/b-testing-eval
  • Loading branch information
bekossy committed Dec 8, 2023
2 parents 82f7f5b + 0f5a469 commit 566e05d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions agenta-web/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
baseUrl: "http://localhost",
defaultCommandTimeout: 30000,
requestTimeout: 10000,
specPattern: ["*/e2e/playground.cy.ts"],
},
env: {
baseApiURL: "http://localhost/api",
Expand Down
13 changes: 7 additions & 6 deletions agenta-web/cypress/e2e/ab-testing-evaluation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ describe("A/B Testing Evaluation workflow", () => {

cy.clickLinkAndWait('[data-cy="start-new-evaluation-button"]')
cy.url().should("include", "/human_a_b_testing")
cy.get('[data-cy="evalInstructionsShown-ok-btn"]').click()

cy.get('[data-cy="abTesting-app-variant-vote-button"]').should("not.exist")
cy.get('[data-cy="abTesting-both-bad-vote-button"]').should("not.exist")
cy.wait(1000)
cy.get('[data-cy="abTesting-run-all-button"]').click()
cy.get('[data-cy^="abTesting-app-variant-1-vote-button"]').should("not.be.disabled")
cy.get('[data-cy^="abTesting-app-variant-2-vote-button"]').should("not.be.disabled")
cy.get('[data-cy^="abTesting-both-bad-vote-button"]').should("not.be.disabled")

cy.get('[data-cy="abTesting-app-variant-1-vote-button-0"]').click()
cy.get('[data-cy="abTesting-app-variant-2-vote-button-1"]').click()
cy.get('[data-cy="abTesting-both-bad-vote-button-2"]').click()
cy.get('[data-cy="abTesting-app-variant-vote-button"]').eq(0).click()
cy.get('[data-cy="abTesting-app-variant-vote-button"]').eq(1).click()
cy.get('[data-cy="abTesting-both-bad-vote-button"]').click()
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ const SingleModelEvaluationTable: React.FC<EvaluationTableProps> = ({
type="primary"
onClick={runAllEvaluations}
size="large"
data-cy="abTesting-run-all-button"
data-cy="single-model-run-all-button"
>
Run All
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const ComparisonVote: React.FC<ComparisonVoteProps> = ({variants, onChange, valu
onClick={getOnClick(variant.variantId)}
type={value === variant.variantId ? "primary" : undefined}
danger
data-cy="abTesting-app-variant-vote-button"
>
{String.fromCharCode(65 + ix)}: {variant.variantName}
</Button>
Expand All @@ -106,6 +107,7 @@ const ComparisonVote: React.FC<ComparisonVoteProps> = ({variants, onChange, valu
type={value === badId ? "primary" : undefined}
key={badId}
onClick={getOnClick(badId)}
data-cy="abTesting-both-bad-vote-button"
>
Both are bad
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const EvaluationCardView: React.FC<Props> = ({
</li>
</ol>
),
okText: "Ok",
okText: <span data-cy="evalInstructionsShown-ok-btn">Ok</span>,
cancelText: null,
width: 500,
onCancel: () => (opened.current = false),
Expand Down

0 comments on commit 566e05d

Please sign in to comment.