Skip to content

Commit 227c9c6

Browse files
authored
chore(e2e): search in search bar by full namespace (#7267)
* chore(e2e): search in search bar by full namespace * chore(e2e): make drop command less flaky
1 parent f79895f commit 227c9c6

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

packages/compass-e2e-tests/helpers/commands/collection-workspaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function navigateToCollection(
3737
await browser.clickVisible(Selectors.SidebarFilterInput);
3838
await browser.setValueVisible(
3939
Selectors.SidebarFilterInput,
40-
`^(${dbName}|${collectionName})$`
40+
`${dbName}.${collectionName}`
4141
);
4242
const collectionElement = browser.$(collectionSelector);
4343

packages/compass-e2e-tests/helpers/commands/drop-collection-from-sidebar.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ export async function dropCollectionFromSidebar(
1313
collectionName,
1414
'drop-collection'
1515
);
16-
await browser.dropNamespace(collectionName);
1716

18-
// wait for it to be gone
1917
const connectionId = await browser.getConnectionIdByName(connectionName);
2018
const collectionSelector = Selectors.sidebarCollection(
2119
connectionId,
2220
databaseName,
2321
collectionName
2422
);
2523
const collectionElement = browser.$(collectionSelector);
26-
await collectionElement.waitForExist({ reverse: true });
24+
25+
// Start the drop and wait for it to be gone
26+
await Promise.all([
27+
collectionElement.waitForExist({ reverse: true }),
28+
browser.dropNamespace(collectionName),
29+
]);
2730
}

packages/compass-e2e-tests/helpers/commands/drop-database-from-sidebar.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export async function dropDatabaseFromSidebar(
2020

2121
await browser.clickVisible(Selectors.DropDatabaseButton);
2222

23-
await browser.dropNamespace(dbName);
24-
25-
// wait for it to be gone
26-
await browser
27-
.$(Selectors.sidebarDatabase(connectionId, dbName))
28-
.waitForExist({ reverse: true });
23+
// Start the drop and wait for it to be gone
24+
await Promise.all([
25+
browser.dropNamespace(dbName),
26+
browser
27+
.$(Selectors.sidebarDatabase(connectionId, dbName))
28+
.waitForExist({ reverse: true }),
29+
]);
2930
}

packages/compass-e2e-tests/helpers/commands/sidebar-collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function selectCollectionMenuItem(
1414
await browser.clickVisible(Selectors.SidebarFilterInput);
1515
await browser.setValueVisible(
1616
Selectors.SidebarFilterInput,
17-
`^(${databaseName}|${collectionName})$`
17+
`${databaseName}.${collectionName}`
1818
);
1919

2020
const collectionSelector = Selectors.sidebarCollection(

packages/compass-e2e-tests/tests/collection-rename.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('Collection Rename Modal', () => {
136136
await browser.clickVisible(Selectors.SidebarFilterInput);
137137
await browser.setValueVisible(
138138
Selectors.SidebarFilterInput,
139-
`^(${databaseName}|${newCollectionName})$`
139+
`${databaseName}.${newCollectionName}`
140140
);
141141
await browser
142142
.$(

0 commit comments

Comments
 (0)