From 094449e8e9b6b33d911819007bb821fd02415df7 Mon Sep 17 00:00:00 2001 From: Shmaraiev Oleksandr Date: Thu, 15 Aug 2024 13:56:54 +0300 Subject: [PATCH] Update 'RefusedOAuthFactory' E2E test (#23090) * Update components related to 'factory' tests * Add a timeout in 'suiteTeardown' of a factory tests --- tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts | 2 +- tests/e2e/specs/factory/Factory.spec.ts | 2 ++ tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts | 2 ++ tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts | 8 ++++---- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts b/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts index eb6a3c05a88..3e5afd4c4b9 100644 --- a/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts +++ b/tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts @@ -53,7 +53,7 @@ export class CheCodeLocatorLoader extends LocatorLoader { requireReloadButton: By.xpath('//a[text()="Reload Required"]') }, TreeItem: { - projectFolderItem: By.xpath('.//div[contains(@class, "rootfolder-icon projects-name-dir")]') + projectFolderItem: By.className('pane-header expanded') }, ScmView: { manageWorkspaceTrust: By.xpath('.//a[@class="monaco-button monaco-text-button"]'), diff --git a/tests/e2e/specs/factory/Factory.spec.ts b/tests/e2e/specs/factory/Factory.spec.ts index 48e78be18db..a7bfbf7b57b 100644 --- a/tests/e2e/specs/factory/Factory.spec.ts +++ b/tests/e2e/specs/factory/Factory.spec.ts @@ -200,6 +200,8 @@ suite( }); suiteTeardown('Stop and delete the workspace by API', async function (): Promise { + // to avoid a possible creating workspace which is not appeared on Dashboard yet. TODO: implement a better solution. + await driverHelper.wait(30000); await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName()); }); diff --git a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts index 9baf6e0f2f8..4ee2548cca3 100644 --- a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts +++ b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts @@ -253,6 +253,8 @@ suite( }); suiteTeardown('Stop and delete the workspace by API', async function (): Promise { + // to avoid a possible creating workspace which is not appeared on Dashboard yet. TODO: implement a better solution. + await driverHelper.wait(30000); await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName()); }); } diff --git a/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts b/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts index bf36f71cc87..bf7499666ce 100644 --- a/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts +++ b/tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts @@ -103,15 +103,13 @@ suite( if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) { test('Check that a project folder has not been cloned', async function (): Promise { testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL); - await driverHelper.waitVisibility(webCheCodeLocators.ScmView.multiProviderItem); + await driverHelper.waitVisibility(webCheCodeLocators.TitleBar.itemElement); await projectAndFileTests.performTrustAuthorDialog(); const isProjectFolderUnable: string = await driverHelper.waitAndGetElementAttribute( (webCheCodeLocators.TreeItem as any).projectFolderItem, 'aria-label' ); - expect(isProjectFolderUnable).to.contain( - '/projects/' + testRepoProjectName + ' • Unable to resolve workspace folder (Unable to resolve nonexistent file' - ); + expect(isProjectFolderUnable).to.contain('No Folder Opened Section'); }); } else { test('Check if a project folder has been created', async function (): Promise { @@ -247,6 +245,8 @@ suite( }); suiteTeardown('Stop and delete the workspace by API', async function (): Promise { + // to avoid a possible creating workspace which is not appeared on Dashboard yet. TODO: implement a better solution. + await driverHelper.wait(30000); await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName()); });