fix: Improve stability of NDV hover test (no-changelog) (#14679)

This commit is contained in:
shortstacked
2025-04-17 08:26:10 +01:00
committed by GitHub
parent ad386cde31
commit 8b70fbcb5f
2 changed files with 45 additions and 17 deletions

View File

@@ -29,7 +29,7 @@ export function getParameterInputByName(name: string) {
}
export function getInputPanel() {
return cy.getByTestId('input-panel');
return cy.getByTestId('ndv-input-panel');
}
export function getMainPanel() {
@@ -52,6 +52,10 @@ export function getResourceLocatorInput(paramName: string) {
return getResourceLocator(paramName).find('[data-test-id="rlc-input-container"]');
}
export function getInputPanelDataContainer() {
return getInputPanel().getByTestId('ndv-data-container');
}
export function getOutputPanelDataContainer() {
return getOutputPanel().getByTestId('ndv-data-container');
}
@@ -272,3 +276,25 @@ export function populateFixedCollection<T extends readonly string[]>(
export function assertInlineExpressionValid() {
cy.getByTestId('inline-expression-editor-input').find('.cm-valid-resolvable').should('exist');
}
export function hoverInputItemByText(text: string) {
return getInputPanelDataContainer().contains(text).trigger('mouseover', { force: true });
}
export function verifyInputHoverState(expectedText: string) {
getInputPanelDataContainer()
.find('[data-test-id="hovering-item"]')
.should('be.visible')
.should('have.text', expectedText);
}
export function verifyOutputHoverState(expectedText: string) {
getOutputPanelDataContainer()
.find('[data-test-id="hovering-item"]')
.should('be.visible')
.should('have.text', expectedText);
}
export function resetHoverState() {
getBackToCanvasButton().trigger('mouseover');
}