Skip to content

Commit 3c02d50

Browse files
committed
better
1 parent 91cbe53 commit 3c02d50

File tree

9 files changed

+712
-579
lines changed

9 files changed

+712
-579
lines changed
Lines changed: 100 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import {
2-
SetupActions,
3-
setupFunctions,
4-
SetupVerifications,
5-
} from '../support/SetupSteps'
1+
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
62
import { UniversalActions } from '../support/universalActions'
73
import { ModActions, ModVerifications } from '../support/SupportModules'
8-
import { runSteps } from '../support/StepExecution'
9-
import type { StepsList } from '../support/StepExecution'
4+
// Updated import to bring in StepListBuilder instead of StepsList
5+
import { runSteps, StepListBuilder } from '../support/StepExecution'
106

117
describe('The Redesigned Create Protocol Landing Page', () => {
128
beforeEach(() => {
@@ -18,89 +14,103 @@ describe('The Redesigned Create Protocol Landing Page', () => {
1814
it('content and step 1 flow works', () => {
1915
cy.clickCreateNew()
2016
cy.verifyCreateNewHeader()
21-
const steps: StepsList = [
22-
{ step: SetupVerifications.OnStep1 },
23-
{ step: SetupVerifications.FlexSelected },
24-
{ step: UniversalActions.Snapshot },
25-
{ step: SetupActions.SelectOT2 },
26-
{ step: SetupVerifications.OT2Selected },
27-
{ step: UniversalActions.Snapshot },
28-
{ step: SetupActions.SelectFlex },
29-
{ step: SetupVerifications.FlexSelected },
30-
{ step: UniversalActions.Snapshot },
31-
{ step: SetupActions.Confirm },
32-
{ step: SetupVerifications.OnStep2 },
33-
{ step: SetupActions.SingleChannelPipette50 },
34-
{ step: SetupVerifications.StepTwo50uL },
35-
{ step: UniversalActions.Snapshot },
36-
{ step: SetupActions.Confirm },
37-
{ step: SetupVerifications.StepTwoPart3 },
38-
{ step: UniversalActions.Snapshot },
39-
{ step: SetupActions.Confirm },
40-
{ step: SetupVerifications.OnStep3 },
41-
{ step: SetupActions.YesGripper },
42-
{ step: SetupActions.Confirm },
43-
{ step: SetupVerifications.Step4Verification },
44-
{ step: SetupActions.AddThermocycler },
45-
{ step: SetupVerifications.ThermocyclerImg },
46-
{ step: SetupActions.AddHeaterShaker },
47-
{ step: SetupVerifications.HeaterShakerImg },
48-
{ step: SetupActions.AddMagBlock },
49-
{ step: SetupVerifications.MagBlockImg },
50-
{ step: SetupActions.AddTempdeck2 },
51-
{ step: SetupVerifications.Tempdeck2Img },
52-
{ step: SetupActions.Confirm },
53-
{ step: SetupActions.Confirm },
54-
{ step: SetupActions.Confirm },
55-
{ step: SetupActions.EditProtocolA },
56-
{ step: SetupActions.ChoseDeckSlotC2 },
57-
{ step: SetupActions.AddHardwareLabware },
58-
{ step: SetupActions.ClickLabwareHeader },
59-
{ step: SetupActions.ClickWellPlatesSection },
60-
{
61-
step: setupFunctions.selectLabwareByDisplayName,
62-
params: 'Bio-Rad 96 Well Plate',
63-
},
64-
{ step: SetupActions.ChoseDeckSlotC2Labware },
65-
{ step: SetupActions.AddLiquid },
66-
{ step: SetupActions.ClickLiquidButton },
67-
{ step: SetupActions.DefineLiquid },
68-
{ step: SetupActions.LiquidSaveWIP },
69-
{ step: SetupActions.WellSelector },
70-
{ step: SetupActions.LiquidDropdown },
71-
{ step: SetupVerifications.LiquidPage },
72-
{ step: UniversalActions.Snapshot },
73-
{ step: SetupActions.SelectLiquidWells },
74-
{ step: SetupActions.SetVolumeAndSaveforWells },
75-
{ step: SetupActions.ChoseDeckSlotC1 },
76-
{ step: SetupActions.EditHardwareLabwareOnDeck },
77-
{ step: SetupActions.ClickLabwareHeader },
78-
{ step: SetupActions.AddAdapters },
79-
{ step: SetupActions.DeepWellTempModAdapter },
80-
{ step: SetupActions.AddNest96DeepWellPlate },
81-
{ step: SetupActions.Done },
82-
{ step: SetupActions.ProtocolStepsH },
83-
{ step: SetupActions.AddStep },
84-
{ step: ModActions.AddTemperatureStep },
85-
{ step: ModVerifications.TempeDeckInitialForm },
86-
{ step: UniversalActions.Snapshot },
87-
{ step: ModActions.ActivateTempdeck },
88-
{ step: ModActions.InputTempDeck4 },
89-
{ step: ModActions.SaveButtonTempdeck },
90-
{ step: ModActions.PauseAfterSettingTempdeck },
91-
// ModVerifications.Temp4CPauseTextVerification}
92-
{ step: UniversalActions.Snapshot },
93-
{ step: SetupActions.AddStep },
94-
{ step: ModActions.AddTemperatureStep },
95-
{ step: ModActions.ActivateTempdeck },
96-
{ step: ModActions.InputTempDeck95 },
97-
{ step: ModActions.SaveButtonTempdeck },
98-
{ step: ModActions.PauseAfterSettingTempdeck },
99-
{ step: SetupActions.AddStep },
100-
{ step: ModActions.AddTemperatureStep },
101-
{ step: ModActions.ActivateTempdeck },
102-
{ step: ModActions.InputTempDeck100 },
103-
]
17+
18+
const steps = new StepListBuilder()
19+
// Verification steps
20+
.addStep(SetupVerifications.OnStep1)
21+
.addStep(SetupVerifications.FlexSelected)
22+
.addStep(UniversalActions.Snapshot)
23+
// Switching between OT2 and Flex
24+
.addStep(SetupActions.SelectOT2)
25+
.addStep(SetupVerifications.OT2Selected)
26+
.addStep(UniversalActions.Snapshot)
27+
.addStep(SetupActions.SelectFlex)
28+
.addStep(SetupVerifications.FlexSelected)
29+
.addStep(UniversalActions.Snapshot)
30+
// Confirm moves to step2
31+
.addStep(SetupActions.Confirm)
32+
.addStep(SetupVerifications.OnStep2)
33+
// Choose pipette
34+
.addStep(SetupActions.SingleChannelPipette50)
35+
.addStep(SetupVerifications.StepTwo50uL)
36+
.addStep(UniversalActions.Snapshot)
37+
.addStep(SetupActions.Confirm)
38+
.addStep(SetupVerifications.StepTwoPart3)
39+
.addStep(UniversalActions.Snapshot)
40+
.addStep(SetupActions.Confirm)
41+
// Move to step3
42+
.addStep(SetupVerifications.OnStep3)
43+
.addStep(SetupActions.YesGripper)
44+
.addStep(SetupActions.Confirm)
45+
// Step4: add modules
46+
.addStep(SetupVerifications.Step4Verification)
47+
.addStep(SetupActions.AddThermocycler)
48+
.addStep(SetupVerifications.ThermocyclerImg)
49+
.addStep(SetupActions.AddHeaterShaker)
50+
.addStep(SetupVerifications.HeaterShakerImg)
51+
.addStep(SetupActions.AddMagBlock)
52+
.addStep(SetupVerifications.MagBlockImg)
53+
.addStep(SetupActions.AddTempdeck2)
54+
.addStep(SetupVerifications.Tempdeck2Img)
55+
// Confirm a few times to proceed
56+
.addStep(SetupActions.Confirm)
57+
.addStep(SetupActions.Confirm)
58+
.addStep(SetupActions.Confirm)
59+
// Edit protocol, add labware
60+
.addStep(SetupActions.EditProtocolA)
61+
.addStep(SetupActions.ChoseDeckSlotC2)
62+
.addStep(SetupActions.AddHardwareLabware)
63+
.addStep(SetupActions.ClickLabwareHeader)
64+
.addStep(SetupActions.ClickWellPlatesSection)
65+
// Example function-based step with a parameter
66+
.addStep(SetupActions.SelectLabwareByDisplayName, 'Bio-Rad 96 Well Plate')
67+
.addStep(SetupActions.ChoseDeckSlotC2Labware)
68+
// Liquid adding steps
69+
.addStep(SetupActions.AddLiquid)
70+
.addStep(SetupActions.ClickLiquidButton)
71+
.addStep(SetupActions.DefineLiquid)
72+
.addStep(SetupActions.LiquidSaveWIP)
73+
.addStep(SetupActions.WellSelector, ['A1', 'A2'])
74+
.addStep(SetupActions.LiquidDropdown)
75+
.addStep(SetupVerifications.LiquidPage)
76+
.addStep(UniversalActions.Snapshot)
77+
.addStep(SetupActions.SelectLiquidWells)
78+
.addStep(SetupActions.SetVolumeAndSaveforWells)
79+
// Additional deck edits
80+
.addStep(SetupActions.ChoseDeckSlotC1)
81+
.addStep(SetupActions.EditHardwareLabwareOnDeck)
82+
.addStep(SetupActions.ClickLabwareHeader)
83+
.addStep(SetupActions.AddAdapters)
84+
.addStep(SetupActions.DeepWellTempModAdapter)
85+
.addStep(SetupActions.AddNest96DeepWellPlate)
86+
.addStep(SetupActions.SelectDone)
87+
.addStep(SetupActions.ProtocolStepsH)
88+
.addStep(SetupActions.AddStep)
89+
// Modules (temp deck) steps
90+
.addStep(ModActions.AddTemperatureStep)
91+
.addStep(ModVerifications.TempeDeckInitialForm)
92+
.addStep(UniversalActions.Snapshot)
93+
.addStep(ModActions.ActivateTempdeck)
94+
.addStep(ModActions.InputTempDeck4)
95+
.addStep(ModActions.SaveButtonTempdeck)
96+
.addStep(ModActions.PauseAfterSettingTempdeck)
97+
// Possibly verifying
98+
// .addStep(ModVerifications.Temp4CPauseTextVerification)
99+
.addStep(UniversalActions.Snapshot)
100+
// Another temperature step
101+
.addStep(SetupActions.AddStep)
102+
.addStep(ModActions.AddTemperatureStep)
103+
.addStep(ModActions.ActivateTempdeck)
104+
.addStep(ModActions.InputTempDeck95)
105+
.addStep(ModActions.SaveButtonTempdeck)
106+
.addStep(ModActions.PauseAfterSettingTempdeck)
107+
// Another temperature step
108+
.addStep(SetupActions.AddStep)
109+
.addStep(ModActions.AddTemperatureStep)
110+
.addStep(ModActions.ActivateTempdeck)
111+
.addStep(ModActions.InputTempDeck100)
112+
.build()
113+
104114
runSteps(steps)
105115
})
106116
})
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SetupVerifications, SetupActions } from '../support/SetupSteps'
2-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
3-
import { StepsList, runSteps } from '../support/StepExecution'
42
import { UniversalActions } from '../support/universalActions'
3+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
4+
import { StepListBuilder, runSteps } from '../support/StepExecution'
55

66
describe('The Redesigned Create Protocol Landing Page', () => {
77
beforeEach(() => {
@@ -12,28 +12,30 @@ describe('The Redesigned Create Protocol Landing Page', () => {
1212
it('content and step 1 flow works', () => {
1313
cy.verifyCreateNewHeader()
1414
cy.clickCreateNew()
15-
const steps: StepsList = [
16-
{ step: SetupVerifications.OnStep1 },
17-
{ step: SetupVerifications.FlexSelected },
18-
{ step: UniversalActions.Snapshot },
19-
{ step: SetupActions.SelectOT2 },
20-
{ step: SetupVerifications.OT2Selected },
21-
{ step: UniversalActions.Snapshot },
22-
{ step: SetupActions.SelectFlex },
23-
{ step: SetupVerifications.FlexSelected },
24-
{ step: UniversalActions.Snapshot },
25-
{ step: SetupActions.Confirm },
26-
{ step: SetupVerifications.OnStep2 },
27-
{ step: SetupVerifications.NinetySixChannel },
28-
{ step: UniversalActions.Snapshot },
29-
{ step: SetupActions.GoBack },
30-
{ step: SetupVerifications.OnStep1 },
31-
{ step: SetupActions.SelectOT2 },
32-
{ step: SetupActions.Confirm },
33-
{ step: SetupVerifications.OnStep2 },
34-
{ step: SetupVerifications.NotNinetySixChannel },
35-
{ step: UniversalActions.Snapshot },
36-
]
15+
16+
const steps = new StepListBuilder()
17+
.addStep(SetupVerifications.OnStep1)
18+
.addStep(SetupVerifications.FlexSelected)
19+
.addStep(UniversalActions.Snapshot)
20+
.addStep(SetupActions.SelectOT2)
21+
.addStep(SetupVerifications.OT2Selected)
22+
.addStep(UniversalActions.Snapshot)
23+
.addStep(SetupActions.SelectFlex)
24+
.addStep(SetupVerifications.FlexSelected)
25+
.addStep(UniversalActions.Snapshot)
26+
.addStep(SetupActions.Confirm)
27+
.addStep(SetupVerifications.OnStep2)
28+
.addStep(SetupVerifications.NinetySixChannel)
29+
.addStep(UniversalActions.Snapshot)
30+
.addStep(SetupActions.GoBack)
31+
.addStep(SetupVerifications.OnStep1)
32+
.addStep(SetupActions.SelectOT2)
33+
.addStep(SetupActions.Confirm)
34+
.addStep(SetupVerifications.OnStep2)
35+
.addStep(SetupVerifications.NotNinetySixChannel)
36+
.addStep(UniversalActions.Snapshot)
37+
.build()
38+
3739
runSteps(steps)
3840
})
3941
})

0 commit comments

Comments
 (0)