-
Notifications
You must be signed in to change notification settings - Fork 175
/
transferSettings.spec.js
403 lines (342 loc) · 16.3 KB
/
transferSettings.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
const isMacOSX = Cypress.platform === 'darwin'
const batchEditClickOptions = { [isMacOSX ? 'metaKey' : 'ctrlKey']: true }
const invalidInput = 'abcdefghijklmnopqrstuvwxyz!@#$%^&*()<>?,-'
function importProtocol() {
cy.fixture('../../fixtures/protocol/5/transferSettings.json').then(
fileContent => {
cy.get('input[type=file]').upload({
fileContent: JSON.stringify(fileContent),
fileName: 'fixture.json',
mimeType: 'application/json',
encoding: 'utf8',
})
cy.get('[data-test="ComputingSpinner"]').should('exist')
cy.get('div')
.contains(
'We have added new features since the last time this protocol was updated, but have not made any changes to existing protocol behavior'
)
.should('exist')
cy.get('button').contains('ok', { matchCase: false }).click()
// wait until computation is done before proceeding, with generous timeout
cy.get('[data-test="ComputingSpinner"]', { timeout: 30000 }).should(
'not.exist'
)
}
)
}
function openDesignTab() {
cy.get('button[id=NavTab_design]').click()
cy.get('button').contains('ok').click()
// Verify the Design Page
cy.get('#TitleBar_main > h1').contains('Multi select banner test protocol')
cy.get('#TitleBar_main > h2').contains('STARTING DECK STATE')
cy.get('button[id=StepCreationButton]').contains('+ Add Step')
}
function enterBatchEdit() {
cy.get('[data-test="StepItem_1"]').click(batchEditClickOptions)
cy.get('button').contains('exit batch edit').should('exist')
}
describe('Advanced Settings for Transfer Form', () => {
before(() => {
cy.visit('/')
cy.get('button').contains('Create new OT-2 protocol').click()
cy.closeAnnouncementModal()
importProtocol()
openDesignTab()
})
it('Verify functionality of advanced settings with different pipette and labware', () => {
enterBatchEdit()
// Different Pipette disbales aspirate and dispense Flowrate and Mix settings
// step 6 has different pipette than step 1
cy.get('[data-test="StepItem_6"]').click(batchEditClickOptions)
// Pre-wet tip is always enabled
cy.get('input[name="preWetTip"]').should('be.enabled')
// well-order is always enabled
cy.get('[id=WellOrderField_button_aspirate]').should('be.visible')
// Aspirate Flowrate and mix disabled
cy.get('input[name="aspirate_flowRate"]').should('be.disabled')
cy.get('input[name="aspirate_mix_checkbox"]').should('be.disabled')
// TipPosition Aspirate and Dispense should be disabled
cy.get('[id=TipPositionField_aspirate_mmFromBottom]').should('be.disabled')
cy.get('[id=TipPositionField_dispense_mmFromBottom]').should('be.disabled')
// Dispense Flowrate and mix diabled
cy.get('input[name="dispense_flowRate"]').should('be.disabled')
cy.get('input[name="dispense_mix_checkbox"]').should('be.disabled')
// Delay , Touch tip is disabled
cy.get('input[name="aspirate_delay_checkbox"]').should('be.disabled')
cy.get('input[name="aspirate_touchTip_checkbox"]').should('be.disabled')
// Save button is disabled
cy.get('button').contains('save').should('not.be.enabled')
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('Verify functionality of advanced settings with same pipette and labware', () => {
// click on step 2 in batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// deselecting on step 6 in batch edit mode
cy.get('[data-test="StepItem_6"]').click(batchEditClickOptions)
// click on step 3 , as step 2 & 3 have same pipette and labware
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
// Aspirate Flowrate and mix are enabled
cy.get('input[name="aspirate_flowRate"]').should('be.enabled')
cy.get('input[name="aspirate_mix_checkbox"]').should('be.enabled')
// Dispense Flowrate and mix are enabled
cy.get('input[name="dispense_flowRate"]').should('be.enabled')
cy.get('input[name="dispense_mix_checkbox"]').should('be.enabled')
// Verify invalid input in one of the fields
cy.get('input[name="dispense_mix_checkbox"]').click({ force: true })
cy.get('input[name="dispense_mix_volume"]')
.type(invalidInput)
.should('be.empty')
// TipPosition Aspirate and Dispense should be enabled
cy.get('[id=TipPositionField_aspirate_mmFromBottom]').should('be.enabled')
cy.get('[id=TipPositionField_dispense_mmFromBottom]').should('be.enabled')
// Delay in aspirate and Dispense settings is enabled
cy.get('input[name="aspirate_delay_checkbox"]').should('be.enabled')
cy.get('input[name="dispense_delay_checkbox"]').should('be.enabled')
// Touchtip in aspirate and Dispense settings is enabled
cy.get('input[name="aspirate_touchTip_checkbox"]').should('be.enabled')
cy.get('input[name="dispense_touchTip_checkbox"]').should('be.enabled')
// Blowout in dispense settings is enabled
cy.get('input[name="blowout_checkbox"]').should('be.enabled')
cy.get('button').contains('discard changes').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify flowrate indeterminate value', () => {
// click on step 2 in batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
cy.get('input[name="aspirate_flowRate"]').click({ force: true })
cy.get('div[class*=FlowRateInput__description]').contains(
'Our default aspirate speed is optimal for a P1000 Single-Channel GEN2 aspirating liquids with a viscosity similar to water'
)
cy.get('input[name="aspirate_flowRate_customFlowRate"]').type('100')
cy.get('button').contains('Done').click()
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 4 as it has flowrate set to 100 from previous testcase
cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions)
// indeterminate state in flowrate is empty
cy.get('input[name="aspirate_flowRate"]').should('have.value', '')
})
it('verify functionality of flowrate in batch edit transfer', () => {
// Batch editing the Flowrate value
cy.get('input[name="aspirate_flowRate"]').click({ force: true })
cy.get('div[class*=FlowRateInput__description]').contains(
'Our default aspirate speed is optimal for a P1000 Single-Channel GEN2 aspirating liquids with a viscosity similar to water'
)
cy.get('input[name="aspirate_flowRate_customFlowRate"]').type('100')
cy.get('button').contains('Done').click()
// Click save button to save the changes
cy.get('button').contains('save').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
// Click on step 2 to verify that flowrate is updated to 100
cy.get('[data-test="StepItem_2"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that flowrate value
cy.get('input[name="aspirate_flowRate"]').should('have.value', 100)
// Click on step 3 to verify that flowrate is updated to 100
cy.get('[data-test="StepItem_3"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that flowrate value
cy.get('input[name="aspirate_flowRate"]').should('have.value', 100)
})
it('verify prewet tip indeterminate value', () => {
// Click on step 2, to enter batch edit and enable prewet tip
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// enable pre-wet tip
cy.togglePreWetTip()
cy.get('input[name="preWetTip"]').should('be.visible')
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 1, as it does not have prewet-tip selected - indeteminate state
cy.get('[data-test="StepItem_1"]').click(batchEditClickOptions)
// Check tooltip here
cy.contains('pre-wet tip').trigger('pointerover')
cy.get('div[role="tooltip"]').should(
'contain',
'Not all selected steps are using this setting'
)
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify mix settings indeterminate value', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions)
// Select mix settings
cy.mixaspirate()
cy.get('input[name="aspirate_mix_volume"]').type('10')
cy.get('input[name="aspirate_mix_times"]').type('2')
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 3 to generate indertminate state for mix settings.
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
// Verify the tooltip here
cy.contains('mix').trigger('pointerover')
cy.get('div[role="tooltip"]').should(
'contain',
'Not all selected steps are using this setting'
)
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify mix settings batch editing in transfer form', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Click on step 3 to batch edit mix settings
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
cy.get('input[name="aspirate_mix_checkbox"]').click({ force: true })
// Select mix settings
cy.get('input[name="aspirate_mix_volume"]').type('10')
cy.get('input[name="aspirate_mix_times"]').type('2')
// Click save button to save the changes
cy.get('button').contains('save').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
// Click on step 2 to verify that mix has volume set to 10 with 2 repitititons
cy.get('[data-test="StepItem_2"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that volume is set to 10 and repitions to 2
cy.get('input[name="aspirate_mix_volume"]').should('have.value', 10)
cy.get('input[name="aspirate_mix_times"]').should('have.value', 2)
})
it('verify delay settings indeterminate value', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Select delay settings
cy.get('input[name="aspirate_delay_checkbox"]')
.check({ force: true })
.should('be.checked')
cy.get('input[name="aspirate_delay_seconds"]').type('2')
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 3 to generate indertminate state for delay settings.
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
// Verify the tooltip here
cy.contains('delay').trigger('pointerover')
cy.get('div[role="tooltip"]').should(
'contain',
'Not all selected steps are using this setting'
)
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify delay settings batch editing in transfer form', () => {
// Click on step 4, to enter batch edit mode
cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions)
// Click on step 5 to batch edit mix settings
cy.get('[data-test="StepItem_5"]').click(batchEditClickOptions)
// Select delay settings
cy.get('input[name="aspirate_delay_checkbox"]').click({ force: true })
cy.get('input[name="aspirate_delay_seconds"]').clear().type('2')
// Click save button to save the changes
cy.get('button').contains('save').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
// Click on step 4 to verify that delay has volume set to 2
cy.get('[data-test="StepItem_4"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that volume is set to 2 and repitions to 2
cy.get('input[name="aspirate_delay_seconds"]').should('have.value', 2)
// Click on step 5 to verify that delay has volume set to 2
cy.get('[data-test="StepItem_5"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that volume is set to 2 and repitions to 2
cy.get('input[name="aspirate_delay_seconds"]').should('have.value', 2)
})
it('verify touchTip settings indeterminate value', () => {
cy.get('[data-test="StepItem_2"]').click()
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Select touchTip settings
cy.get('input[name="aspirate_touchTip_checkbox"]').click({ force: true })
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 5 to generate indertminate state for touchTip settings.
cy.get('[data-test="StepItem_5"]').click(batchEditClickOptions)
// Verify the tooltip here
cy.contains('touch tip').trigger('pointerover')
cy.get('div[role="tooltip"]').should(
'contain',
'Not all selected steps are using this setting'
)
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify touchTip settings batch editing in transfer form', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Click on step 3 to batch edit mix settings
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
// Select touchTip settings
cy.get('input[name="aspirate_touchTip_checkbox"]').click({ force: true })
// cy.get('[id=TipPositionModal_custom_input]').type(15)
// Click save button to save the changes
cy.get('button').contains('save').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
// Click on step 2 to verify that touchTip has volume set to 2
cy.get('[data-test="StepItem_2"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that volume is set
cy.get('[id=TipPositionField_aspirate_touchTip_mmFromBottom]').should(
'have.value',
24
)
// Click on step 3 to verify that touchTip has volume set
cy.get('[data-test="StepItem_3"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that volume is set
cy.get('[id=TipPositionField_aspirate_touchTip_mmFromBottom]').should(
'have.value',
24
)
})
it('verify blowout settings indeterminate value', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Select blowout settings
cy.get('input[name="blowout_checkbox"]').click({ force: true })
// Click save button to save the changes
cy.get('button').contains('save').click()
// Click on step 4 to generate indertminate state for blowout settings.
cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions)
// Verify the tooltip here
cy.contains('blowout').trigger('pointerover')
cy.get('div[role="tooltip"]').should(
'contain',
'Not all selected steps are using this setting'
)
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
})
it('verify blowout settings batch editing in transfer form', () => {
// Click on step 2, to enter batch edit mode
cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions)
// Click on step 3 to batch edit mix settings
cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions)
// Select blowout settings
cy.get('input[name="blowout_checkbox"]').click({ force: true })
// Click save button to save the changes
cy.get('button').contains('save').click()
// Exit batch edit mode
cy.get('button').contains('exit batch edit').click()
// Click on step 2 to verify that blowout has trash selected
cy.get('[data-test="StepItem_2"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that fixedTrash is selected
cy.get('[id=BlowoutLocationField_dropdown]').should(
'have.value',
'fixedTrash'
)
// Click on step 3 to verify the batch editing
cy.get('[data-test="StepItem_3"]').click()
cy.get('button[id="AspDispSection_settings_button_aspirate"]').click()
// Verify that trash is selected for the blowout option
cy.get('[id=BlowoutLocationField_dropdown]').should(
'have.value',
'fixedTrash'
)
})
})