Skip to content

Commit 030d7d9

Browse files
authored
chore: upgrade to webdriverio 8.28.8 COMPASS-7597 (#5421)
* webdriverio 8.28.8
1 parent 60882c0 commit 030d7d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4133
-2017
lines changed

package-lock.json

Lines changed: 3705 additions & 1595 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export async function addCollection(
4040
const createModalElement = await browser.$(Selectors.CreateCollectionModal);
4141
await createModalElement.waitForDisplayed();
4242

43-
const collectionInput = await browser.$(
44-
Selectors.CreateDatabaseCollectionName
43+
await browser.setValueVisible(
44+
Selectors.CreateDatabaseCollectionName,
45+
collectionName
4546
);
46-
await collectionInput.setValue(collectionName);
4747

4848
if (collectionOptions) {
4949
await browser.clickVisible(
@@ -54,11 +54,10 @@ export async function addCollection(
5454
if (collectionOptions && collectionOptions.capped) {
5555
await browser.clickVisible(Selectors.CreateCollectionCappedCheckboxLabel);
5656

57-
const sizeElement = await browser.$(
58-
Selectors.CreateCollectionCappedSizeInput
57+
await browser.setValueVisible(
58+
Selectors.CreateCollectionCappedSizeInput,
59+
collectionOptions.capped.size.toString()
5960
);
60-
await sizeElement.waitForDisplayed();
61-
await sizeElement.setValue(collectionOptions.capped.size.toString());
6261
}
6362

6463
if (collectionOptions && collectionOptions.customCollation) {
@@ -101,18 +100,16 @@ export async function addCollection(
101100
Selectors.CreateCollectionTimeseriesCheckboxLabel
102101
);
103102

104-
const timeField = await browser.$(
105-
Selectors.CreateCollectionTimeseriesTimeField
103+
await browser.setValueVisible(
104+
Selectors.CreateCollectionTimeseriesTimeField,
105+
collectionOptions.timeseries.timeField
106106
);
107-
await timeField.waitForDisplayed();
108-
await timeField.setValue(collectionOptions.timeseries.timeField);
109107

110108
if (collectionOptions.timeseries.metaField) {
111-
const metaField = await browser.$(
112-
Selectors.CreateCollectionTimeseriesMetaField
109+
await browser.setValueVisible(
110+
Selectors.CreateCollectionTimeseriesMetaField,
111+
collectionOptions.timeseries.metaField
113112
);
114-
await metaField.waitForDisplayed();
115-
await metaField.setValue(collectionOptions.timeseries.metaField);
116113
}
117114

118115
if (collectionOptions.timeseries.granularity) {
@@ -131,31 +128,22 @@ export async function addCollection(
131128
}
132129

133130
if (collectionOptions.timeseries.bucketMaxSpanSeconds) {
134-
const bucketMaxSpanSecondsField = await browser.$(
135-
Selectors.CreateCollectionTimeseriesBucketMaxSpanSeconds
136-
);
137-
await bucketMaxSpanSecondsField.waitForDisplayed();
138-
await bucketMaxSpanSecondsField.setValue(
131+
await browser.setValueVisible(
132+
Selectors.CreateCollectionTimeseriesBucketMaxSpanSeconds,
139133
collectionOptions.timeseries.bucketMaxSpanSeconds.toString()
140134
);
141135
}
142136

143137
if (collectionOptions.timeseries.bucketRoundingSeconds) {
144-
const bucketMaxRoundingSecondsField = await browser.$(
145-
Selectors.CreateCollectionTimeseriesBucketRoundingSeconds
146-
);
147-
await bucketMaxRoundingSecondsField.waitForDisplayed();
148-
await bucketMaxRoundingSecondsField.setValue(
138+
await browser.setValueVisible(
139+
Selectors.CreateCollectionTimeseriesBucketRoundingSeconds,
149140
collectionOptions.timeseries.bucketRoundingSeconds.toString()
150141
);
151142
}
152143

153144
if (collectionOptions.timeseries.expireAfterSeconds) {
154-
const expireField = await browser.$(
155-
Selectors.CreateCollectionTimeseriesExpireAfterSeconds
156-
);
157-
await expireField.waitForDisplayed();
158-
await expireField.setValue(
145+
await browser.setValueVisible(
146+
Selectors.CreateCollectionTimeseriesExpireAfterSeconds,
159147
collectionOptions.timeseries.expireAfterSeconds.toString()
160148
);
161149
}
@@ -166,17 +154,13 @@ export async function addCollection(
166154
Selectors.CreateCollectionClusteredCheckboxLabel
167155
);
168156

169-
const nameField = await browser.$(
170-
Selectors.CreateCollectionClusteredNameField
157+
await browser.setValueVisible(
158+
Selectors.CreateCollectionClusteredNameField,
159+
collectionOptions.clustered.name
171160
);
172-
await nameField.waitForDisplayed();
173-
await nameField.setValue(collectionOptions.clustered.name);
174161

175-
const expireField = await browser.$(
176-
Selectors.CreateCollectionClusteredExpireAfterSeconds
177-
);
178-
await expireField.waitForDisplayed();
179-
await expireField.setValue(
162+
await browser.setValueVisible(
163+
Selectors.CreateCollectionClusteredExpireAfterSeconds,
180164
collectionOptions.clustered.expireAfterSeconds.toString()
181165
);
182166
}

packages/compass-e2e-tests/helpers/commands/add-database.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ export async function addDatabase(
1212
): Promise<void> {
1313
const createModalElement = await browser.$(Selectors.CreateDatabaseModal);
1414
await createModalElement.waitForDisplayed();
15-
const dbInput = await browser.$(Selectors.CreateDatabaseDatabaseName);
16-
await dbInput.setValue(dbName);
17-
const collectionInput = await browser.$(
18-
Selectors.CreateDatabaseCollectionName
15+
await browser.setValueVisible(Selectors.CreateDatabaseDatabaseName, dbName);
16+
await browser.setValueVisible(
17+
Selectors.CreateDatabaseCollectionName,
18+
collectionName
1919
);
20-
await collectionInput.setValue(collectionName);
2120
const createButton = await browser.$(Selectors.CreateDatabaseCreateButton);
2221
await createButton.waitForEnabled();
2322

packages/compass-e2e-tests/helpers/commands/click-visible.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CompassBrowser } from '../compass-browser';
2-
import type { ChainablePromiseElement, Element } from 'webdriverio';
2+
import type { ChainablePromiseElement } from 'webdriverio';
33

44
interface ClickOptions {
55
scroll?: boolean;
@@ -8,11 +8,14 @@ interface ClickOptions {
88

99
export async function clickVisible(
1010
browser: CompassBrowser,
11-
selector: string | ChainablePromiseElement<Promise<Element<'async'>>>,
11+
selector:
12+
| string
13+
| ChainablePromiseElement<WebdriverIO.Element>
14+
| WebdriverIO.Element,
1215
options?: ClickOptions
1316
): Promise<void> {
14-
function getElement() {
15-
return typeof selector === 'string' ? browser.$(selector) : selector;
17+
async function getElement() {
18+
return typeof selector === 'string' ? await browser.$(selector) : selector;
1619
}
1720

1821
const displayElement = await getElement();

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ async function navigateToCollection(
1818

1919
// search for the collection and wait for the collection to be there and visible
2020
await browser.clickVisible(Selectors.SidebarFilterInput);
21-
const sidebarFilterInputElement = await browser.$(
22-
Selectors.SidebarFilterInput
23-
);
24-
await sidebarFilterInputElement.clearValue();
25-
await sidebarFilterInputElement.setValue(collectionName);
21+
await browser.setValueVisible(Selectors.SidebarFilterInput, collectionName);
2622
const collectionElement = await browser.$(collectionSelector);
2723

2824
await collectionElement.waitForDisplayed();

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ export async function dropCollectionFromSidebar(
88
): Promise<void> {
99
// search for the collecton in the sidebar filter
1010
await browser.clickVisible(Selectors.SidebarFilterInput);
11-
const sidebarFilterInputElement = await browser.$(
12-
Selectors.SidebarFilterInput
13-
);
14-
await sidebarFilterInputElement.setValue(collectionName);
11+
await browser.setValueVisible(Selectors.SidebarFilterInput, collectionName);
1512
const dbElement = await browser.$(Selectors.sidebarDatabase(dbName));
1613
await dbElement.waitForDisplayed();
1714

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ export async function dropDatabaseFromSidebar(
77
): Promise<void> {
88
// search for the database in the sidebar filter
99
await browser.clickVisible(Selectors.SidebarFilterInput);
10-
const sidebarFilterInputElement = await browser.$(
11-
Selectors.SidebarFilterInput
12-
);
13-
await sidebarFilterInputElement.setValue(dbName);
10+
await browser.setValueVisible(Selectors.SidebarFilterInput, dbName);
1411
await browser.$(Selectors.sidebarDatabase(dbName)).waitForDisplayed();
1512

1613
// open the drop database modal from the sidebar

packages/compass-e2e-tests/helpers/commands/drop-index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ export async function dropIndex(
1818
const dropModal = await browser.$(Selectors.DropIndexModal);
1919
await dropModal.waitForDisplayed();
2020

21-
const confirmInput = await browser.$(
22-
Selectors.DropIndexModalConfirmNameInput
21+
await browser.setValueVisible(
22+
Selectors.DropIndexModalConfirmNameInput,
23+
indexName
2324
);
24-
await confirmInput.waitForDisplayed();
25-
await confirmInput.setValue(indexName);
2625

2726
if (screenshotName) {
2827
await browser.screenshot(screenshotName);

packages/compass-e2e-tests/helpers/commands/drop-namespace.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ export async function dropNamespace(
77
): Promise<void> {
88
const dropModalElement = await browser.$(Selectors.DropNamespaceModal);
99
await dropModalElement.waitForDisplayed();
10-
const confirmInput = await browser.$(Selectors.DropNamespaceConfirmNameInput);
11-
await confirmInput.setValue(collectionName);
10+
await browser.setValueVisible(
11+
Selectors.DropNamespaceConfirmNameInput,
12+
collectionName
13+
);
1214
const confirmButton = await browser.$(Selectors.DropNamespaceDropButton);
1315
await confirmButton.waitForEnabled();
1416

packages/compass-e2e-tests/helpers/commands/export-to-language.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ export async function exportToLanguage(
7373
await exportModal.waitForDisplayed({ reverse: true });
7474

7575
// normalize copied text so that it's the same for all platforms
76-
return text.replace(/\r\n/g, '\n');
76+
return text.replace(/\r\n/g, '\n').replace(/\n+/g, '\n');
7777
}

0 commit comments

Comments
 (0)