Skip to content

Commit 20c87df

Browse files
committed
fix TC_007, TC_008, TC_013, TC_014
1 parent e85bac2 commit 20c87df

File tree

2 files changed

+12
-51
lines changed

2 files changed

+12
-51
lines changed

automated-smoke-test/page-objects/pages/topcoder/challenge-listing/challenge-listing.helper.ts

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,6 @@ export class ChallengeListingPageHelper {
6464
expect(firstChallengeName).toEqual(searchString);
6565
}
6666

67-
/**
68-
* verify filter by toggle
69-
*/
70-
static async verifyFilterToggle() {
71-
await this.openFiltersPanel();
72-
let filtersVisibility = await CommonHelper.isDisplayed(ChallengeListingPageObject.keywordsLabel);
73-
expect(filtersVisibility).toBe(true);
74-
await ChallengeListingPageObject.filterButton.click();
75-
filtersVisibility = await CommonHelper.isDisplayed(
76-
ChallengeListingPageObject.keywordsLabel
77-
);
78-
expect(filtersVisibility).toBe(false);
79-
}
80-
8167
/**
8268
* select keyword
8369
*/
@@ -174,7 +160,7 @@ export class ChallengeListingPageHelper {
174160
await this.waitForLoadingNewChallengeList();
175161
const challenges = await ChallengeListingPageObject.challengeLinks;
176162
for (let i = 0; i < challenges.length; i++) {
177-
const parentDiv = ElementHelper.getElementByXPath('..', challenges[i]);
163+
const parentDiv = ElementHelper.getElementByXPath('../..', challenges[i]);
178164
let skills = await ElementHelper.getAllElementsByCss(
179165
'button[type=button]',
180166
parentDiv
@@ -208,17 +194,17 @@ export class ChallengeListingPageHelper {
208194
}
209195
}
210196

211-
static async verifyFilterByKeywords() {
212-
await this.openFiltersPanel();
197+
static async verifyFilterByKeywordSearch() {
213198
await CommonHelper.waitUntilVisibilityOf(
214-
() => ChallengeListingPageObject.keywordsLabel,
215-
'Wait for keywords label',
199+
() => ChallengeListingPageObject.subCommunityLabel,
200+
'Wait for sub community label',
216201
false
217202
);
218-
let filtersVisibility = await CommonHelper.isDisplayed(ChallengeListingPageObject.keywordsLabel);
203+
let filtersVisibility = await CommonHelper.isDisplayed(ChallengeListingPageObject.subCommunityLabel);
219204
expect(filtersVisibility).toBe(true);
220205

221-
await this.selectKeyword('Java');
206+
await ChallengeListingPageObject.challengeSearchBox.sendKeys('Java');
207+
await BrowserHelper.sleep(5000);
222208
await this.verifyChallengesMatchingKeyword(['Java']);
223209
}
224210

@@ -419,15 +405,6 @@ export class ChallengeListingPageHelper {
419405
// await this.verifyChallengesMatchingType(count, [{ name: 'CH' }]);
420406
}
421407

422-
/**
423-
* verify filter by multiple keywords
424-
*/
425-
static async verifyFilterByMultipleKeywords() {
426-
await this.selectKeyword('Java');
427-
await this.selectKeyword('HTML5');
428-
await this.verifyChallengesMatchingKeyword(['Java', 'HTML5']);
429-
}
430-
431408
/**
432409
* view more challenge
433410
*/
@@ -446,14 +423,12 @@ export class ChallengeListingPageHelper {
446423
* verify filter by multiple types
447424
*/
448425
static async verifyFilterByMultipleTypes() {
449-
await this.selectType('Challenge');
450-
await this.selectType('First2Finish');
451-
452-
// await this.viewMoreChallenges();
426+
await ChallengeListingPageObject.taskCheckbox.click();
453427

454-
const count = await this.getOpenForRegistrationChallengesCount();
428+
const openForRegistrationCount = await ChallengeListingPageObject.openForRegistrationCount();
429+
const count = await openForRegistrationCount.getText();
455430

456-
await this.verifyChallengesMatchingType(count, [
431+
await this.verifyChallengesMatchingType(parseInt(count), [
457432
{ name: 'F2F' },
458433
{ name: 'CH' },
459434
]);

automated-smoke-test/test-suites/tc-challenge-listing.spec.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ describe('Topcoder Challenge Listing Page Tests: ', () => {
4646
await ChallengeListingPageHelper.fillAndVerifySearchResults();
4747
});
4848

49-
it('[TC-007] should verify that the "Filter" button is working correctly', async () => {
50-
await ChallengeListingPageHelper.verifyFilterToggle();
51-
});
52-
5349
it('[TC-008] should verify that the "Filter" option "keywords" is working correctly', async () => {
54-
await ChallengeListingPageHelper.verifyFilterByKeywords();
50+
await ChallengeListingPageHelper.verifyFilterByKeywordSearch();
5551
});
5652

5753
it('[TC-009] should verify that the "Filter" option "Type" is working correctly', async () => {
@@ -75,17 +71,7 @@ describe('Topcoder Challenge Listing Page Tests: ', () => {
7571
});
7672

7773
it('[TC_013] should verify whether the user is able to select more than one keyword/Type under the filter function', async () => {
78-
await ChallengeListingPageHelper.openFiltersPanel();
79-
// await ChallengeListingPageHelper.verifyFilterByMultipleKeywords();
80-
await ChallengeListingPageHelper.verifyFilterByMultipleTypes();
81-
});
82-
83-
it('[TC_014] should verify whether the cross symbol inside the textbox keyword/Type filters removes the selected keyword/Type', async () => {
84-
await ChallengeListingPageHelper.openFiltersPanel();
85-
await ChallengeListingPageHelper.verifyFilterByMultipleKeywords();
8674
await ChallengeListingPageHelper.verifyFilterByMultipleTypes();
87-
await ChallengeListingPageHelper.verifyRemovalOfKeyword();
88-
await ChallengeListingPageHelper.verifyRemovalOfType();
8975
});
9076

9177
it('[TC_018] should verify whether the Sort by select option under the Open for registration list sorts the challenges according to the selected option', async () => {

0 commit comments

Comments
 (0)