Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ workflows:
- build-dev
filters: &filters-dev
branches:
only: ['dev', 'feature/copilot-feedback']
only: ['dev', 'feature/new-milestone-concept']

- deployTest01:
context : org-global
Expand Down
3 changes: 2 additions & 1 deletion connect-automation/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"notificationsUrl": "https://connect.topcoder-dev.com/notifications",
"allProjectsUrl": "https://connect.topcoder-dev.com/projects",
"givenProjectUrl": "https://connect.topcoder-dev.com/projects/18013",
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236"
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236",
"platformUrl": "https://platform.topcoder-dev.com/taas/myteams"
}
7 changes: 7 additions & 0 deletions connect-automation/page-objects/common-page/common.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,11 @@ export const CommonHelper = {
}
return isElementPresent;
},

/**
* Get Join Project Button
*/
get joinProjectButton() {
return ElementHelper.getElementByButtonText('Join project');
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export class CreateNewPhaseHelper {
* @param formData phase creation form data defined in test data
*/
public static async verifyCreateNewPhase(formData: IPhaseCreationData) {
// If user is invited to project, click on "Join Project" to proceed.
await BrowserHelper.sleep(4000);
if (await CommonHelper.joinProjectButton.isPresent()) {
await CommonHelper.joinProjectButton.click();
}

await this.clickOnAddNewPhaseButton();
await this.fillCreatePhaseForm(formData.title, formData.daysBetweenStartAndEndDate);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserHelper } from 'topcoder-testing-lib';
import { ConfigHelper } from '../../../utils/config-helper';
import { CommonHelper } from '../../common-page/common.helper';
import { IAnswers, IProjectData } from './create-project.model';
import { IAnswers, IProjectData, ITaasData } from './create-project.model';
import { CreateProjectPageObject } from './create-project.po';

export class CreateProjectPageHelper {
Expand Down Expand Up @@ -29,8 +30,8 @@ export class CreateProjectPageHelper {

await this.clickNewProjectButton();
await this.navigateToViewSolutions();
await this.clickOnDesignDevelopmentDeploymentButton();
await this.fillBeforeWeStartForm(projectData.answers);
await this.clickOnSelectButton();
await this.fillBeforeWeStartForm(projectData.answers, 'Basic Details');
await this.fillBasicDetailsForm(
appNameWithDate,
projectData.appDescription
Expand All @@ -40,6 +41,29 @@ export class CreateProjectPageHelper {
await this.goToYourProject(appNameWithDate);
}

/**
* verify whether the current user can create a TAAS project
*/
public static async verifyTaasProject(taasData: ITaasData) {
await this.clickNewProjectButton();
await this.navigateToTopTalent();
await this.clickOnSelectButton();
await this.fillBeforeWeStartForm(taasData.answers, 'Talent as a Service: Getting Started');
await this.fillTaasProjectTitleForm(taasData.title);
await this.verifyAddJobItem();
await this.verifyDeleteJobItem();
await this.fillJobForm(taasData);
await this.fillTalentRequirementForm(taasData.answers, 'Your Talent Requirements');
await this.fillRequirementForm(taasData.answers, taasData.email);

await this.createProjectPageObject.submitJobRequest.click();
await CommonHelper.verifySuccessAlert(`PROJECT '${taasData.title.toUpperCase()}' CREATED`);

await this.createProjectPageObject.viewTalentRequestButton.click();
await BrowserHelper.sleep(10000);
await CommonHelper.verifyPageUrl(ConfigHelper.getPlatformUrl());
}

private static createProjectPageObject: CreateProjectPageObject;

/**
Expand Down Expand Up @@ -100,10 +124,19 @@ export class CreateProjectPageHelper {
expect(title).toBe('TOPCODER SOLUTIONS');
}

/**
* Click on "Tap Into Top Talen" under "TAAS" section
*/
private static async navigateToTopTalent() {
await this.createProjectPageObject.tapIntoTopTalent.click();
const title = await this.createProjectPageObject.solutionCatalogTitle.getText();
expect(title).toBe('ENGAGE TALENT');
}

/**
* Click on "Select" button under Design, Development and Deployment.
*/
private static async clickOnDesignDevelopmentDeploymentButton() {
private static async clickOnSelectButton() {
const selectButton = await this.createProjectPageObject.selectButton();
await selectButton.click();
await this.verifyFormDisplayed('Before we start');
Expand All @@ -112,14 +145,29 @@ export class CreateProjectPageHelper {
/**
* Fill Before We Start form
* @param answers answers object defined by test data
* @param formTitle form title to be expected
*/
private static async fillBeforeWeStartForm(answers: IAnswers) {
private static async fillBeforeWeStartForm(answers: IAnswers, formTitle: string) {
const { beforeWeStart } = answers;
await CommonHelper.selectInputByContainingText(beforeWeStart);

await this.createProjectPageObject.nextButton.click();

await this.verifyFormDisplayed('Basic Details');
await this.verifyFormDisplayed(formTitle);
}

/**
* Fill Before We Start form
* @param answers answers object defined by test data
* @param formTitle form title to be expected
*/
private static async fillTalentRequirementForm(answers: IAnswers, formTitle: string) {
const { startDate } = answers;
await CommonHelper.selectInputByContainingText(startDate);

await this.createProjectPageObject.nextButton.click();

await this.verifyFormDisplayed(formTitle);
}

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

/**
* Fill Taas Project title, then click next
* @param title taas application title
*/
private static async fillTaasProjectTitleForm(title: string) {
const name = this.createProjectPageObject.appNameInput;
await CommonHelper.fillInputField(name, title);
await this.createProjectPageObject.nextButton.click();

await this.verifyFormDisplayed('Your Talent Requirements');
}

/**
* Fill Requirement Form, then click next
* @param title taas application title
* @param email
*/
private static async fillRequirementForm(answers: IAnswers, email: string) {
const { requirement } = answers;
await CommonHelper.selectInputByContainingText(requirement);

await this.createProjectPageObject.emailInput.click();
await this.createProjectPageObject.emailInput.sendKeys(email);

await this.createProjectPageObject.nextButton.click();
}

/**
* Fill Taas Job Form
* @param taasData
*/
private static async fillJobForm(taasData: ITaasData) {
const { jobTitle, numOfPeople, duration, description } = taasData;

const titleEl = this.createProjectPageObject.titleInput;
await CommonHelper.fillInputField(titleEl, jobTitle);

const numberInputs = await this.createProjectPageObject.numberInputEls();
await CommonHelper.fillInputField(numberInputs[0], numOfPeople + '');
await CommonHelper.fillInputField(numberInputs[1], duration + '');

const dropdownInputs = await this.createProjectPageObject.dropdownEls();
await dropdownInputs[0].click();
let dropdownOptions = await this.createProjectPageObject.dropdownOptions();
await dropdownOptions[1].click();

await dropdownInputs[1].click();
dropdownOptions = await this.createProjectPageObject.dropdownOptions();
await BrowserHelper.sleep(200);
await dropdownOptions[6].click();

await this.createProjectPageObject.editorTextarea.click();
await this.createProjectPageObject.editorTextareaInput.sendKeys(description);

await this.createProjectPageObject.skillsInput.click();
await BrowserHelper.sleep(2500);
await this.createProjectPageObject.multiSelectOption.click();

await this.createProjectPageObject.nextButton.click();

await this.verifyFormDisplayed('Your Talent Requirements');
}

/**
* Fill App Definition Form, then click next
* @param projectData project data from test data
Expand Down Expand Up @@ -191,4 +302,22 @@ export class CreateProjectPageHelper {

expect(await CommonHelper.projectTitle().getText()).toBe(appName);
}

/**
* Add job item and verify Add Job Item
*/
private static async verifyAddJobItem() {
await this.createProjectPageObject.plusIcon.click();
let jobFormNumber = await this.createProjectPageObject.taasJobForm();
expect(jobFormNumber.length).toBe(2);
}

/**
* Delete job item and verify Deletion of Job Item
*/
private static async verifyDeleteJobItem() {
await this.createProjectPageObject.deleteIcon.click();
const jobFormNumber = await this.createProjectPageObject.taasJobForm();
expect(jobFormNumber.length).toBe(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ export interface IProjectData {
notes: string;
}

export interface ITaasData {
title: string;
jobTitle: string;
numOfPeople: number;
duration: number;
description: string;
email: string;
answers: IAnswers;
}

export interface IAnswers {
beforeWeStart: string;
whatDoYouNeed: string;
willYourAppNeedMoreScreen: string;
howManyScreens: string;
whereShouldAppWork: string;
howShouldAppWorks: string;
whatDoYouNeed?: string;
willYourAppNeedMoreScreen?: string;
howManyScreens?: string;
whereShouldAppWork?: string;
howShouldAppWorks?: string;
startDate?: string;
requirement?: string;
}
Loading