Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
y3rsh committed Feb 10, 2025
1 parent 91cbe53 commit 3c02d50
Show file tree
Hide file tree
Showing 9 changed files with 712 additions and 579 deletions.
190 changes: 100 additions & 90 deletions protocol-designer/cypress/e2e/ProtocolDesignerModulesTest.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {
SetupActions,
setupFunctions,
SetupVerifications,
} from '../support/SetupSteps'
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
import { UniversalActions } from '../support/universalActions'
import { ModActions, ModVerifications } from '../support/SupportModules'
import { runSteps } from '../support/StepExecution'
import type { StepsList } from '../support/StepExecution'
// Updated import to bring in StepListBuilder instead of StepsList
import { runSteps, StepListBuilder } from '../support/StepExecution'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
Expand All @@ -18,89 +14,103 @@ describe('The Redesigned Create Protocol Landing Page', () => {
it('content and step 1 flow works', () => {
cy.clickCreateNew()
cy.verifyCreateNewHeader()
const steps: StepsList = [
{ step: SetupVerifications.OnStep1 },
{ step: SetupVerifications.FlexSelected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.SelectOT2 },
{ step: SetupVerifications.OT2Selected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.SelectFlex },
{ step: SetupVerifications.FlexSelected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.OnStep2 },
{ step: SetupActions.SingleChannelPipette50 },
{ step: SetupVerifications.StepTwo50uL },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.StepTwoPart3 },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.OnStep3 },
{ step: SetupActions.YesGripper },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.Step4Verification },
{ step: SetupActions.AddThermocycler },
{ step: SetupVerifications.ThermocyclerImg },
{ step: SetupActions.AddHeaterShaker },
{ step: SetupVerifications.HeaterShakerImg },
{ step: SetupActions.AddMagBlock },
{ step: SetupVerifications.MagBlockImg },
{ step: SetupActions.AddTempdeck2 },
{ step: SetupVerifications.Tempdeck2Img },
{ step: SetupActions.Confirm },
{ step: SetupActions.Confirm },
{ step: SetupActions.Confirm },
{ step: SetupActions.EditProtocolA },
{ step: SetupActions.ChoseDeckSlotC2 },
{ step: SetupActions.AddHardwareLabware },
{ step: SetupActions.ClickLabwareHeader },
{ step: SetupActions.ClickWellPlatesSection },
{
step: setupFunctions.selectLabwareByDisplayName,
params: 'Bio-Rad 96 Well Plate',
},
{ step: SetupActions.ChoseDeckSlotC2Labware },
{ step: SetupActions.AddLiquid },
{ step: SetupActions.ClickLiquidButton },
{ step: SetupActions.DefineLiquid },
{ step: SetupActions.LiquidSaveWIP },
{ step: SetupActions.WellSelector },
{ step: SetupActions.LiquidDropdown },
{ step: SetupVerifications.LiquidPage },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.SelectLiquidWells },
{ step: SetupActions.SetVolumeAndSaveforWells },
{ step: SetupActions.ChoseDeckSlotC1 },
{ step: SetupActions.EditHardwareLabwareOnDeck },
{ step: SetupActions.ClickLabwareHeader },
{ step: SetupActions.AddAdapters },
{ step: SetupActions.DeepWellTempModAdapter },
{ step: SetupActions.AddNest96DeepWellPlate },
{ step: SetupActions.Done },
{ step: SetupActions.ProtocolStepsH },
{ step: SetupActions.AddStep },
{ step: ModActions.AddTemperatureStep },
{ step: ModVerifications.TempeDeckInitialForm },
{ step: UniversalActions.Snapshot },
{ step: ModActions.ActivateTempdeck },
{ step: ModActions.InputTempDeck4 },
{ step: ModActions.SaveButtonTempdeck },
{ step: ModActions.PauseAfterSettingTempdeck },
// ModVerifications.Temp4CPauseTextVerification}
{ step: UniversalActions.Snapshot },
{ step: SetupActions.AddStep },
{ step: ModActions.AddTemperatureStep },
{ step: ModActions.ActivateTempdeck },
{ step: ModActions.InputTempDeck95 },
{ step: ModActions.SaveButtonTempdeck },
{ step: ModActions.PauseAfterSettingTempdeck },
{ step: SetupActions.AddStep },
{ step: ModActions.AddTemperatureStep },
{ step: ModActions.ActivateTempdeck },
{ step: ModActions.InputTempDeck100 },
]

const steps = new StepListBuilder()
// Verification steps
.addStep(SetupVerifications.OnStep1)
.addStep(SetupVerifications.FlexSelected)
.addStep(UniversalActions.Snapshot)
// Switching between OT2 and Flex
.addStep(SetupActions.SelectOT2)
.addStep(SetupVerifications.OT2Selected)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.SelectFlex)
.addStep(SetupVerifications.FlexSelected)
.addStep(UniversalActions.Snapshot)
// Confirm moves to step2
.addStep(SetupActions.Confirm)
.addStep(SetupVerifications.OnStep2)
// Choose pipette
.addStep(SetupActions.SingleChannelPipette50)
.addStep(SetupVerifications.StepTwo50uL)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.Confirm)
.addStep(SetupVerifications.StepTwoPart3)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.Confirm)
// Move to step3
.addStep(SetupVerifications.OnStep3)
.addStep(SetupActions.YesGripper)
.addStep(SetupActions.Confirm)
// Step4: add modules
.addStep(SetupVerifications.Step4Verification)
.addStep(SetupActions.AddThermocycler)
.addStep(SetupVerifications.ThermocyclerImg)
.addStep(SetupActions.AddHeaterShaker)
.addStep(SetupVerifications.HeaterShakerImg)
.addStep(SetupActions.AddMagBlock)
.addStep(SetupVerifications.MagBlockImg)
.addStep(SetupActions.AddTempdeck2)
.addStep(SetupVerifications.Tempdeck2Img)
// Confirm a few times to proceed
.addStep(SetupActions.Confirm)
.addStep(SetupActions.Confirm)
.addStep(SetupActions.Confirm)
// Edit protocol, add labware
.addStep(SetupActions.EditProtocolA)
.addStep(SetupActions.ChoseDeckSlotC2)
.addStep(SetupActions.AddHardwareLabware)
.addStep(SetupActions.ClickLabwareHeader)
.addStep(SetupActions.ClickWellPlatesSection)
// Example function-based step with a parameter
.addStep(SetupActions.SelectLabwareByDisplayName, 'Bio-Rad 96 Well Plate')
.addStep(SetupActions.ChoseDeckSlotC2Labware)
// Liquid adding steps
.addStep(SetupActions.AddLiquid)
.addStep(SetupActions.ClickLiquidButton)
.addStep(SetupActions.DefineLiquid)
.addStep(SetupActions.LiquidSaveWIP)
.addStep(SetupActions.WellSelector, ['A1', 'A2'])
.addStep(SetupActions.LiquidDropdown)
.addStep(SetupVerifications.LiquidPage)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.SelectLiquidWells)
.addStep(SetupActions.SetVolumeAndSaveforWells)
// Additional deck edits
.addStep(SetupActions.ChoseDeckSlotC1)
.addStep(SetupActions.EditHardwareLabwareOnDeck)
.addStep(SetupActions.ClickLabwareHeader)
.addStep(SetupActions.AddAdapters)
.addStep(SetupActions.DeepWellTempModAdapter)
.addStep(SetupActions.AddNest96DeepWellPlate)
.addStep(SetupActions.SelectDone)
.addStep(SetupActions.ProtocolStepsH)
.addStep(SetupActions.AddStep)
// Modules (temp deck) steps
.addStep(ModActions.AddTemperatureStep)
.addStep(ModVerifications.TempeDeckInitialForm)
.addStep(UniversalActions.Snapshot)
.addStep(ModActions.ActivateTempdeck)
.addStep(ModActions.InputTempDeck4)
.addStep(ModActions.SaveButtonTempdeck)
.addStep(ModActions.PauseAfterSettingTempdeck)
// Possibly verifying
// .addStep(ModVerifications.Temp4CPauseTextVerification)
.addStep(UniversalActions.Snapshot)
// Another temperature step
.addStep(SetupActions.AddStep)
.addStep(ModActions.AddTemperatureStep)
.addStep(ModActions.ActivateTempdeck)
.addStep(ModActions.InputTempDeck95)
.addStep(ModActions.SaveButtonTempdeck)
.addStep(ModActions.PauseAfterSettingTempdeck)
// Another temperature step
.addStep(SetupActions.AddStep)
.addStep(ModActions.AddTemperatureStep)
.addStep(ModActions.ActivateTempdeck)
.addStep(ModActions.InputTempDeck100)
.build()

runSteps(steps)
})
})
50 changes: 26 additions & 24 deletions protocol-designer/cypress/e2e/createNew.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SetupVerifications, SetupActions } from '../support/SetupSteps'
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { StepsList, runSteps } from '../support/StepExecution'
import { UniversalActions } from '../support/universalActions'
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { StepListBuilder, runSteps } from '../support/StepExecution'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
Expand All @@ -12,28 +12,30 @@ describe('The Redesigned Create Protocol Landing Page', () => {
it('content and step 1 flow works', () => {
cy.verifyCreateNewHeader()
cy.clickCreateNew()
const steps: StepsList = [
{ step: SetupVerifications.OnStep1 },
{ step: SetupVerifications.FlexSelected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.SelectOT2 },
{ step: SetupVerifications.OT2Selected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.SelectFlex },
{ step: SetupVerifications.FlexSelected },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.OnStep2 },
{ step: SetupVerifications.NinetySixChannel },
{ step: UniversalActions.Snapshot },
{ step: SetupActions.GoBack },
{ step: SetupVerifications.OnStep1 },
{ step: SetupActions.SelectOT2 },
{ step: SetupActions.Confirm },
{ step: SetupVerifications.OnStep2 },
{ step: SetupVerifications.NotNinetySixChannel },
{ step: UniversalActions.Snapshot },
]

const steps = new StepListBuilder()
.addStep(SetupVerifications.OnStep1)
.addStep(SetupVerifications.FlexSelected)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.SelectOT2)
.addStep(SetupVerifications.OT2Selected)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.SelectFlex)
.addStep(SetupVerifications.FlexSelected)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.Confirm)
.addStep(SetupVerifications.OnStep2)
.addStep(SetupVerifications.NinetySixChannel)
.addStep(UniversalActions.Snapshot)
.addStep(SetupActions.GoBack)
.addStep(SetupVerifications.OnStep1)
.addStep(SetupActions.SelectOT2)
.addStep(SetupActions.Confirm)
.addStep(SetupVerifications.OnStep2)
.addStep(SetupVerifications.NotNinetySixChannel)
.addStep(UniversalActions.Snapshot)
.build()

runSteps(steps)
})
})
Loading

0 comments on commit 3c02d50

Please sign in to comment.