Skip to content

Commit cedf49e

Browse files
committed
Adding fixtures for the OT-2 pipetting steps
1 parent 39fd00c commit cedf49e

File tree

10 files changed

+41287
-262
lines changed

10 files changed

+41287
-262
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { CompositeSetupSteps, SetupSteps } from '../support/SetupSteps'
2+
import { StepBuilder } from '../support/StepBuilder'
3+
import { getTestFile, TestFilePath } from '../support/TestFiles'
4+
5+
describe('P20 single-channel OT-2 Transfers', () => {
6+
beforeEach(() => {
7+
console.log('enablePrereleaseMode()')
8+
cy.visit('/')
9+
cy.verifyHomePage()
10+
cy.closeAnalyticsModal()
11+
cy.window().then(win => {
12+
if (typeof win.enablePrereleaseMode === 'function') {
13+
console.log('Calling enablePrereleaseMode()') // Optional: Keep the console log for visual confirmation in the test runner
14+
win.enablePrereleaseMode()
15+
} else {
16+
console.warn(
17+
'Warning: enablePrereleaseMode function not found on the window object.'
18+
)
19+
}
20+
})
21+
})
22+
/**
23+
* It covers all combinations of the predefined liquid classes and volumes (12 total transfers).
24+
* Each transfer uses a sequential well from A1 to A12.
25+
* The source and destination labware sets alternate for each transfer.
26+
*
27+
* @param steps The StepBuilder instance to add steps to.
28+
* @param sourceLabware1 The first source labware name (e.g., 'Thermo Scientific Nunc 96 Well Plate 2000 µL').
29+
* @param sourceLabware2 The second source labware name (e.g., 'Thermo Scientific Nunc 96 Well Plate 1300 µL').
30+
* @param destinationLabware1 The first destination labware name (e.g., 'USA Scientific 96 Deep Well Plate 2.4 mL').
31+
* @param destinationLabware2 The second destination labware name (e.g., 'NEST 96 Deep Well Plate 2mL').
32+
*/
33+
const GenerateMultipleTransferStepsForP20SingleChannel = (
34+
steps: StepBuilder,
35+
sourceLabware1: string,
36+
sourceLabware2: string,
37+
destinationLabware1: string,
38+
destinationLabware2: string
39+
) => {
40+
const tip: string = '20' // Fixed tip for P20
41+
const volumes: string[] = ['1', '10', '20'] // Fixed volumes for P20
42+
43+
const row: string = 'A' // Fixed row for 8-channel operation
44+
const colsLength: number = 12 // Max columns in a row (A1-A12)
45+
46+
// Define the two labware pairs for alternation
47+
const labwarePairs = [
48+
{ source: sourceLabware1, dest: destinationLabware1 }, // Pair for odd-indexed transfers
49+
{ source: sourceLabware2, dest: destinationLabware2 }, // Pair for even-indexed transfers
50+
]
51+
52+
let transferCounter = 0 // This counter will go from 0 to 11 (for 12 total transfers)
53+
54+
for (const volume of volumes) {
55+
// Determine which labware pair to use for this specific transfer
56+
// (0 for the first pair, 1 for the second, then back to 0, etc.)
57+
const currentLabwarePair = labwarePairs[transferCounter % 2]
58+
59+
// Determine the current well within the 'A' row (A1, A2, ..., A12)
60+
const colIndex = (transferCounter % colsLength) + 1
61+
const currentWell = `${row}${colIndex}`
62+
63+
// Add the transfer step
64+
steps.add(
65+
CompositeSetupSteps.Test_LC_new_rectangleOT2(
66+
// Use Test_LC (assuming it's the updated version with shape params)
67+
currentLabwarePair.source,
68+
currentWell,
69+
currentLabwarePair.dest,
70+
currentWell,
71+
volume,
72+
tip,
73+
'circle', // Assuming source wells are circles for this test
74+
'rect' // Assuming destination wells are rectangles for this test
75+
)
76+
)
77+
transferCounter++ // Increment the counter for the next transfer
78+
}
79+
}
80+
81+
it('Goes through onboarding flow and then runs multiple transfer steps with sequential well changes', () => {
82+
const protocol = getTestFile(TestFilePath.GEN2P20SingleOT2)
83+
cy.importProtocol(protocol.path)
84+
cy.contains('Confirm').click()
85+
cy.openSettingsPage()
86+
cy.get('[aria-label="Settings_OT_PD_ENABLE_LIQUID_CLASSES"]').click()
87+
cy.openSettingsPage()
88+
cy.contains('Edit protocol').click()
89+
const steps = new StepBuilder()
90+
GenerateMultipleTransferStepsForP20SingleChannel(
91+
steps,
92+
'Thermo Scientific Nunc 96 Well Plate 2000 µL',
93+
'Thermo Scientific Nunc 96 Well Plate 1300 µL',
94+
'USA Scientific 96 Deep Well Plate 2.4 mL',
95+
'NEST 96 Deep Well Plate 2mL'
96+
)
97+
steps.add(SetupSteps.AddStep())
98+
steps.add(SetupSteps.TransferPopOut())
99+
100+
// Add the multiple transfer steps using the custom function with sequential wells
101+
102+
steps.execute()
103+
})
104+
})
Lines changed: 30 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
1-
import {
2-
CompositeSetupSteps,
3-
SetupSteps,
4-
SetupVerifications,
5-
} from '../support/SetupSteps'
1+
import { CompositeSetupSteps } from '../support/SetupSteps'
62
import { StepBuilder } from '../support/StepBuilder'
73
import { getTestFile, TestFilePath } from '../support/TestFiles'
8-
import { UniversalSteps } from '../support/UniversalSteps'
4+
5+
// import { UniversalSteps } from '../support/UniversalSteps'
96

107
describe('Transfer stepform testing P1000M', () => {
8+
// This is the SINGLE beforeEach block for this describe suite.
119
beforeEach(() => {
1210
console.log('enablePrereleaseMode()')
1311
cy.visit('/')
1412
cy.verifyHomePage()
1513
cy.closeAnalyticsModal()
1614
cy.window().then(win => {
1715
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()')
1917
win.enablePrereleaseMode()
2018
} else {
2119
console.warn(
2220
'Warning: enablePrereleaseMode function not found on the window object.'
2321
)
2422
}
2523
})
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+
2738
/**
2839
* 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) ...
3941
*/
4042
const GenerateMultipleTransferStepsForP10008Channel = (
4143
steps: StepBuilder,
@@ -51,16 +53,15 @@ describe('Transfer stepform testing P1000M', () => {
5153
'Viscous',
5254
'Volatile',
5355
]
54-
const row = 'A' // P1000 8-channel typically operates on a single row (or all rows simultaneously)
56+
const row = 'A'
5557

56-
// Define the two labware sets to alternate between
5758
const labwareSets = [
5859
{ source: sourceLabware1, dest: destinationLabware1 },
5960
{ source: sourceLabware2, dest: destinationLabware2 },
6061
]
6162

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
6465

6566
for (const liquidClass of liquidClasses) {
6667
for (const tip of tips) {
@@ -74,33 +75,28 @@ describe('Transfer stepform testing P1000M', () => {
7475
}
7576

7677
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)
8078
const currentLabwareSetIndex =
8179
Math.floor(transferCounter / colsLength) % labwareSets.length
8280
const currentLabwarePair = labwareSets[currentLabwareSetIndex]
8381

84-
// Determine the column index for the well within the current row 'A'
8582
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}`
8784

8885
steps.add(
8986
CompositeSetupSteps.Test_LC_new_rectangle(
90-
// Assuming Test_LC is the updated function you're using
9187
currentLabwarePair.source,
9288
well,
9389
currentLabwarePair.dest,
9490
well,
9591
volume,
9692
liquidClass,
9793
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'
10096
)
10197
)
10298

103-
transferCounter++ // Increment the counter for the next transfer
99+
transferCounter++
104100
}
105101
}
106102
}
@@ -119,100 +115,9 @@ describe('Transfer stepform testing P1000M', () => {
119115
}
120116

121117
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.
129120
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-
*/
216121

217122
GenerateMultipleTransferStepsForP10008Channel(
218123
steps,
@@ -222,8 +127,7 @@ describe('Transfer stepform testing P1000M', () => {
222127
'NEST 96 Deep Well Plate 2mL'
223128
)
224129

225-
// Add the multiple transfer steps using the custom function with sequential wells
226-
227130
steps.execute()
131+
// Add relevant assertions here to confirm the transfer steps were successfully added.
228132
})
229133
})

protocol-designer/cypress/e2e/P1000STransfer.cy.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -142,32 +142,7 @@ describe('Transfer stepform testing Single Channel P1000uL', () => {
142142
cy.get('[aria-label="Settings_OT_PD_ENABLE_LIQUID_CLASSES"]').click()
143143
cy.openSettingsPage()
144144
cy.contains('Edit protocol').click()
145-
/*
146-
// WORKS FOR REMOVING UNUSED TIP RACKS
147-
cy.contains('Add Step').click()
148-
cy.contains('Move').click()
149-
// source
150-
cy.contains('p', 'Select labware')
151-
.parent()
152-
.parent()
153-
.contains('Choose option')
154-
.click()
155-
cy.contains('B2').click()
156-
// destination
157-
cy.contains('p', 'New location')
158-
.parent()
159-
.parent()
160-
.contains('Choose option')
161-
.click()
162-
cy.contains('D3').click()
163-
cy.contains('Save').click({ force: true })
164-
// BACK THE REGULARLY SCHEDULED PROGRAMMING
165-
*/
166145
const steps = new StepBuilder()
167-
168-
// New Transfer form
169-
170-
// THIS IS THE NEW TRANSFER FORM PLEASE USE
171146
GenerateMultipleTransferStepsForSingleChannel(
172147
steps,
173148
'Thermo Scientific Nunc 96 Well Plate 2000 µL',

0 commit comments

Comments
 (0)