-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2337 cant access connect with user role connect admin (#2566)
* test(#2337): e2e test to validate that a user can access only the connect view * fix(#2337): Change routing from to app-routing.module * fix(#2337): Fix checkstyle in PipelineElementTemplateResource
- Loading branch information
Showing
27 changed files
with
180 additions
and
119 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
62 changes: 62 additions & 0 deletions
62
ui/cypress/tests/userManagement/testUserRoleConnect.spec.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,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
import { UserBuilder } from '../../support/builder/UserBuilder'; | ||
import { UserRole } from '../../../src/app/_enums/user-role.enum'; | ||
import { UserUtils } from '../../support/utils/UserUtils'; | ||
import { ConnectUtils } from '../../support/utils/connect/ConnectUtils'; | ||
import { ConnectBtns } from '../../support/utils/connect/ConnectBtns'; | ||
|
||
describe('Test User Roles for Connect', () => { | ||
beforeEach('Setup Test', () => { | ||
cy.initStreamPipesTest(); | ||
ConnectUtils.addMachineDataSimulator('simulator'); | ||
}); | ||
|
||
it('Perform Test', () => { | ||
// Add connect admin user | ||
const connect_admin = UserBuilder.create('[email protected]') | ||
.setName('connect_admin') | ||
.setPassword('password') | ||
.addRole(UserRole.ROLE_CONNECT_ADMIN) | ||
.build(); | ||
UserUtils.addUser(connect_admin); | ||
|
||
// Login as user and check if connect is visible to user | ||
cy.switchUser(connect_admin); | ||
|
||
cy.dataCy('navigation-icon', { timeout: 10000 }).should( | ||
'have.length', | ||
3, | ||
); | ||
|
||
ConnectUtils.goToConnect(); | ||
cy.dataCy('all-adapters-table', { timeout: 10000 }).should( | ||
'have.length', | ||
1, | ||
); | ||
cy.dataCy('all-adapters-table', { timeout: 10000 }).should( | ||
'contain', | ||
'simulator', | ||
); | ||
|
||
// validate that adapter can be stopped and edited | ||
ConnectBtns.stopAdapter().click(); | ||
ConnectBtns.editAdapter().should('not.be.disabled'); | ||
ConnectBtns.editAdapter().click(); | ||
}); | ||
}); |
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
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
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
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.