@@ -15,32 +15,20 @@ import { BasePage } from './base-page';
1515
1616export class NoteCreateModal extends BasePage {
1717 readonly modal : Locator ;
18- readonly modalTitle : Locator ;
1918 readonly closeButton : Locator ;
2019 readonly noteNameInput : Locator ;
2120 readonly interpreterDropdown : Locator ;
22- readonly interpreterTextbox : Locator ;
23- readonly interpreterOptions : Locator ;
2421 readonly folderInfoAlert : Locator ;
2522 readonly createButton : Locator ;
26- readonly cloneButton : Locator ;
2723
2824 constructor ( page : Page ) {
2925 super ( page ) ;
3026 this . modal = page . locator ( '[role="dialog"]' ) . filter ( { has : page . locator ( 'input[name="noteName"]' ) } ) ;
31- this . modalTitle = page . locator ( '.ant-modal-title' ) ;
3227 this . closeButton = page . getByRole ( 'button' , { name : 'Close' } ) ;
3328 this . noteNameInput = page . locator ( 'input[name="noteName"]' ) ;
3429 this . interpreterDropdown = page . locator ( 'nz-select[name="defaultInterpreter"]' ) ;
35- this . interpreterTextbox = this . interpreterDropdown . locator ( 'input' ) ;
36- this . interpreterOptions = page . locator ( 'nz-option-item' ) ;
3730 this . folderInfoAlert = page . getByText ( "Use '/' to create folders" ) ;
3831 this . createButton = page . getByRole ( 'button' , { name : 'Create' } ) ;
39- this . cloneButton = page . getByRole ( 'button' , { name : 'Clone' } ) ;
40- }
41-
42- async isModalVisible ( ) : Promise < boolean > {
43- return this . modal . isVisible ( ) ;
4432 }
4533
4634 async close ( ) : Promise < void > {
@@ -56,62 +44,11 @@ export class NoteCreateModal extends BasePage {
5644 await this . noteNameInput . fill ( name ) ;
5745 }
5846
59- async openInterpreterDropdown ( ) : Promise < void > {
60- await this . interpreterDropdown . click ( ) ;
61- }
62-
63- async selectInterpreter ( interpreterName : string ) : Promise < void > {
64- await this . openInterpreterDropdown ( ) ;
65-
66- // Handle browser-specific differences
67- const browserName = this . page . context ( ) . browser ( ) ?. browserType ( ) . name ( ) ;
68-
69- if ( browserName === 'webkit' ) {
70- // WebKit needs more specific targeting
71- await this . page . locator ( '.ant-select-item-option-content' ) . filter ( { hasText : interpreterName } ) . first ( ) . click ( ) ;
72- } else {
73- // Chrome/Firefox - use nz-option-item
74- await this . page . locator ( 'nz-option-item' ) . filter ( { hasText : interpreterName } ) . first ( ) . click ( ) ;
75- }
76- }
77-
78- async searchInterpreter ( searchTerm : string ) : Promise < void > {
79- await this . openInterpreterDropdown ( ) ;
80- await this . interpreterTextbox . fill ( searchTerm ) ;
81- }
82-
83- async getAvailableInterpreters ( ) : Promise < string [ ] > {
84- await this . openInterpreterDropdown ( ) ;
85- const options = await this . interpreterOptions . allTextContents ( ) ;
86- await this . page . keyboard . press ( 'Escape' ) ;
87- return options ;
88- }
89-
9047 async clickCreate ( ) : Promise < void > {
9148 await this . createButton . click ( ) ;
9249 }
9350
94- async clickClone ( ) : Promise < void > {
95- await this . cloneButton . click ( ) ;
96- }
97-
98- async isCreateButtonVisible ( ) : Promise < boolean > {
99- return this . createButton . isVisible ( ) ;
100- }
101-
102- async isCloneButtonVisible ( ) : Promise < boolean > {
103- return this . cloneButton . isVisible ( ) ;
104- }
105-
106- async isInterpreterDropdownVisible ( ) : Promise < boolean > {
107- return this . interpreterDropdown . isVisible ( ) ;
108- }
109-
11051 async isFolderInfoVisible ( ) : Promise < boolean > {
11152 return this . folderInfoAlert . isVisible ( ) ;
11253 }
113-
114- async getModalTitle ( ) : Promise < string > {
115- return ( await this . modalTitle . textContent ( ) ) || '' ;
116- }
11754}
0 commit comments