Skip to content

Commit

Permalink
Merge pull request konveyor#30 from sshveta/setup_konveyor
Browse files Browse the repository at this point in the history
[RFR] Method to setup konveyor and test to start analyzer
  • Loading branch information
sshveta authored Nov 18, 2024
2 parents 001ec2c + 2f4c304 commit 45ab83b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
19 changes: 19 additions & 0 deletions e2e/pages/vscode.pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@ class VSCode {
console.log('Iframe with title "Konveyor" not found.');
return null;
}

/**
* Opens command palette by doing ctrl+shift+P
* and then typing "Welcome" and then "Set Up".
*/
public async openSetUpKonveyor() {
const window = this.getWindow();
await window.keyboard.press('Control+Shift+P');
await window.waitForTimeout(1000);

await window.keyboard.type('welcome: open walkthrough');
await window.waitForTimeout(500);

await window.keyboard.press('Enter');
await window.waitForTimeout(500);

await window.keyboard.type('set up konveyor');
await window.keyboard.press('Enter');
}
}

export { VSCode };
13 changes: 12 additions & 1 deletion e2e/tests/vscode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('VSCode Tests', () => {
const window = vscodeApp.getWindow();
const kaiTab = await window.getByRole('tab', { name: 'Konveyor' });
await kaiTab.click();
await window.waitForTimeout(10000);
await window.waitForTimeout(500);
const iframe = await vscodeApp.getLeftIframe();
if (iframe) {
const heading = await iframe.locator('h1:has-text("Konveyor Analysis")');
Expand All @@ -33,6 +33,17 @@ test.describe('VSCode Tests', () => {
await window.screenshot({ path: 'kai-installed-screenshot.png' });
});

test('Set Up Konevyor and Start analyzer', async () => {
const window = vscodeApp.getWindow();
await vscodeApp.openSetUpKonveyor();
await window.waitForTimeout(5000);
await window.getByRole('button', { name: ' Start Analyzer' }).click();
await window.waitForTimeout(5000);
await window
.getByRole('button', { name: 'Start Analyzer', exact: true })
.click();
});

test.afterAll(async () => {
await cleanupRepo();
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"json-buffer": "^3.0.1",
"json-stringify-safe": "^5.0.1",
"jsonfile": "^4.0.0",
"keyboard": "^0.0.1",
"keyv": "^4.5.4",
"lowercase-keys": "^2.0.0",
"matcher": "^3.0.0",
Expand Down

0 comments on commit 45ab83b

Please sign in to comment.