forked from mongodb-js/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(databases-collections, compass-sidebar): add rename collection f…
…low COMPASS-5704 (mongodb-js#5063)
- Loading branch information
1 parent
f54bb15
commit d3d1c1d
Showing
28 changed files
with
1,278 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/compass-e2e-tests/helpers/commands/save-aggregation-pipeline.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Selectors } from '../compass'; | ||
import type { CompassBrowser } from '../compass-browser'; | ||
|
||
/** | ||
* Saves an aggregation pipeline. | ||
* | ||
* This helper expects that the browser is already on the aggregations tab for the target collection. | ||
*/ | ||
export async function saveAggregationPipeline( | ||
browser: CompassBrowser, | ||
aggregationName: string, | ||
pipeline: Record<string, any>[] | ||
) { | ||
for (let index = 0; index < pipeline.length; index++) { | ||
const stage = pipeline[index]; | ||
const stageOperator = Object.keys(stage)[0]; | ||
const stageValue = stage[stageOperator]; | ||
|
||
// add stage | ||
await browser.clickVisible(Selectors.AddStageButton); | ||
await browser.$(Selectors.stageEditor(index)).waitForDisplayed(); | ||
|
||
await browser.focusStageOperator(index); | ||
await browser.selectStageOperator(index, stageOperator); | ||
await browser.setCodemirrorEditorValue( | ||
Selectors.stageEditor(index), | ||
stageValue | ||
); | ||
} | ||
|
||
await browser.clickVisible(Selectors.SavePipelineMenuButton); | ||
const menuElement = await browser.$(Selectors.SavePipelineMenuContent); | ||
await menuElement.waitForDisplayed(); | ||
await browser.clickVisible(Selectors.SavePipelineSaveAsAction); | ||
|
||
// wait for the modal to appear | ||
const savePipelineModal = await browser.$(Selectors.SavePipelineModal); | ||
await savePipelineModal.waitForDisplayed(); | ||
|
||
// set aggregation name | ||
await browser.waitForAnimations(Selectors.SavePipelineNameInput); | ||
const pipelineNameInput = await browser.$(Selectors.SavePipelineNameInput); | ||
await pipelineNameInput.setValue(aggregationName); | ||
|
||
const createButton = await browser | ||
.$(Selectors.SavePipelineModal) | ||
.$('button=Save'); | ||
|
||
await createButton.click(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.