@@ -649,44 +649,95 @@ def assert_weekview_item_visibility(self, visible_groups=None):
649649 else :
650650 self .assertIsNone (item_div , 'Unexpected weekview entry for "%s" (%s)' % (label , item .slug ()))
651651
652+ @staticmethod
653+ def open_agenda_filter_ui (wait ):
654+ """Click the 'customize' anchor to reveal the group buttons"""
655+ customize_anchor = wait .until (
656+ expected_conditions .element_to_be_clickable (
657+ (By .CSS_SELECTOR , '#accordion a[data-toggle="collapse"]' )
658+ )
659+ )
660+ customize_anchor .click ()
661+ return customize_anchor
662+
663+ @staticmethod
664+ def get_agenda_filter_group_button (wait , group_acronym ):
665+ return wait .until (
666+ expected_conditions .element_to_be_clickable (
667+ (By .CSS_SELECTOR , 'button.pickview.%s' % group_acronym )
668+ )
669+ )
670+
652671 def test_agenda_view_group_filter_toggle (self ):
653672 """Clicking a group toggle enables/disables agenda filtering"""
673+ wait = WebDriverWait (self .driver , 2 )
654674 group_acronym = 'mars'
655675
656676 self .login ()
657677 url = self .absreverse ('ietf.meeting.views.agenda' )
658678 self .driver .get (url )
659679
660- # Click the 'customize' anchor to reveal the group buttons
661- customize_anchor = WebDriverWait (self .driver , 2 ).until (
662- expected_conditions .element_to_be_clickable (
663- (By .CSS_SELECTOR , '#accordion a[data-toggle="collapse"]' )
664- )
665- )
666- customize_anchor .click ()
680+ self .open_agenda_filter_ui (wait )
667681
668682 # Click the group button
669- group_button = WebDriverWait (self .driver , 2 ).until (
670- expected_conditions .element_to_be_clickable (
671- (By .CSS_SELECTOR , 'button.pickview.%s' % group_acronym )
672- )
673- )
683+ group_button = self .get_agenda_filter_group_button (wait , group_acronym )
674684 group_button .click ()
675685
676686 # Check visibility
677687 self .assert_agenda_item_visibility ([group_acronym ])
678688
679689 # Click the group button again
680- group_button = WebDriverWait (self .driver , 2 ).until (
681- expected_conditions .element_to_be_clickable (
682- (By .CSS_SELECTOR , 'button.pickview.%s' % group_acronym )
683- )
684- )
685690 group_button .click ()
686691
687692 # Check visibility
688693 self .assert_agenda_item_visibility ()
689694
695+ def test_agenda_view_team_group_filter_toggle (self ):
696+ """'Team' group sessions should not respond to area filter button
697+
698+ Sessions belonging to 'team' groups should not respond to their parent buttons. This prevents,
699+ e.g., 'hackathon', or 'tools' group sessions from being shown/hidden when their parent group
700+ filter button is clicked.
701+ """
702+ wait = WebDriverWait (self .driver , 10 )
703+ meeting = Meeting .objects .get (type_id = 'ietf' )
704+ parent_group = GroupFactory (type_id = 'area' )
705+ other_group = GroupFactory (parent = parent_group , type_id = 'wg' )
706+ hackathon_group = GroupFactory (acronym = 'hackathon' , type_id = 'team' , parent = parent_group )
707+
708+ # hackathon session
709+ SessionFactory (
710+ meeting = meeting ,
711+ type_id = 'other' ,
712+ group = hackathon_group ,
713+ name = 'Hackathon' ,
714+ )
715+
716+ # session to cause the parent_group to appear in the filter UI tables
717+ SessionFactory (meeting = meeting , type_id = 'regular' , group = other_group )
718+
719+ self .login ()
720+ url = self .absreverse ('ietf.meeting.views.agenda' )
721+ self .driver .get (url )
722+
723+ self .open_agenda_filter_ui (wait )
724+
725+ self .get_agenda_filter_group_button (wait , 'mars' ).click ()
726+ self .assert_agenda_item_visibility (['mars' ])
727+
728+ # enable hackathon group
729+ group_button = self .get_agenda_filter_group_button (wait , 'hackathon' )
730+ group_button .click ()
731+ self .assert_agenda_item_visibility (['mars' , 'hackathon' ])
732+
733+ # disable hackathon group
734+ group_button .click ()
735+ self .assert_agenda_item_visibility (['mars' ])
736+
737+ # clicking area should not show the hackathon
738+ self .get_agenda_filter_group_button (wait , parent_group .acronym ).click ()
739+ self .assert_agenda_item_visibility (['mars' , other_group .acronym ])
740+
690741 def test_agenda_view_group_filter_toggle_without_replace_state (self ):
691742 """Toggle should function for browsers without window.history.replaceState"""
692743 group_acronym = 'mars'
0 commit comments