Skip to content

Commit

Permalink
Update 'RefusedOAuthFactory' E2E test (#23090)
Browse files Browse the repository at this point in the history
* Update components related to 'factory' tests
* Add a timeout in 'suiteTeardown' of a factory tests
  • Loading branch information
artaleks9 authored Aug 15, 2024
1 parent c48026c commit 094449e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/pageobjects/ide/CheCodeLocatorLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'),
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/specs/factory/Factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ suite(
});

suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
// 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());
});

Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ suite(
});

suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
// 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());
});
}
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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<void> {
Expand Down Expand Up @@ -247,6 +245,8 @@ suite(
});

suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
// 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());
});

Expand Down

0 comments on commit 094449e

Please sign in to comment.