Skip to content

Commit c8f6a8b

Browse files
authored
Handle 'TrustAuthor' popup in factory and WorkspaceWithParent tests (#23098)
Signed-off-by: Dmytro Nochevnov <[email protected]>
1 parent d3a4552 commit c8f6a8b

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

tests/e2e/specs/factory/Factory.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
3939
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
4040
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
4141
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
42+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
4243

4344
suite(
4445
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
@@ -53,6 +54,7 @@ suite(
5354
const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage);
5455
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
5556
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
57+
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
5658

5759
let projectSection: ViewSection;
5860
let scmProvider: SingleScmProvider;
@@ -72,6 +74,7 @@ suite(
7274
});
7375
test('Navigate to the factory URL', async function (): Promise<void> {
7476
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
77+
await createWorkspace.performTrustAuthorPopup();
7578
});
7679

7780
if (OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_OAUTH) {

tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY
4040
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
4141
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
4242
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
43+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
4344

4445
suite(
4546
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without PAT/OAuth setup ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
@@ -54,6 +55,7 @@ suite(
5455
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
5556
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
5657
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
58+
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
5759

5860
let projectSection: ViewSection;
5961
let scmProvider: SingleScmProvider;
@@ -83,6 +85,7 @@ suite(
8385

8486
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
8587
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
88+
await createWorkspace.performTrustAuthorPopup();
8689
});
8790

8891
if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {

tests/e2e/specs/factory/RefusedOAuthFactory.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
3939
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
4040
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
4141
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
42+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
4243

4344
suite(
4445
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
@@ -53,6 +54,7 @@ suite(
5354
const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage);
5455
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
5556
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
57+
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
5658

5759
let projectSection: ViewSection;
5860
let scmProvider: SingleScmProvider;
@@ -76,6 +78,7 @@ suite(
7678

7779
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
7880
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
81+
await createWorkspace.performTrustAuthorPopup();
7982
});
8083

8184
test(`Authorize with a ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function (): Promise<void> {

tests/e2e/specs/miscellaneous/WorkspaceWithParent.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
2525
import { DriverHelper } from '../../utils/DriverHelper';
2626
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
2727
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
28+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
2829

2930
suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
3031
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
@@ -38,6 +39,7 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
3839
CLASSES.KubernetesCommandLineToolsExecutor
3940
);
4041
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
42+
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
4143

4244
let podName: string = '';
4345

@@ -56,6 +58,7 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
5658
: BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL + '/dashboard/#/' + FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL;
5759
await dashboard.waitPage();
5860
await browserTabsUtil.navigateTo(factoryUrl);
61+
await createWorkspace.performTrustAuthorPopup();
5962
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
6063
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
6164
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();

tests/e2e/tests-library/WorkspaceHandlingTests.ts

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export class WorkspaceHandlingTests {
7777
}
7878

7979
async obtainWorkspaceNameFromStartingPage(): Promise<void> {
80-
await this.createWorkspace.performTrustAuthorPopup();
81-
8280
const timeout: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT;
8381
const polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
8482
const attempts: number = Math.ceil(timeout / polling);

0 commit comments

Comments
 (0)