@@ -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 ] ) ;
0 commit comments