Skip to content

Commit

Permalink
E2E test: verify connections reconnect via dialog (#5690)
Browse files Browse the repository at this point in the history
Just a small addition of validation of the connections reconnect dialog
usage.

### QA Notes

All smoke tests should pass.
  • Loading branch information
testlabauto authored Dec 10, 2024
1 parent fac0f76 commit 3cea779
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/automation/src/positron/positronConnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export class PositronConnections {
disconnectButton: Locator;
connectIcon: Locator;
connectionItems: Locator;
resumeConnectionButton: Locator;

constructor(private code: Code, private quickaccess: QuickAccess) {
this.deleteConnectionButton = code.driver.page.getByLabel('Delete Connection');
this.disconnectButton = code.driver.page.getByLabel('Disconnect');
this.connectIcon = code.driver.page.locator('.codicon-arrow-circle-right');
this.connectionItems = code.driver.page.locator('.connections-list-item');
this.resumeConnectionButton = code.driver.page.locator('.positron-modal-dialog-box').getByRole('button', { name: 'Resume Connection' });
}

async openConnectionsNodes(nodes: string[]) {
Expand Down
25 changes: 23 additions & 2 deletions test/e2e/features/connections/connections-db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('SQLite DB Connection', {
tag: [tags.WEB, tags.WIN, tags.CRITICAL, tags.CONNECTIONS]
}, () => {
test.beforeAll(async function ({ userSettings }) {
await userSettings.set([['positron.connections.showConnectionPane', 'true']], true);
await userSettings.set([['positron.connections.showConnectionPane', 'true']]);
});

test.afterEach(async function ({ app }) {
Expand All @@ -23,7 +23,9 @@ test.describe('SQLite DB Connection', {
await app.workbench.positronConnections.deleteConnection();
});

test('Python - SQLite DB Connection [C628636]', async function ({ app, python }) {
test.skip('Python - SQLite DB Connection [C628636]', {
annotation: [{ type: 'issue', description: 'https://github.com/posit-dev/positron/issues/5692' }]
}, async function ({ app, python }) {
await test.step('Open a Python file and run it', async () => {
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'chinook-sqlite.py'));
await app.workbench.quickaccess.runCommand('python.execInConsole');
Expand All @@ -42,6 +44,15 @@ test.describe('SQLite DB Connection', {
await app.workbench.positronConnections.openConnectionsNodes(['main']);
await app.workbench.positronConnections.assertConnectionNodes(['albums']);
});

await test.step('Disconnect, reconnect with dialog, & reverify', async () => {
await app.workbench.positronConnections.disconnectButton.click();
await app.workbench.positronConnections.connectIcon.click();
await app.workbench.positronConnections.resumeConnectionButton.click();

await app.workbench.positronConnections.openConnectionsNodes(['main']);
await app.workbench.positronConnections.assertConnectionNodes(['albums']);
});
});

test('R - SQLite DB Connection [C628637]', async function ({ app, r }) {
Expand All @@ -59,6 +70,16 @@ test.describe('SQLite DB Connection', {
await app.workbench.positronConnections.openConnectionsNodes(['SQLiteConnection', 'Default']);
await app.workbench.positronConnections.openConnectionsNodes(tables);
});

await test.step('Disconnect, reconnect with dialog, & reverify', async () => {
await app.workbench.positronConnections.disconnectButton.click();
await app.workbench.positronConnections.connectIcon.click();
await app.workbench.positronConnections.resumeConnectionButton.click();

await app.workbench.positronConnections.openConnectionsNodes(['SQLiteConnection', 'Default']);
await app.workbench.positronConnections.openConnectionsNodes(tables);
});

});

test('R - Connections are update after adding a database,[C663724]', async function ({ app, page, r }) {
Expand Down

0 comments on commit 3cea779

Please sign in to comment.