Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): port auto-connect tests for multiple connections COMPASS-8010 #6121

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Aug 15, 2024

No description provided.

await browser
.$(Selectors.ConnectionToastErrorText)
.waitForDisplayed(waitOptions);
return await browser.$(Selectors.LGToastTitle).getText();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was accidentally returning the toast body text (which is always the same) and not the toast title text. Nothing cared about it yet.

@@ -15,26 +15,19 @@ import path from 'path';
import { promises as fs } from 'fs';

const connectionStringSuccess = 'mongodb://127.0.0.1:27091/test';
const connectionNameSuccess = connectionNameFromString(connectionStringSuccess);
const connectionStringSuccessTitle = '127.0.0.1:27091';
const connectionNameSuccess = 'Success';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much of the confusion is that we name this connection string as the favorite "Success" in the connections file and then it gets that name, but we also often just pass this string on the command line and then it gets the auto-generated name.

.$(Selectors.SidebarTitle)
.getText();
expect(sidebarTitle).to.eq(expectedTitle);
if (!TEST_MULTIPLE_CONNECTIONS) {
Copy link
Contributor Author

@lerouxb lerouxb Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case anyone notices: There is no else necessary because in MC world waitForConnectionResult already checks that the exact connectionName was connected and there is no sidebar title that changes accordingly.

@@ -179,6 +176,10 @@ describe('Automatically connecting from the command line', function () {
{ connectionStatus: 'failure' }
);
expect(error).to.include('Authentication failed');
if (TEST_MULTIPLE_CONNECTIONS) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In single connection world you land on the connection form, so there's no else necessary.

);
expect(connectionItems).to.have.lengthOf(0);

await browser
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now actually the first and only test for the initial empty sidebar state. We always use the small plus button, never the big add button that only shows up in that case.

Copy link
Contributor Author

@lerouxb lerouxb Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should actually change the time to first query test to use that button.. But in a different PR.

@lerouxb lerouxb merged commit a4716c1 into main Aug 16, 2024
23 of 25 checks passed
@lerouxb lerouxb deleted the e2e-autoconnect-multiple branch August 16, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants