From 25b38bf2adc8c10671b25ce045d15c04ceba7ccc Mon Sep 17 00:00:00 2001 From: Zalenski Egor Date: Fri, 20 Dec 2024 13:28:42 +0100 Subject: [PATCH 1/5] activate extension after click on icon in the sidebar --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c23678bc..dee79363 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "vscode": "^1.87.0" }, "activationEvents": [ - "onStartupFinished" + "onView:ri-sidebar-view" ], "contributes": { "viewsContainers": { From 4488aa2d50cdec66d25e8cf08e44ab2f0cb19de3 Mon Sep 17 00:00:00 2001 From: vlad-dargel Date: Fri, 20 Dec 2024 13:53:32 +0100 Subject: [PATCH 2/5] increase timeout --- tests/e2e/src/helpers/common-actions/ServerActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/src/helpers/common-actions/ServerActions.ts b/tests/e2e/src/helpers/common-actions/ServerActions.ts index 67fc35c2..949b72bc 100644 --- a/tests/e2e/src/helpers/common-actions/ServerActions.ts +++ b/tests/e2e/src/helpers/common-actions/ServerActions.ts @@ -10,7 +10,7 @@ export class ServerActions extends CommonDriverExtension { * // todo: investigate if it is better to put it before all tests? */ static async waitForServerInitialized(): Promise { - const TIMEOUT = 10_000 + const TIMEOUT = 20_000 const start = Date.now() while(Date.now() - start < TIMEOUT) { From 7a1e6f6bb7608788a66e0da87d8abbc132ef0323 Mon Sep 17 00:00:00 2001 From: vlad-dargel Date: Fri, 20 Dec 2024 14:09:16 +0100 Subject: [PATCH 3/5] increase timeout for element visibility --- tests/e2e/src/page-objects/components/BaseComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/src/page-objects/components/BaseComponent.ts b/tests/e2e/src/page-objects/components/BaseComponent.ts index 8348df92..631e75a9 100644 --- a/tests/e2e/src/page-objects/components/BaseComponent.ts +++ b/tests/e2e/src/page-objects/components/BaseComponent.ts @@ -130,7 +130,7 @@ export class BaseComponent extends WebElement { */ async waitForElementVisibility( locator: Locator, - timeout: number = 5000, + timeout: number = 10000, stateOfDisplayed: boolean = true, ): Promise { let element: WebElement From 0e2c98849fba97c90c18ea22a56ae5461cbce72b Mon Sep 17 00:00:00 2001 From: vlad-dargel Date: Fri, 20 Dec 2024 14:20:49 +0100 Subject: [PATCH 4/5] change timeout --- tests/e2e/src/helpers/common-actions/ServerActions.ts | 8 +++++--- tests/e2e/src/page-objects/components/BaseComponent.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/e2e/src/helpers/common-actions/ServerActions.ts b/tests/e2e/src/helpers/common-actions/ServerActions.ts index 949b72bc..d2004d49 100644 --- a/tests/e2e/src/helpers/common-actions/ServerActions.ts +++ b/tests/e2e/src/helpers/common-actions/ServerActions.ts @@ -10,13 +10,15 @@ export class ServerActions extends CommonDriverExtension { * // todo: investigate if it is better to put it before all tests? */ static async waitForServerInitialized(): Promise { - const TIMEOUT = 20_000 + const TIMEOUT = 30_000 const start = Date.now() while(Date.now() - start < TIMEOUT) { try { - await CommonAPIRequests.sendGetRequest('/info') - return + const response = await CommonAPIRequests.sendGetRequest('/info') + if (response.status === 200) { + return + } } catch (e) { // ignore } diff --git a/tests/e2e/src/page-objects/components/BaseComponent.ts b/tests/e2e/src/page-objects/components/BaseComponent.ts index 631e75a9..8348df92 100644 --- a/tests/e2e/src/page-objects/components/BaseComponent.ts +++ b/tests/e2e/src/page-objects/components/BaseComponent.ts @@ -130,7 +130,7 @@ export class BaseComponent extends WebElement { */ async waitForElementVisibility( locator: Locator, - timeout: number = 10000, + timeout: number = 5000, stateOfDisplayed: boolean = true, ): Promise { let element: WebElement From 549a6d499f71877a8bbeae8280d546ba918989aa Mon Sep 17 00:00:00 2001 From: vlad-dargel Date: Fri, 20 Dec 2024 14:33:47 +0100 Subject: [PATCH 5/5] fix --- tests/e2e/src/helpers/common-actions/ServerActions.ts | 2 +- tests/e2e/src/tests/setup.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/src/helpers/common-actions/ServerActions.ts b/tests/e2e/src/helpers/common-actions/ServerActions.ts index d2004d49..7350d589 100644 --- a/tests/e2e/src/helpers/common-actions/ServerActions.ts +++ b/tests/e2e/src/helpers/common-actions/ServerActions.ts @@ -10,7 +10,7 @@ export class ServerActions extends CommonDriverExtension { * // todo: investigate if it is better to put it before all tests? */ static async waitForServerInitialized(): Promise { - const TIMEOUT = 30_000 + const TIMEOUT = 10_000 const start = Date.now() while(Date.now() - start < TIMEOUT) { diff --git a/tests/e2e/src/tests/setup.ts b/tests/e2e/src/tests/setup.ts index 4a57f866..46b4199c 100644 --- a/tests/e2e/src/tests/setup.ts +++ b/tests/e2e/src/tests/setup.ts @@ -34,10 +34,10 @@ describe('Agreements Verification', () => { addDatabaseView = new AddDatabaseView() welcomeView = new WelcomeView() - await ServerActions.waitForServerInitialized() - await browser.waitForWorkbench(20_000) await new TitleBar().getWindowControls().maximize() await (await new ActivityBar().getViewControl('Redis for VS Code'))?.openView() + await ServerActions.waitForServerInitialized() + await browser.waitForWorkbench(20_000) }) beforeEach(async () => { await eulaView.switchToInnerViewFrame(InnerViews.EulaInnerView)