@@ -37,7 +37,7 @@ export class ProjectsPage {
3737 return this . page . getByTestId ( `project-grid-item-title-${ projectName } ` ) ;
3838 }
3939 gridProjectStarButton ( projectName : string ) : Locator {
40- return this . page . getByTestId ( `project-grid-item-star-btn-${ projectName } ` ) ;
40+ return this . page . getByTestId ( `project-grid-item-star-btn-wrapper- ${ projectName } ` ) . locator ( 'button' ) ;
4141 }
4242 gridProjectMenuButton ( projectName : string ) : Locator {
4343 return this . page . getByTestId ( `project-grid-item-menu-btn-${ projectName } ` ) ;
@@ -68,10 +68,12 @@ export class ProjectsPage {
6868 // Modal - Create New Project
6969 modalTitle : Locator = this . page . getByText ( "Create new project" ) ;
7070 projectNameLabel : Locator = this . page . getByText ( "Project Name *" ) ;
71- projectNameInput : Locator = this . page . locator ( 'input[placeholder="Text"]' ) ;
71+ projectNameInput : Locator = this . page . getByTestId ( "project-name-input" ) ;
72+ projectAliasLabel : Locator = this . page . getByText ( "Project Alias *" ) ;
73+ projectAliasInput : Locator = this . page . getByTestId ( "project-alias-input" ) ;
7274 descriptionLabel : Locator = this . page . getByText ( "Description" ) ;
73- descriptionTextarea : Locator = this . page . locator (
74- 'textarea[placeholder="Write down your content"]'
75+ descriptionTextarea : Locator = this . page . getByTestId (
76+ "project-description-input"
7577 ) ;
7678 cancelButton : Locator = this . page . getByRole ( "button" , { name : "Cancel" } ) ;
7779 applyButton : Locator = this . page . getByRole ( "button" , { name : "Apply" } ) ;
@@ -110,38 +112,33 @@ export class ProjectsPage {
110112
111113 constructor ( private page : Page ) { }
112114
113- async createNewProject ( projectName : string , description : string ) {
115+ async createNewProject (
116+ projectName : string ,
117+ projectAlias : string ,
118+ description : string
119+ ) {
114120 await this . projectNameInput . waitFor ( { state : "visible" } ) ;
115121 await this . projectNameInput . fill ( "" ) ;
116122 await this . projectNameInput . fill ( projectName ) ;
123+ await this . projectAliasInput . fill ( "" ) ;
124+ await this . projectAliasInput . fill ( projectAlias ) ;
117125 await this . descriptionTextarea . fill ( description ) ;
118126 await this . applyButton . click ( ) ;
119127 }
120128 async deleteProject ( projectName : string ) {
121- const projectRow = this . page
122- . locator ( `.css-96bt7k` , {
123- hasText : projectName
124- } )
125- . first ( ) ;
126- const projectMenuButton = projectRow
127- . locator ( 'button[appearance="simple"]' )
128- . nth ( 1 ) ;
129+ const projectMenuButton = this . gridProjectMenuButton ( projectName ) . first ( ) ;
129130 await projectMenuButton . click ( ) ;
130- await this . moveToRecycleBinButton . waitFor ( { state : "visible" } ) ;
131131 await this . moveToRecycleBinButton . click ( ) ;
132- await this . popUpRemoveButton . waitFor ( { state : "visible" } ) ;
132+ await expect ( this . popUpRemoveButton ) . toBeVisible ( ) ;
133133 await this . popUpRemoveButton . click ( ) ;
134- await this . page . waitForTimeout ( 2000 ) ;
134+ await expect ( this . gridProjectItem ( projectName ) . first ( ) ) . not . toBeVisible ( ) ;
135135 }
136136
137137 async starredProject ( projectName : string ) {
138- const projectRow = this . page . locator ( `.css-96bt7k` , {
139- hasText : projectName
140- } ) ;
141- const projectMenuButton = projectRow
142- . locator ( 'button[appearance="simple"]' )
143- . nth ( 0 ) ;
144- await projectMenuButton . click ( ) ;
138+ const projectItem = this . gridProjectItem ( projectName ) . first ( ) ;
139+ await projectItem . hover ( ) ;
140+ const starButton = this . gridProjectStarButton ( projectName ) . first ( ) ;
141+ await starButton . click ( ) ;
145142 }
146143
147144 async verifyImportProject ( projectName : string ) {
@@ -154,28 +151,26 @@ export class ProjectsPage {
154151 }
155152
156153 async verifyStarredProject ( specialProjectName : string ) {
157- const projectRow = this . page . locator (
158- `div:has-text(" ${ specialProjectName } ")`
159- ) ;
160- const starIcon = projectRow . locator ( 'svg[color="#f1c21b"]' ) . first ( ) ;
154+ const projectItem = this . gridProjectItem ( specialProjectName ) . first ( ) ;
155+ await projectItem . hover ( ) ;
156+ const starButton = this . gridProjectStarButton ( specialProjectName ) . first ( ) ;
157+ const starIcon = starButton . getByTestId ( 'icon-starFilled' ) ;
161158 await expect ( starIcon ) . toBeVisible ( ) ;
162159 }
163160
164161 async unStarredProject ( projectName : string ) {
165- const projectRow = this . page . locator ( `.css-96bt7k` , {
166- hasText : projectName
167- } ) ;
168- const projectMenuButton = projectRow
169- . locator ( 'button[appearance="simple"]' )
170- . nth ( 0 ) ;
171- await projectMenuButton . click ( ) ;
162+ const projectItem = this . gridProjectItem ( projectName ) . first ( ) ;
163+ await projectItem . hover ( ) ;
164+ const starButton = this . gridProjectStarButton ( projectName ) . first ( ) ;
165+ await starButton . click ( ) ;
172166 }
167+
173168 async verifyUnStarredProject ( specialProjectName : string ) {
174- const projectRow = this . page . locator (
175- `div:has-text(" ${ specialProjectName } ")`
176- ) ;
177- const unStarIcon = projectRow . locator ( 'svg[color="#e0e0e0"]' ) . first ( ) ;
178- await expect ( unStarIcon ) . toBeVisible ( ) ;
169+ const projectItem = this . gridProjectItem ( specialProjectName ) . first ( ) ;
170+ await projectItem . hover ( ) ;
171+ const starButton = this . gridProjectStarButton ( specialProjectName ) . first ( ) ;
172+ const starIcon = starButton . getByTestId ( 'icon-star' ) ;
173+ await expect ( starIcon ) . toBeVisible ( ) ;
179174 }
180175 starredProjectNameMenuBar ( projectName : string ) : Locator {
181176 return this . page . locator (
0 commit comments