@@ -22,7 +22,7 @@ async def main_menu_and_openstax_logo_is_visible(self):
2222
2323 @pytest .mark .asyncio
2424 async def osweb_homepage_content_sections (self ):
25- return await self .page .locator (f "main > section:nth-child(5)" ).is_visible ()
25+ return await self .page .locator ("main > section:nth-child(5)" ).is_visible ()
2626
2727 @pytest .mark .asyncio
2828 async def upper_menu_options (self ):
@@ -92,11 +92,11 @@ async def resources_tabs_are_visible(self):
9292
9393 @pytest .mark .asyncio
9494 async def click_instructor_resources_tab (self ):
95- await self .page .locator ("id= Instructor resources-tab" ).click ()
95+ await self .page .locator (r"# Instructor\ resources-tab" ).click ()
9696
9797 @pytest .mark .asyncio
9898 async def click_student_resources_tab (self ):
99- await self .page .locator ("id= Student resources-tab" ).click ()
99+ await self .page .locator (r"# Student\ resources-tab" ).click ()
100100
101101 @pytest .mark .asyncio
102102 async def click_subjects_science_link (self ):
@@ -120,7 +120,7 @@ async def subjects_title(self):
120120
121121 @pytest .mark .asyncio
122122 async def highlights_option_is_visible (self ):
123- return await self .page .locator ("id= nudge-study-tools" ).is_visible ()
123+ return await self .page .locator ("# nudge-study-tools" ).is_visible ()
124124
125125 @pytest .mark .asyncio
126126 async def click_highlights_option (self ):
@@ -194,7 +194,7 @@ async def click_give_today_link(self):
194194
195195 @pytest .mark .asyncio
196196 async def footer_section (self ):
197- return await self .page .locator ("id= footer" ).is_visible ()
197+ return await self .page .locator ("# footer" ).is_visible ()
198198
199199 @pytest .mark .asyncio
200200 async def footer_section_help_is_visible (self ):
@@ -310,11 +310,11 @@ async def click_login_other(self):
310310
311311 @pytest .mark .asyncio
312312 async def fill_user_field (self , value ):
313- await self .page .locator ("id= login_form_email" ).fill (value )
313+ await self .page .locator ("# login_form_email" ).fill (value )
314314
315315 @pytest .mark .asyncio
316316 async def fill_password_field (self , value ):
317- await self .page .locator ("id= login_form_password" ).fill (value )
317+ await self .page .locator ("# login_form_password" ).fill (value )
318318
319319 @pytest .mark .asyncio
320320 async def click_continue_login (self ):
@@ -391,30 +391,24 @@ async def click_highlight_box_trash_icon(self):
391391 await self .page .get_by_label ("Deselect current highlight" ).click ()
392392
393393 @pytest .mark .asyncio
394- async def double_click_highlight_infobox (self ):
395- return (
396- await self .page .get_by_role ("dialog" )
397- .get_by_text ("Press Enter or double-click highlight to edit highlight" )
398- .dblclick ()
399- )
394+ async def oneclick_highlight_infobox (self ):
395+ return await self .page .get_by_label ("Edit highlighted note" ).click ()
400396
401397 @property
402398 def highlight_infobox (self ):
403- return self .page .get_by_role ("dialog" ).get_by_text (
404- "Press Enter or double-click highlight to edit highlight"
405- )
399+ return self .page .get_by_label ("Edit highlighted note" )
406400
407401 @pytest .mark .asyncio
408402 async def highlight_box_is_visible (self ):
409- return await self .page .locator ("id= note-textarea" ).is_visible ()
403+ return await self .page .locator ("# note-textarea" ).is_visible ()
410404
411405 @pytest .mark .asyncio
412406 async def click_highlight_box_note_field (self ):
413- await self .page .locator ("id= note-textarea" ).click ()
407+ await self .page .locator ("# note-textarea" ).click ()
414408
415409 @pytest .mark .asyncio
416410 async def fill_highlight_box_note_field (self , value ):
417- await self .page .locator ("id= note-textarea" ).fill (value )
411+ await self .page .locator ("# note-textarea" ).fill (value )
418412
419413 @pytest .mark .asyncio
420414 async def highlight_box_colours_are_visible (self ):
@@ -432,25 +426,13 @@ async def click_highlight_box_purple_colour(self):
432426 async def click_highlights_option_green_colour (self ):
433427 await self .page .locator ("div" ).get_by_title ("green" ).first .click ()
434428
435- @property
436- def highlights_option_text_colour_purple (self ):
437- return self .page .locator (
438- "div.HighlightListElement__HighlightContentWrapper-s4j4lf-1.ibAyfS"
439- )
440-
441- @property
442- def highlights_option_text_colour_green (self ):
443- return self .page .locator (
444- "div.HighlightListElement__HighlightContentWrapper-s4j4lf-1.kuxHtj"
445- )
446-
447429 @property
448430 def highlights_option_text_colour_check_purple (self ):
449- return self .highlights_option_text_colour_purple .get_attribute ("color" )
431+ return self .page . locator ( 'div[color="purple"]' ) .get_attribute ("color" )
450432
451433 @property
452434 def highlights_option_text_colour_check_green (self ):
453- return self .highlights_option_text_colour_green .get_attribute ("color" )
435+ return self .page . locator ( 'div[color="green"]' ) .get_attribute ("color" )
454436
455437 @pytest .mark .asyncio
456438 async def small_highlighted_note_box_is_visible (self ):
@@ -498,7 +480,7 @@ async def click_new_chapter(self):
498480
499481 @pytest .mark .asyncio
500482 async def click_show_hide_solution_link (self ):
501- await self .page .locator ("id= fs-id1165134108429" ).get_by_title (
483+ await self .page .locator ("# fs-id1165134108429" ).get_by_title (
502484 "Show/Hide Solution"
503485 ).click ()
504486
0 commit comments