Skip to content

Commit 508cb14

Browse files
committed
attempt
1 parent 1c41b43 commit 508cb14

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/compass-e2e-tests/helpers/selectors.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,8 @@ export const CreateDataModelCollectionCheckbox = (
14441444
): string =>
14451445
`${CreateDataModelModal} [data-testid="new-diagram-collection-checkbox-${collectionName}"]`;
14461446
export const DataModelEditor = '[data-testid="diagram-editor-container"]';
1447+
export const DataModelZoomOutButton = `${DataModelEditor} [aria-label="Minus Icon"]`;
1448+
export const DataModelZoomInButton = `${DataModelEditor} [aria-label="Plus Icon"]`;
14471449
export const DataModelPreview = `${DataModelEditor} [data-testid="model-preview"]`;
14481450
export const DataModelPreviewCollection = (collectionId: string) =>
14491451
`${DataModelPreview} [data-nodeid="${collectionId}"]`;
@@ -1484,6 +1486,8 @@ export const DataModelRelationshipForeignFieldSelect =
14841486
'//label[text()="Foreign field"]';
14851487
export const DataModelRelationshipForeignCardinalitySelect =
14861488
'//label[text()="Foreign cardinality"]';
1489+
export const DataModelRelationshipCardinalityOption = (value: string) =>
1490+
`[role="option"][value="${value}"]`;
14871491
export const DataModelCollectionRelationshipItem = (relationshipId: string) =>
14881492
`li[data-relationship-id="${relationshipId}"]`;
14891493
export const DataModelCollectionRelationshipItemEdit = `[aria-label="Edit relationship"]`;

packages/compass-e2e-tests/tests/data-modeling-tab.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ describe('Data Modeling tab', function () {
572572
});
573573
const relationshipId = edges[0].id;
574574

575+
// Zooming out so that the collections are more accessible
576+
// (they can be covered by the drawer or the minimap)
577+
await browser.clickVisible(Selectors.DataModelZoomOutButton);
578+
await browser.clickVisible(Selectors.DataModelZoomOutButton);
579+
await browser.clickVisible(Selectors.DataModelZoomOutButton);
580+
575581
// Select the other collection and see that the new relationship is listed
576582
await selectCollectionOnTheDiagram(browser, 'test.testCollection-two');
577583
const collection2Name = await browser.getInputByLabel(
@@ -599,7 +605,7 @@ describe('Data Modeling tab', function () {
599605
selectSelector: await browser.getInputByLabel(
600606
drawer.$(Selectors.DataModelRelationshipForeignCardinalitySelect)
601607
),
602-
optionSelector: `[role="option"][value="100"]`,
608+
optionSelector: Selectors.DataModelRelationshipCardinalityOption('100'),
603609
});
604610

605611
// See the updated relationship on the diagram

0 commit comments

Comments
 (0)