diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts new file mode 100644 index 000000000..b72ca5df9 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts @@ -0,0 +1,37 @@ +import { PageHelper } from '../page-helper.po'; + +const pages = { + index: { url: '#/rgw/roles', id: 'cd-crud-table' }, + create: { url: '#/rgw/roles/create', id: 'cd-crud-form' } +}; + +export class RolesPageHelper extends PageHelper { + pages = pages; + + columnIndex = { + roleName: 2, + path: 3, + arn: 4 + }; + + @PageHelper.restrictTo(pages.create.url) + create(name: string, path: string, policyDocument: string) { + cy.get('#formly_3_string_role_name_0').type(name); + cy.get('#formly_3_textarea_role_assume_policy_doc_2').type(policyDocument); + cy.get('#formly_3_string_role_path_1').type(path); + cy.get("[aria-label='Create Role']").should('exist').click(); + cy.get('cd-crud-table').should('exist'); + } + + @PageHelper.restrictTo(pages.index.url) + checkExist(name: string, exist: boolean) { + this.getTableCell(this.columnIndex.roleName, name).should(($elements) => { + const roleName = $elements.map((_, el) => el.textContent).get(); + if (exist) { + expect(roleName).to.include(name); + } else { + expect(roleName).to.not.include(name); + } + }); + } +} |