Skip to content

Commit 56f1d0d

Browse files
committed
feat: support creating multi-source applications in New App panel & fix lint prettier errors
Signed-off-by: Dave Canton <[email protected]>
1 parent f4d1e0f commit 56f1d0d

File tree

6 files changed

+397
-256
lines changed

6 files changed

+397
-256
lines changed

ui-test/src/application-create-panel/application-create-panel.ts

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const CREATE_APPLICATION_BUTTON_CANCEL: By = By.xpath('.//button[@qe-id="applica
88

99
const CREATE_APPLICATION_FIELD_APP_NAME: By = By.xpath('.//input[@qeid="application-create-field-app-name"]');
1010
const CREATE_APPLICATION_FIELD_PROJECT: By = By.xpath('.//input[@qe-id="application-create-field-project"]');
11-
const CREATE_APPLICATION_FIELD_REPOSITORY_URL: By = By.xpath('.//input[@qe-id="application-create-field-repository-url"]');
12-
const CREATE_APPLICATION_FIELD_REPOSITORY_PATH: By = By.xpath('.//input[@qe-id="application-create-field-path"]');
11+
const CREATE_APPLICATION_SOURCE_1_FIELD_REPOSITORY_URL: By = By.xpath('.//input[@qe-id="application-create-source-1-field-repository-url"]');
12+
const CREATE_APPLICATION_SOURCE_1_FIELD_REPOSITORY_PATH: By = By.xpath('.//input[@qe-id="application-create-source-1-field-path"]');
13+
const CREATE_APPLICATION_SOURCE_2_FIELD_REPOSITORY_PATH: By = By.xpath('.//input[@qe-id="application-create-source-2-field-path"]');
14+
const CREATE_APPLICATION_SOURCE_2_FIELD_REPOSITORY_URL: By = By.xpath('.//input[@qe-id="application-create-source-2-field-repository-url"]');
1315

1416
const CREATE_APPLICATION_DROPDOWN_DESTINATION: By = By.xpath('.//div[@qe-id="application-create-dropdown-destination"]');
1517
const CREATE_APPLICATION_DROPDOWN_MENU_URL: By = By.xpath('.//li[@qe-id="application-create-dropdown-destination-URL"]');
@@ -45,18 +47,35 @@ export class ApplicationCreatePanel extends Base {
4547
}
4648
}
4749

48-
public async setSourceRepoUrl(sourceRepoUrl: string): Promise<void> {
50+
public async setSourceOneRepoUrl(sourceRepoUrl: string): Promise<void> {
4951
try {
50-
const reposUrl = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_FIELD_REPOSITORY_URL);
52+
const reposUrl = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_SOURCE_1_FIELD_REPOSITORY_URL);
5153
await reposUrl.sendKeys(sourceRepoUrl);
5254
} catch (err) {
5355
throw new Error(err);
5456
}
5557
}
58+
public async setSourceTwoRepoUrl(sourceRepoUrl: string): Promise<void> {
59+
try {
60+
const reposUrl = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_SOURCE_2_FIELD_REPOSITORY_URL);
61+
await reposUrl.sendKeys(sourceRepoUrl);
62+
} catch (err) {
63+
throw new Error(err);
64+
}
65+
}
66+
67+
public async setSourceOneRepoPath(sourceRepoPath: string): Promise<void> {
68+
try {
69+
const path = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_SOURCE_1_FIELD_REPOSITORY_PATH);
70+
await path.sendKeys(sourceRepoPath);
71+
} catch (err) {
72+
throw new Error(err);
73+
}
74+
}
5675

57-
public async setSourceRepoPath(sourceRepoPath: string): Promise<void> {
76+
public async setSourceTwoRepoPath(sourceRepoPath: string): Promise<void> {
5877
try {
59-
const path = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_FIELD_REPOSITORY_PATH);
78+
const path = await UiTestUtilities.findUiElement(this.driver, CREATE_APPLICATION_SOURCE_2_FIELD_REPOSITORY_PATH);
6079
await path.sendKeys(sourceRepoPath);
6180
} catch (err) {
6281
throw new Error(err);
@@ -184,17 +203,21 @@ export class ApplicationCreatePanel extends Base {
184203
public async createApplication(
185204
appName: string,
186205
projectName: string,
187-
sourceRepoUrl: string,
188-
sourceRepoPath: string,
206+
sourceOneRepoUrl: string,
207+
sourceOneRepoPath: string,
208+
sourceTwoRepoUrl: string,
209+
sourceTwoRepoPath: string,
189210
destinationClusterName: string,
190211
destinationNamespace: string
191212
): Promise<void> {
192213
UiTestUtilities.log('About to create application');
193214
try {
194215
await this.setAppName(appName);
195216
await this.setProjectName(projectName);
196-
await this.setSourceRepoUrl(sourceRepoUrl);
197-
await this.setSourceRepoPath(sourceRepoPath);
217+
await this.setSourceOneRepoUrl(sourceOneRepoUrl);
218+
await this.setSourceOneRepoPath(sourceOneRepoPath);
219+
await this.setSourceTwoRepoUrl(sourceTwoRepoUrl);
220+
await this.setSourceTwoRepoPath(sourceTwoRepoPath);
198221
await this.selectDestinationClusterNameMenu(destinationClusterName);
199222
await this.setDestinationNamespace(destinationNamespace);
200223
await this.clickCreateButton();

ui-test/src/test001.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ async function doTest() {
2929
UiTestUtilities.log('About to create application');
3030
await applicationCreatePanel.setAppName(Configuration.APP_NAME);
3131
await applicationCreatePanel.setProjectName(Configuration.APP_PROJECT);
32-
await applicationCreatePanel.setSourceRepoUrl(Configuration.GIT_REPO);
33-
await applicationCreatePanel.setSourceRepoPath(Configuration.SOURCE_REPO_PATH);
32+
await applicationCreatePanel.setSourceOneRepoUrl(Configuration.GIT_REPO);
33+
await applicationCreatePanel.setSourceOneRepoPath(Configuration.SOURCE_REPO_PATH);
34+
await applicationCreatePanel.setSourceTwoRepoUrl(Configuration.GIT_REPO);
35+
await applicationCreatePanel.setSourceTwoRepoPath(Configuration.SOURCE_REPO_PATH);
3436
await applicationCreatePanel.selectDestinationClusterNameMenu(Configuration.DESTINATION_CLUSTER_NAME);
3537
await applicationCreatePanel.setDestinationNamespace(Configuration.DESTINATION_NAMESPACE);
3638
await applicationCreatePanel.clickCreateButton();

0 commit comments

Comments
 (0)