Skip to content

Commit 3eaa310

Browse files
authored
Merge pull request #4429 from appirio-tech/dev
[PROD] Milestone Management
2 parents 6a6aade + 99f60e2 commit 3eaa310

File tree

68 files changed

+2658
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2658
-109
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ workflows:
188188
- build-dev
189189
filters: &filters-dev
190190
branches:
191-
only: ['dev', 'feature/copilot-feedback']
191+
only: ['dev', 'feature/new-milestone-concept']
192192

193193
- deployTest01:
194194
context : org-global

connect-automation/config/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
"notificationsUrl": "https://connect.topcoder-dev.com/notifications",
2525
"allProjectsUrl": "https://connect.topcoder-dev.com/projects",
2626
"givenProjectUrl": "https://connect.topcoder-dev.com/projects/18013",
27-
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236"
27+
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236",
28+
"platformUrl": "https://platform.topcoder-dev.com/taas/myteams"
2829
}

connect-automation/page-objects/common-page/common.helper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,11 @@ export const CommonHelper = {
367367
}
368368
return isElementPresent;
369369
},
370+
371+
/**
372+
* Get Join Project Button
373+
*/
374+
get joinProjectButton() {
375+
return ElementHelper.getElementByButtonText('Join project');
376+
},
370377
};

connect-automation/page-objects/phase-creation-flow/create-new-phase/create-new-phase.helper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export class CreateNewPhaseHelper {
1919
* @param formData phase creation form data defined in test data
2020
*/
2121
public static async verifyCreateNewPhase(formData: IPhaseCreationData) {
22+
// If user is invited to project, click on "Join Project" to proceed.
23+
await BrowserHelper.sleep(4000);
24+
if (await CommonHelper.joinProjectButton.isPresent()) {
25+
await CommonHelper.joinProjectButton.click();
26+
}
27+
2228
await this.clickOnAddNewPhaseButton();
2329
await this.fillCreatePhaseForm(formData.title, formData.daysBetweenStartAndEndDate);
2430

connect-automation/page-objects/project-creation-flow/create-project/create-project.helper.ts

Lines changed: 135 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { BrowserHelper } from 'topcoder-testing-lib';
2+
import { ConfigHelper } from '../../../utils/config-helper';
23
import { CommonHelper } from '../../common-page/common.helper';
3-
import { IAnswers, IProjectData } from './create-project.model';
4+
import { IAnswers, IProjectData, ITaasData } from './create-project.model';
45
import { CreateProjectPageObject } from './create-project.po';
56

67
export class CreateProjectPageHelper {
@@ -29,8 +30,8 @@ export class CreateProjectPageHelper {
2930

3031
await this.clickNewProjectButton();
3132
await this.navigateToViewSolutions();
32-
await this.clickOnDesignDevelopmentDeploymentButton();
33-
await this.fillBeforeWeStartForm(projectData.answers);
33+
await this.clickOnSelectButton();
34+
await this.fillBeforeWeStartForm(projectData.answers, 'Basic Details');
3435
await this.fillBasicDetailsForm(
3536
appNameWithDate,
3637
projectData.appDescription
@@ -40,6 +41,29 @@ export class CreateProjectPageHelper {
4041
await this.goToYourProject(appNameWithDate);
4142
}
4243

44+
/**
45+
* verify whether the current user can create a TAAS project
46+
*/
47+
public static async verifyTaasProject(taasData: ITaasData) {
48+
await this.clickNewProjectButton();
49+
await this.navigateToTopTalent();
50+
await this.clickOnSelectButton();
51+
await this.fillBeforeWeStartForm(taasData.answers, 'Talent as a Service: Getting Started');
52+
await this.fillTaasProjectTitleForm(taasData.title);
53+
await this.verifyAddJobItem();
54+
await this.verifyDeleteJobItem();
55+
await this.fillJobForm(taasData);
56+
await this.fillTalentRequirementForm(taasData.answers, 'Your Talent Requirements');
57+
await this.fillRequirementForm(taasData.answers, taasData.email);
58+
59+
await this.createProjectPageObject.submitJobRequest.click();
60+
await CommonHelper.verifySuccessAlert(`PROJECT '${taasData.title.toUpperCase()}' CREATED`);
61+
62+
await this.createProjectPageObject.viewTalentRequestButton.click();
63+
await BrowserHelper.sleep(10000);
64+
await CommonHelper.verifyPageUrl(ConfigHelper.getPlatformUrl());
65+
}
66+
4367
private static createProjectPageObject: CreateProjectPageObject;
4468

4569
/**
@@ -100,10 +124,19 @@ export class CreateProjectPageHelper {
100124
expect(title).toBe('TOPCODER SOLUTIONS');
101125
}
102126

127+
/**
128+
* Click on "Tap Into Top Talen" under "TAAS" section
129+
*/
130+
private static async navigateToTopTalent() {
131+
await this.createProjectPageObject.tapIntoTopTalent.click();
132+
const title = await this.createProjectPageObject.solutionCatalogTitle.getText();
133+
expect(title).toBe('ENGAGE TALENT');
134+
}
135+
103136
/**
104137
* Click on "Select" button under Design, Development and Deployment.
105138
*/
106-
private static async clickOnDesignDevelopmentDeploymentButton() {
139+
private static async clickOnSelectButton() {
107140
const selectButton = await this.createProjectPageObject.selectButton();
108141
await selectButton.click();
109142
await this.verifyFormDisplayed('Before we start');
@@ -112,14 +145,29 @@ export class CreateProjectPageHelper {
112145
/**
113146
* Fill Before We Start form
114147
* @param answers answers object defined by test data
148+
* @param formTitle form title to be expected
115149
*/
116-
private static async fillBeforeWeStartForm(answers: IAnswers) {
150+
private static async fillBeforeWeStartForm(answers: IAnswers, formTitle: string) {
117151
const { beforeWeStart } = answers;
118152
await CommonHelper.selectInputByContainingText(beforeWeStart);
119153

120154
await this.createProjectPageObject.nextButton.click();
121155

122-
await this.verifyFormDisplayed('Basic Details');
156+
await this.verifyFormDisplayed(formTitle);
157+
}
158+
159+
/**
160+
* Fill Before We Start form
161+
* @param answers answers object defined by test data
162+
* @param formTitle form title to be expected
163+
*/
164+
private static async fillTalentRequirementForm(answers: IAnswers, formTitle: string) {
165+
const { startDate } = answers;
166+
await CommonHelper.selectInputByContainingText(startDate);
167+
168+
await this.createProjectPageObject.nextButton.click();
169+
170+
await this.verifyFormDisplayed(formTitle);
123171
}
124172

125173
/**
@@ -138,6 +186,69 @@ export class CreateProjectPageHelper {
138186
await this.verifyFormDisplayed('App Definition');
139187
}
140188

189+
/**
190+
* Fill Taas Project title, then click next
191+
* @param title taas application title
192+
*/
193+
private static async fillTaasProjectTitleForm(title: string) {
194+
const name = this.createProjectPageObject.appNameInput;
195+
await CommonHelper.fillInputField(name, title);
196+
await this.createProjectPageObject.nextButton.click();
197+
198+
await this.verifyFormDisplayed('Your Talent Requirements');
199+
}
200+
201+
/**
202+
* Fill Requirement Form, then click next
203+
* @param title taas application title
204+
* @param email
205+
*/
206+
private static async fillRequirementForm(answers: IAnswers, email: string) {
207+
const { requirement } = answers;
208+
await CommonHelper.selectInputByContainingText(requirement);
209+
210+
await this.createProjectPageObject.emailInput.click();
211+
await this.createProjectPageObject.emailInput.sendKeys(email);
212+
213+
await this.createProjectPageObject.nextButton.click();
214+
}
215+
216+
/**
217+
* Fill Taas Job Form
218+
* @param taasData
219+
*/
220+
private static async fillJobForm(taasData: ITaasData) {
221+
const { jobTitle, numOfPeople, duration, description } = taasData;
222+
223+
const titleEl = this.createProjectPageObject.titleInput;
224+
await CommonHelper.fillInputField(titleEl, jobTitle);
225+
226+
const numberInputs = await this.createProjectPageObject.numberInputEls();
227+
await CommonHelper.fillInputField(numberInputs[0], numOfPeople + '');
228+
await CommonHelper.fillInputField(numberInputs[1], duration + '');
229+
230+
const dropdownInputs = await this.createProjectPageObject.dropdownEls();
231+
await dropdownInputs[0].click();
232+
let dropdownOptions = await this.createProjectPageObject.dropdownOptions();
233+
await dropdownOptions[1].click();
234+
235+
await dropdownInputs[1].click();
236+
dropdownOptions = await this.createProjectPageObject.dropdownOptions();
237+
await BrowserHelper.sleep(200);
238+
await dropdownOptions[6].click();
239+
240+
await this.createProjectPageObject.editorTextarea.click();
241+
await this.createProjectPageObject.editorTextareaInput.sendKeys(description);
242+
243+
await this.createProjectPageObject.skillsInput.click();
244+
await BrowserHelper.sleep(2500);
245+
await this.createProjectPageObject.multiSelectOption.click();
246+
247+
await this.createProjectPageObject.nextButton.click();
248+
249+
await this.verifyFormDisplayed('Your Talent Requirements');
250+
}
251+
141252
/**
142253
* Fill App Definition Form, then click next
143254
* @param projectData project data from test data
@@ -191,4 +302,22 @@ export class CreateProjectPageHelper {
191302

192303
expect(await CommonHelper.projectTitle().getText()).toBe(appName);
193304
}
305+
306+
/**
307+
* Add job item and verify Add Job Item
308+
*/
309+
private static async verifyAddJobItem() {
310+
await this.createProjectPageObject.plusIcon.click();
311+
let jobFormNumber = await this.createProjectPageObject.taasJobForm();
312+
expect(jobFormNumber.length).toBe(2);
313+
}
314+
315+
/**
316+
* Delete job item and verify Deletion of Job Item
317+
*/
318+
private static async verifyDeleteJobItem() {
319+
await this.createProjectPageObject.deleteIcon.click();
320+
const jobFormNumber = await this.createProjectPageObject.taasJobForm();
321+
expect(jobFormNumber.length).toBe(1);
322+
}
194323
}

connect-automation/page-objects/project-creation-flow/create-project/create-project.model.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@ export interface IProjectData {
55
notes: string;
66
}
77

8+
export interface ITaasData {
9+
title: string;
10+
jobTitle: string;
11+
numOfPeople: number;
12+
duration: number;
13+
description: string;
14+
email: string;
15+
answers: IAnswers;
16+
}
17+
818
export interface IAnswers {
919
beforeWeStart: string;
10-
whatDoYouNeed: string;
11-
willYourAppNeedMoreScreen: string;
12-
howManyScreens: string;
13-
whereShouldAppWork: string;
14-
howShouldAppWorks: string;
20+
whatDoYouNeed?: string;
21+
willYourAppNeedMoreScreen?: string;
22+
howManyScreens?: string;
23+
whereShouldAppWork?: string;
24+
howShouldAppWorks?: string;
25+
startDate?: string;
26+
requirement?: string;
1527
}

0 commit comments

Comments
 (0)