Skip to content

Commit 5b6a6ec

Browse files
committed
Fix runtime image select race condition in pipeline test
Wait for runtime image options to be populated before selecting. Cypress .select() does not retry when the option value is missing, causing the test to fail when the properties panel re-renders and the SWR fetch for runtime-images hasn't resolved yet. Signed-off-by: Luciano Resende <lresende@apple.com>
1 parent afd4cd4 commit 5b6a6ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cypress/tests/pipeline.cy.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ describe('Pipeline Editor tests', () => {
207207
);
208208
});
209209
cy.get('#root_component_parameters_runtime_image').within(() => {
210+
cy.get('select[id="root_component_parameters_runtime_image"]')
211+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
212+
.should('exist');
210213
cy.get('select[id="root_component_parameters_runtime_image"]').select(
211214
'continuumio/anaconda3:2024.02-1'
212215
);
@@ -215,6 +218,9 @@ describe('Pipeline Editor tests', () => {
215218
// consumer props
216219
cy.findByText('consumer.ipynb').click();
217220
cy.get('#root_component_parameters_runtime_image').within(() => {
221+
cy.get('select[id="root_component_parameters_runtime_image"]')
222+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
223+
.should('exist');
218224
cy.get('select[id="root_component_parameters_runtime_image"]').select(
219225
'continuumio/anaconda3:2024.02-1'
220226
);
@@ -223,6 +229,9 @@ describe('Pipeline Editor tests', () => {
223229
// setup props
224230
cy.findByText('setup.py').click();
225231
cy.get('#root_component_parameters_runtime_image').within(() => {
232+
cy.get('select[id="root_component_parameters_runtime_image"]')
233+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
234+
.should('exist');
226235
cy.get('select[id="root_component_parameters_runtime_image"]').select(
227236
'continuumio/anaconda3:2024.02-1'
228237
);
@@ -243,6 +252,9 @@ describe('Pipeline Editor tests', () => {
243252
// create-source-files props
244253
cy.findByText('create-source-files.py').click();
245254
cy.get('#root_component_parameters_runtime_image').within(() => {
255+
cy.get('select[id="root_component_parameters_runtime_image"]')
256+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
257+
.should('exist');
246258
cy.get('select[id="root_component_parameters_runtime_image"]').select(
247259
'continuumio/anaconda3:2024.02-1'
248260
);
@@ -262,6 +274,9 @@ describe('Pipeline Editor tests', () => {
262274
// producer-script props
263275
cy.findByText('producer-script.py').click();
264276
cy.get('#root_component_parameters_runtime_image').within(() => {
277+
cy.get('select[id="root_component_parameters_runtime_image"]')
278+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
279+
.should('exist');
265280
cy.get('select[id="root_component_parameters_runtime_image"]').select(
266281
'continuumio/anaconda3:2024.02-1'
267282
);
@@ -388,6 +403,10 @@ describe('Pipeline Editor tests', () => {
388403
.scrollIntoView()
389404
.find('select')
390405
.should('be.visible')
406+
.find('option[value="continuumio/anaconda3:2024.02-1"]')
407+
.should('exist');
408+
cy.get('#root_pipeline_defaults_runtime_image')
409+
.find('select')
391410
.select('continuumio/anaconda3:2024.02-1', { force: true });
392411
// Generic Node Defaults > Kubernetes Secrets
393412
cy.get('#root_pipeline_defaults_kubernetes_secrets')

0 commit comments

Comments
 (0)