Skip to content
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

test(pd): enable parameters for steps #17442

Open
wants to merge 13 commits into
base: edge
Choose a base branch
from

Conversation

y3rsh
Copy link
Member

@y3rsh y3rsh commented Feb 5, 2025

Overview

Change the shape of the StepList to intake parameters.

Follow the example and validate the shape of the param in the case statement then pass it to your function that implements the cypress behavior.

Test Plan and Hands on Testing

Make sure all tests still pass.

Risk assessment

⬇️

@y3rsh y3rsh self-assigned this Feb 5, 2025
@y3rsh y3rsh requested a review from a team as a code owner February 5, 2025 22:17
{ step: SetupActions.ClickLiquidButton },
{ step: SetupActions.DefineLiquid },
{ step: SetupActions.LiquidSaveWIP },
{ step: SetupActions.WellSelector, params: ['A1', 'A2'] },
Copy link
Member Author

@y3rsh y3rsh Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the example. Each of our Steps is now in the shape of interface StepListItem
So you may intake whatever param of whatever type you want to more dynamically drive a particular Action/Verification.

Comment on lines +377 to +381
if (Array.isArray(action.params) && action.params.length > 0) {
selectWells(action.params)
} else {
selectWells(['A1', 'A2'])
}
Copy link
Member Author

@y3rsh y3rsh Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can see over time if we would prefer to do the checking of the shape of the param in the implementation function itself or here.

Another thought I had as I was thinking on this

So far I like the dev experience using the enum to know what the steps are. We can of course make a big union type of functions, especially if most things end up having parameters, so we can see the param shape in code completion.

@Opentrons Opentrons deleted a comment from codecov bot Feb 6, 2025
@Opentrons Opentrons deleted a comment from codecov bot Feb 6, 2025
@Opentrons Opentrons deleted a comment from codecov bot Feb 6, 2025
@Opentrons Opentrons deleted a comment from codecov bot Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.08%. Comparing base (94bd0e9) to head (ff2b910).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #17442      +/-   ##
==========================================
+ Coverage   20.07%   20.08%   +0.01%     
==========================================
  Files        3187     3189       +2     
  Lines      229811   229682     -129     
  Branches     8190     8192       +2     
==========================================
  Hits        46132    46132              
+ Misses     183679   183550     -129     
Flag Coverage Δ
protocol-designer 18.56% <ø> (+1.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...gner/cypress/e2e/ProtocolDesignerModulesTest.cy.ts 0.00% <ø> (ø)
protocol-designer/cypress/e2e/createNew.cy.ts 0.00% <ø> (ø)
protocol-designer/cypress/e2e/createNewFlex.cy.ts 0.00% <ø> (ø)
...otocol-designer/cypress/e2e/transferSettings.cy.ts 0.00% <ø> (ø)
protocol-designer/cypress/support/SetupSteps.ts 0.00% <ø> (ø)
protocol-designer/cypress/support/StepExecution.ts 0.00% <ø> (ø)
...rotocol-designer/cypress/support/SupportModules.ts 0.00% <ø> (ø)
protocol-designer/cypress/support/import.ts 0.00% <ø> (ø)
...tocol-designer/cypress/support/universalActions.ts 0.00% <ø> (ø)
vitest.config.mts 0.00% <ø> (ø)

... and 2 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant