-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mr settings): permissions table
Signed-off-by: gitdallas <[email protected]> auto lint fixes Signed-off-by: gitdallas <[email protected]> fix lints Signed-off-by: gitdallas <[email protected]> some cleanup Signed-off-by: gitdallas <[email protected]> tests for mr permissions Signed-off-by: gitdallas <[email protected]>
- Loading branch information
Showing
27 changed files
with
1,062 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
frontend/src/__tests__/cypress/cypress/pages/modelRegistryPermissions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Contextual } from './components/Contextual'; | ||
import { TableRow } from './components/table'; | ||
|
||
class PermissionsTableRow extends TableRow {} | ||
|
||
class UsersTab { | ||
visit(mrName: string, wait = true) { | ||
cy.visitWithLogin(`/modelRegistrySettings/permissions/${mrName}`); | ||
if (wait) { | ||
this.wait(); | ||
} | ||
} | ||
|
||
private wait() { | ||
cy.findByTestId('app-page-title'); | ||
cy.testA11y(); | ||
} | ||
|
||
findAddUserButton() { | ||
return cy.findByTestId('add-button User'); | ||
} | ||
|
||
findAddGroupButton() { | ||
return cy.findByTestId('add-button Group'); | ||
} | ||
|
||
getUserTable() { | ||
return new PermissionTable(() => cy.findByTestId('role-binding-table User')); | ||
} | ||
|
||
getGroupTable() { | ||
return new PermissionTable(() => cy.findByTestId('role-binding-table Group')); | ||
} | ||
} | ||
|
||
class PermissionTable extends Contextual<HTMLElement> { | ||
findRows() { | ||
return this.find().find(`[data-label=Username]`); | ||
} | ||
|
||
findAddInput() { | ||
return this.find().findByTestId('role-binding-name-input'); | ||
} | ||
|
||
findEditInput(id: string) { | ||
return this.find().findByTestId(['role-binding-name-input', id]); | ||
} | ||
|
||
findGroupSelect() { | ||
return this.find().get(`[aria-label="Name selection"]`); | ||
} | ||
|
||
getTableRow(name: string) { | ||
return new PermissionsTableRow(() => | ||
this.find().find(`[data-label=Username]`).contains(name).parents('tr'), | ||
); | ||
} | ||
|
||
findTableHeaderButton(name: string) { | ||
return this.find().find('thead').findByRole('button', { name }); | ||
} | ||
|
||
findSaveNewButton() { | ||
return this.find().findByTestId(['save-new-button']); | ||
} | ||
|
||
findEditSaveButton(id: string) { | ||
return this.find().findByTestId(['save-button', id]); | ||
} | ||
} | ||
|
||
export const usersTab = new UsersTab(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.