Commit 559dfb9
committed
Fix flaky codesnippetfromselectedcells.cy.ts 2-cells race
The 'test 2 cells' case clicks the toolbar add-cell button and then
calls populateCells, which snapshots cy.get('.jp-Cell') once. If
JupyterLab has not yet mounted the second cell, only one cell gets
typed content. The subsequent shift-click multi-selection then
includes an empty cell.
save-as-snippet's isEnabled requires getSelectedCellContents().length
> 0 (packages/code-snippet/src/index.ts:90-112), so when an empty
cell is part of the active selection the menu item renders disabled.
The retry helper only checks presence, so it exits the loop, the
click fires on a disabled item and no-ops, and the test times out
waiting for .elyra-metadataEditor.
Wait for the .jp-Cell count to grow after the add-cell click,
mirroring the formArrayAdd pattern from #3389.
Signed-off-by: Luciano Resende <lresende@apple.com>1 parent acc0f8b commit 559dfb9
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
0 commit comments