Skip to content

Commit afbc593

Browse files
committed
Fix pipeline snapshot test race condition
Wait for the PUT response in savePipeline() before reading the file, ensuring the server has written it to disk. Also dismiss the context menu after the last addFileToPipeline call to prevent stale menu interactions during node property configuration. Signed-off-by: Luciano Resende <lresende@apple.com>
1 parent 5b6a6ec commit afbc593

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cypress/support/commands.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ Cypress.Commands.add('dragAndDropFileToPipeline', (name: string) => {
203203
});
204204

205205
Cypress.Commands.add('savePipeline', (): void => {
206+
cy.intercept('PUT', '**/api/contents/**').as('savePipelineFile');
206207
cy.findByRole('button', { name: /save pipeline/i }).click();
207-
// Wait for the document to register as saved
208+
// Wait for the server to finish writing the file to disk
209+
cy.wait('@savePipelineFile');
208210
cy.get('.jp-Document:not(.jp-mod-dirty)', { timeout: 10000 }).should('exist');
209211
});
210212

cypress/tests/pipeline.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ describe('Pipeline Editor tests', () => {
181181
cy.addFileToPipeline('create-source-files.py');
182182
cy.addFileToPipeline('producer-script.py');
183183

184+
// Ensure context menu is dismissed and all nodes are on canvas
185+
cy.get('.lm-Menu').should('not.exist');
186+
184187
cy.get('#jp-main-dock-panel').within(() => {
185188
// producer props
186189
cy.findByText('producer.ipynb').rightclick();

0 commit comments

Comments
 (0)