def verify_expected_problem_visibility(test, courseware_page, expected_problems):
 test.assertEqual(len(expected_problems), courseware_page.num_xblock_components, 'Incorrect number of visible problems')
 for (index, expected_problem) in enumerate(expected_problems):
  test.assertIn(expected_problem, courseware_page.xblock_components[index].text)

def verify_expected_problem_visibility ( test , courseware_page , expected_problems ) : test . assertEqual ( len ( expected_problems ) , courseware_page . num_xblock_components , 'Incorrect number of visible problems' ) for ( index , expected_problem ) in enumerate ( expected_problems ) : test . assertIn ( expected_problem , courseware_page . xblock_components [ index ] . text )
helper method that checks that the expected problems are visible on the current page .