Skip to content

Commit c7ba925

Browse files
committed
chore(e2e): fix connect button selector
1 parent e36e84e commit c7ba925

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

packages/compass-e2e-tests/helpers/commands/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export async function doConnect(
123123
connectionName: string,
124124
options: ConnectionResultOptions = {}
125125
) {
126-
await browser.clickVisible(Selectors.ConnectButton);
126+
await browser.clickVisible(Selectors.ConnectionFormConnectButton);
127127
await browser.waitForConnectionResult(connectionName, options);
128128
}
129129

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ export const ConnectionFormErrorMessage =
6161
'[data-testid="connection-error-summary"]';
6262
export const CancelConnectionButton =
6363
'[data-testid="cancel-connection-button"]';
64+
export const ConnectionFormConnectionName =
65+
'[data-testid="personalization-name-input"]';
66+
export const ConnectionFormConnectionColor =
67+
'[data-testid="personalization-color-input"]';
68+
export const ConnectionFormFavoriteCheckbox =
69+
'[data-testid="personalization-favorite-checkbox"]';
70+
export const ConnectionFormConnectButton = '[data-testid="connect-button"]';
71+
export const ConnectionFormSaveAndConnectButton =
72+
'[data-testid="save-and-connect-button"]';
6473

6574
export const AdvancedOptionsTabs = '[aria-label="Advanced Options Tabs"]';
6675
export const SelectedAdvancedOptionsTab = `${AdvancedOptionsTabs} [aria-selected="true"]`;
@@ -223,12 +232,8 @@ export const ConnectionModalTitle = `${ConnectionModal} h3`;
223232
export const ConnectionModalCloseButton = `${ConnectionModal} [aria-label="Close modal"]`;
224233
export const ConnectionModalConnectButton = '[data-testid="connect-button"]';
225234
export const ConnectionModalSaveButton = '[data-testid="save-button"]';
226-
export const ConnectionFormConnectionName =
227-
'[data-testid="personalization-name-input"]';
228-
export const ConnectionFormConnectionColor =
229-
'[data-testid="personalization-color-input"]';
230-
export const ConnectionFormFavoriteCheckbox =
231-
'[data-testid="personalization-favorite-checkbox"]';
235+
236+
// Connection process toast
232237
export const connectionToastById = (connectionId: string) => {
233238
return `[data-testid="toast-connection-status--${connectionId}"]`;
234239
};
@@ -238,7 +243,6 @@ export const ConnectionToastErrorReviewButton =
238243

239244
// Connections sidebar
240245
export const ConnectionsTitle = '[data-testid="connections-header"]';
241-
export const ConnectButton = '[data-action="connection-connect"]';
242246
export const SidebarNewConnectionButton = '[data-action="add-new-connection"]';
243247
export const ConnectionMenu = '[data-testid="sidebar-navigation-item-actions"]';
244248
export const CreateDatabaseButton =
@@ -356,7 +360,9 @@ export const sidebarConnection = (connectionName: string): string => {
356360
};
357361

358362
export const sidebarConnectionButton = (connectionName: string): string => {
359-
return `${sidebarConnection(connectionName)} ${ConnectButton}`;
363+
return `${sidebarConnection(
364+
connectionName
365+
)} [data-action="connection-connect"]`;
360366
};
361367

362368
export const sidebarConnectionActionButton = (

packages/compass-e2e-tests/tests/oidc.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ describe('OIDC integration', function () {
264264
connectionString
265265
);
266266

267-
await browser.clickVisible(Selectors.ConnectButton);
267+
await browser.clickVisible(Selectors.ConnectionFormConnectButton);
268268
await once(emitter, 'authorizeEndpointCalled');
269269

270270
overrideRequestHandler = () => {};
@@ -319,7 +319,7 @@ describe('OIDC integration', function () {
319319
Selectors.ConnectionFormStringInput,
320320
connectionString
321321
);
322-
await browser.clickVisible(Selectors.ConnectButton);
322+
await browser.clickVisible(Selectors.ConnectionFormConnectButton);
323323

324324
// wait for the token to expire (see expires_in above)
325325
await browser.pause(10_000);
@@ -364,7 +364,7 @@ describe('OIDC integration', function () {
364364
Selectors.ConnectionFormStringInput,
365365
connectionString
366366
);
367-
await browser.clickVisible(Selectors.ConnectButton);
367+
await browser.clickVisible(Selectors.ConnectionFormConnectButton);
368368

369369
// wait for the token to expire (see expires_in above)
370370
await browser.pause(10_000);

0 commit comments

Comments
 (0)