1
- import {
2
- CompositeSetupSteps ,
3
- SetupSteps ,
4
- SetupVerifications ,
5
- } from '../support/SetupSteps'
1
+ import { CompositeSetupSteps } from '../support/SetupSteps'
6
2
import { StepBuilder } from '../support/StepBuilder'
7
3
import { getTestFile , TestFilePath } from '../support/TestFiles'
8
- import { UniversalSteps } from '../support/UniversalSteps'
4
+
5
+ // import { UniversalSteps } from '../support/UniversalSteps'
9
6
10
7
describe ( 'Transfer stepform testing P1000M' , ( ) => {
8
+ // This is the SINGLE beforeEach block for this describe suite.
11
9
beforeEach ( ( ) => {
12
10
console . log ( 'enablePrereleaseMode()' )
13
11
cy . visit ( '/' )
14
12
cy . verifyHomePage ( )
15
13
cy . closeAnalyticsModal ( )
16
14
cy . window ( ) . then ( win => {
17
15
if ( typeof win . enablePrereleaseMode === 'function' ) {
18
- console . log ( 'Calling enablePrereleaseMode()' ) // Optional: Keep the console log for visual confirmation in the test runner
16
+ console . log ( 'Calling enablePrereleaseMode()' )
19
17
win . enablePrereleaseMode ( )
20
18
} else {
21
19
console . warn (
22
20
'Warning: enablePrereleaseMode function not found on the window object.'
23
21
)
24
22
}
25
23
} )
26
- } )
24
+
25
+ // This is the "COMMON SETUP FOR IT BLOCKS" that should run once
26
+ // before each 'it' block, directly within this beforeEach.
27
+ const protocol = getTestFile ( TestFilePath . P1000MTransferMulti )
28
+ cy . importProtocol ( protocol . path )
29
+ cy . contains ( 'Confirm' ) . click ( )
30
+ cy . openSettingsPage ( )
31
+ cy . get ( '[aria-label="Settings_OT_PD_ENABLE_LIQUID_CLASSES"]' ) . click ( )
32
+ cy . openSettingsPage ( )
33
+ cy . contains ( 'Edit protocol' ) . click ( )
34
+ // Add an assertion to confirm we are in the expected state, e.g.,
35
+ cy . contains ( 'Add Step' ) . should ( 'be.visible' )
36
+ } ) // <--- The beforeEach block ends here. No nested beforeEach.
37
+
27
38
/**
28
39
* Generates multiple transfer steps for a P1000 8-channel pipette.
29
- * It iterates through all combinations of liquid classes, tip sizes, and volumes (36 total).
30
- * For wells, it uses row 'A' and increments columns (A1, A2,...A12, then loops back to A1 for the next set).
31
- * It alternates between two predefined source/destination labware sets every 12 transfers,
32
- * simulating switching labware for subsequent 'columns' of transfers.
33
- *
34
- * @param steps The StepBuilder instance to add steps to.
35
- * @param sourceLabware1 The first source labware name.
36
- * @param sourceLabware2 The second source labware name.
37
- * @param destinationLabware1 The first destination labware name.
38
- * @param destinationLabware2 The second destination labware name.
40
+ * ... (rest of your function remains the same) ...
39
41
*/
40
42
const GenerateMultipleTransferStepsForP10008Channel = (
41
43
steps : StepBuilder ,
@@ -51,16 +53,15 @@ describe('Transfer stepform testing P1000M', () => {
51
53
'Viscous' ,
52
54
'Volatile' ,
53
55
]
54
- const row = 'A' // P1000 8-channel typically operates on a single row (or all rows simultaneously)
56
+ const row = 'A'
55
57
56
- // Define the two labware sets to alternate between
57
58
const labwareSets = [
58
59
{ source : sourceLabware1 , dest : destinationLabware1 } ,
59
60
{ source : sourceLabware2 , dest : destinationLabware2 } ,
60
61
]
61
62
62
- const colsLength = 12 // Number of columns in a 96-well plate row
63
- let transferCounter = 0 // This will count from 0 to 35 (for 36 total steps)
63
+ const colsLength = 12
64
+ let transferCounter = 0
64
65
65
66
for ( const liquidClass of liquidClasses ) {
66
67
for ( const tip of tips ) {
@@ -74,33 +75,28 @@ describe('Transfer stepform testing P1000M', () => {
74
75
}
75
76
76
77
for ( const volume of volumes ) {
77
- // --- Logic for labware alternation and well indexing ---
78
- // Determine which labware set to use based on blocks of 'colsLength' transfers
79
- // (e.g., transfers 0-11 use set 0, transfers 12-23 use set 1, transfers 24-35 use set 0)
80
78
const currentLabwareSetIndex =
81
79
Math . floor ( transferCounter / colsLength ) % labwareSets . length
82
80
const currentLabwarePair = labwareSets [ currentLabwareSetIndex ]
83
81
84
- // Determine the column index for the well within the current row 'A'
85
82
const colIndex = ( transferCounter % colsLength ) + 1
86
- const well = `${ row } ${ colIndex } ` // Well will be A1, A2, ..., A12, then A1, A2, ... A12 again, etc.
83
+ const well = `${ row } ${ colIndex } `
87
84
88
85
steps . add (
89
86
CompositeSetupSteps . Test_LC_new_rectangle (
90
- // Assuming Test_LC is the updated function you're using
91
87
currentLabwarePair . source ,
92
88
well ,
93
89
currentLabwarePair . dest ,
94
90
well ,
95
91
volume ,
96
92
liquidClass ,
97
93
tip ,
98
- 'circle' , // Assuming source wells are circles for this test
99
- 'rect' // Assuming destination wells are rectangles for this test
94
+ 'circle' ,
95
+ 'rect'
100
96
)
101
97
)
102
98
103
- transferCounter ++ // Increment the counter for the next transfer
99
+ transferCounter ++
104
100
}
105
101
}
106
102
}
@@ -119,100 +115,9 @@ describe('Transfer stepform testing P1000M', () => {
119
115
}
120
116
121
117
it ( 'Goes through onboarding flow and then runs multiple transfer steps with sequential well changes' , ( ) => {
122
- const protocol = getTestFile ( TestFilePath . P1000MTransferMulti )
123
- cy . importProtocol ( protocol . path )
124
- cy . contains ( 'Confirm' ) . click ( )
125
- cy . openSettingsPage ( )
126
- cy . get ( '[aria-label="Settings_OT_PD_ENABLE_LIQUID_CLASSES"]' ) . click ( )
127
- cy . openSettingsPage ( )
128
- cy . contains ( 'Edit protocol' ) . click ( )
118
+ // This 'it' block will now start with the application already in the
119
+ // protocol editing state, due to the single beforeEach above.
129
120
const steps = new StepBuilder ( )
130
- /*
131
- Old E2E version of the test
132
- steps.add(SetupVerifications.OnStep1())
133
- steps.add(SetupVerifications.FlexSelected())
134
- steps.add(SetupVerifications.OnStep2())
135
- steps.add(SetupSteps.EightChannelPipette1000())
136
- steps.add(SetupSteps.Save())
137
- steps.add(SetupSteps.YesGripper())
138
- steps.add(SetupSteps.NoThermocycler())
139
- steps.add(SetupSteps.NoWasteChute())
140
- steps.add(SetupSteps.Confirm())
141
- steps.add(SetupSteps.Confirm())
142
- steps.add(SetupSteps.Confirm())
143
- steps.add(SetupSteps.EditProtocolA())
144
- steps.add(
145
- CompositeSetupSteps.AddTiprackToDeckSlot(
146
- 'A1',
147
- 'Opentrons Flex 96 Filter Tip Rack 1000 µL'
148
- )
149
- )
150
- steps.add(
151
- CompositeSetupSteps.AddTiprackToDeckSlot(
152
- 'B1',
153
- 'Opentrons Flex 96 Filter Tip Rack 200 µL'
154
- )
155
- )
156
-
157
- steps.add(
158
- CompositeSetupSteps.AddTiprackToDeckSlot(
159
- 'B3',
160
- 'Opentrons Flex 96 Filter Tip Rack 50 µL'
161
- )
162
- )
163
-
164
- steps.add(
165
- CompositeSetupSteps.AddLabwareToDeckSlot(
166
- 'C1',
167
- 'Thermo Scientific Nunc 96 Well Plate 1300 µL'
168
- )
169
- )
170
- steps.add(SetupSteps.ChoseDeckSlotC1Labware())
171
- steps.add(SetupSteps.AddLiquid())
172
- steps.add(SetupSteps.ClickLiquidButton())
173
- steps.add(SetupSteps.DefineLiquid())
174
- steps.add(SetupSteps.LiquidSaveWIP())
175
- const allWellsForLiquid: string[] = getAllWells()
176
- steps.add(SetupSteps.WellSelector(allWellsForLiquid))
177
- steps.add(SetupSteps.LiquidDropdown())
178
- steps.add(SetupVerifications.LiquidPage())
179
- steps.add(UniversalSteps.Snapshot())
180
- steps.add(SetupSteps.SelectLiquidWells())
181
- steps.add(SetupSteps.SetVolumeAndSaveForWells('1100'))
182
-
183
- steps.add(
184
- CompositeSetupSteps.AddLabwareToDeckSlot(
185
- 'C3',
186
- 'Thermo Scientific Nunc 96 Well Plate 2000 µL'
187
- )
188
- )
189
- steps.add(SetupSteps.ChoseDeckSlotWithLabware('C3'))
190
- steps.add(SetupSteps.AddLiquid())
191
- steps.add(SetupSteps.ClickLiquidButton())
192
- steps.add(SetupSteps.WellSelector(allWellsForLiquid))
193
- steps.add(SetupSteps.LiquidDropdown())
194
- steps.add(SetupVerifications.LiquidPage())
195
- steps.add(UniversalSteps.Snapshot())
196
- steps.add(SetupSteps.SelectLiquidWells())
197
- // steps.add(SetupSteps.LiquidDropdown())
198
- // steps.add(SetupVerifications.LiquidPage())
199
- // steps.add(UniversalSteps.Snapshot())
200
- steps.add(SetupSteps.selectLiquidbyname('My liquid!'))
201
- steps.add(SetupSteps.SetVolumeAndSaveForWells('1100'))
202
-
203
- steps.add(
204
- CompositeSetupSteps.AddLabwareToDeckSlot(
205
- 'D2',
206
- 'Opentrons Tough 96 Well Plate 200 µL PCR Full Skirt'
207
- )
208
- )
209
- steps.add(
210
- CompositeSetupSteps.AddLabwareToDeckSlot(
211
- 'D1',
212
- 'Armadillo 96 Well Plate 200 µL PCR Full Skirt'
213
- )
214
- )
215
- */
216
121
217
122
GenerateMultipleTransferStepsForP10008Channel (
218
123
steps ,
@@ -222,8 +127,7 @@ describe('Transfer stepform testing P1000M', () => {
222
127
'NEST 96 Deep Well Plate 2mL'
223
128
)
224
129
225
- // Add the multiple transfer steps using the custom function with sequential wells
226
-
227
130
steps . execute ( )
131
+ // Add relevant assertions here to confirm the transfer steps were successfully added.
228
132
} )
229
133
} )
0 commit comments