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): un-skip the readonly tests for multiple connections COMPASS-8005 #5969

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/compass-e2e-tests/helpers/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ export const Multiple = {
SidebarNewConnectionButton: '[data-action="add-new-connection"]',
ConnectionMenu: '[data-testid="sidebar-navigation-item-actions"]',

CreateDatabaseItem:
'[data-testid="sidebar-navigation-item-actions-create-database-action"]',
OpenShellItem:
'[data-testid="sidebar-navigation-item-actions-open-shell-action"]',
ViewPerformanceItem:
Expand Down
47 changes: 31 additions & 16 deletions packages/compass-e2e-tests/tests/read-only.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ describe('readOnly: true / Read-Only Edition', function () {

before(function () {
skipForWeb(this, 'settings modal not available on compass-web');
// TODO(COMPASS-8005): port these once implemented
if (TEST_MULTIPLE_CONNECTIONS) {
this.skip();
}
});

beforeEach(async function () {
Expand All @@ -44,12 +40,24 @@ describe('readOnly: true / Read-Only Edition', function () {
await browser.setFeature('readOnly', true);
await browser.connectWithConnectionString();

let sidebarCreateDatabaseButton = await browser.$(
Selectors.SidebarCreateDatabaseButton
);
let isSidebarCreateDatabaseButtonExisting =
await sidebarCreateDatabaseButton.isExisting();
expect(isSidebarCreateDatabaseButtonExisting).to.be.equal(false);
const connectionName = connectionNameFromString(DEFAULT_CONNECTION_STRING);

if (TEST_MULTIPLE_CONNECTIONS) {
// navigate to the databases tab so that the connection is
// active/highlighted and then the add button and three dot menu will
// display without needing to hover
await browser.navigateToConnectionTab(connectionName, 'Databases');
expect(
await browser.$(Selectors.Multiple.CreateDatabaseItem).isExisting()
).to.be.equal(false);
} else {
const sidebarCreateDatabaseButton = await browser.$(
Selectors.SidebarCreateDatabaseButton
);
const isSidebarCreateDatabaseButtonExisting =
await sidebarCreateDatabaseButton.isExisting();
expect(isSidebarCreateDatabaseButtonExisting).to.be.equal(false);
}

await browser.openSettingsModal();
const settingsModal = await browser.$(Selectors.SettingsModal);
Expand All @@ -62,12 +70,19 @@ describe('readOnly: true / Read-Only Edition', function () {
// wait for the modal to go away
await settingsModal.waitForDisplayed({ reverse: true });

sidebarCreateDatabaseButton = await browser.$(
Selectors.SidebarCreateDatabaseButton
);
isSidebarCreateDatabaseButtonExisting =
await sidebarCreateDatabaseButton.isExisting();
expect(isSidebarCreateDatabaseButtonExisting).to.be.equal(true);
if (TEST_MULTIPLE_CONNECTIONS) {
await browser.navigateToConnectionTab(connectionName, 'Databases');
expect(
await browser.$(Selectors.Multiple.CreateDatabaseItem).isExisting()
).to.be.equal(true);
} else {
const sidebarCreateDatabaseButton = await browser.$(
Selectors.SidebarCreateDatabaseButton
);
const isSidebarCreateDatabaseButtonExisting =
await sidebarCreateDatabaseButton.isExisting();
expect(isSidebarCreateDatabaseButtonExisting).to.be.equal(true);
}
});

it('shows and hides the plus icon on the siderbar to create a collection', async function () {
Expand Down
Loading