-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
169 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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 { StaticPropertyUtils } from '../userInput/StaticPropertyUtils'; | ||
|
||
export class PermissionUtils { | ||
public static openManagePermissions() { | ||
cy.dataCy('open-manage-permissions').click(); | ||
} | ||
|
||
public static markElementAsPublic() { | ||
PermissionUtils.openManagePermissions(); | ||
StaticPropertyUtils.clickCheckbox('permission-public-element'); | ||
cy.dataCy('sp-manage-permissions-save').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
43 changes: 43 additions & 0 deletions
43
ui/cypress/tests/connect/enhancedAdapterDeletion.smoke.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,43 @@ | ||
/* | ||
* 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 { ConnectUtils } from '../../support/utils/connect/ConnectUtils'; | ||
import { UserUtils } from '../../support/utils/UserUtils'; | ||
import { PipelineUtils } from '../../support/utils/pipeline/PipelineUtils'; | ||
|
||
describe('Test Enhanced Adapter Deletion', () => { | ||
beforeEach('Setup Test', () => { | ||
cy.initStreamPipesTest(); | ||
UserUtils.addUser(UserUtils.userWithAdapterAndPipelineAdminRights); | ||
}); | ||
|
||
it('Test Delete Adapter and Associated Pipelines', () => { | ||
PipelineUtils.addSampleAdapterAndPipeline(); | ||
|
||
ConnectUtils.deleteAdapterAndAssociatedPipelines(); | ||
}); | ||
|
||
it('Test Admin Should Be Able to Delete Adapter and Not Owned Associated Pipelines', () => { | ||
// Let the user create the adapter and the pipeline | ||
PipelineUtils.addSampleAdapterAndPipeline(); | ||
|
||
// Then let the admin delete them | ||
UserUtils.switchUser(UserUtils.adminUser); | ||
ConnectUtils.deleteAdapterAndAssociatedPipelines(true); | ||
}); | ||
}); |
43 changes: 0 additions & 43 deletions
43
ui/cypress/tests/connect/multiUser/adapterMultiUserSupport.ts
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
ui/cypress/tests/connect/multiUser/deleteAdapterWithMultipleUsers.smoke.spec.ts
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -15,40 +15,70 @@ | |
* 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'; | ||
import { GeneralUtils } from '../../support/utils/GeneralUtils'; | ||
import { PermissionUtils } from '../../support/utils/user/PermissionUtils'; | ||
|
||
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); | ||
// it('Connect admin should not see adapters of other users', () => { | ||
// const connectAdminUser = UserUtils.createUser( | ||
// 'user', | ||
// UserRole.ROLE_CONNECT_ADMIN, | ||
// ); | ||
// | ||
// ConnectUtils.addMachineDataSimulator('simulator'); | ||
// | ||
// UserUtils.switchUser(connectAdminUser); | ||
// | ||
// GeneralUtils.validateAmountOfNavigationIcons(3); | ||
// | ||
// // Validate that no adapter is visible | ||
// ConnectUtils.checkAmountOfAdapters(0); | ||
// }); | ||
|
||
// it('Connect admin should see public adapters of other users', () => { | ||
// const connectAdminUser = UserUtils.createUser( | ||
// 'user', | ||
// UserRole.ROLE_CONNECT_ADMIN, | ||
// ); | ||
// | ||
// ConnectUtils.addMachineDataSimulator('simulator'); | ||
// | ||
// // Set adapter to public | ||
// PermissionUtils.markElementAsPublic(); | ||
// | ||
// UserUtils.switchUser(connectAdminUser); | ||
// | ||
// GeneralUtils.validateAmountOfNavigationIcons(3); | ||
// | ||
// // Validate that adapter is visible | ||
// ConnectUtils.checkAmountOfAdapters(1); | ||
// }); | ||
|
||
// Login as user and check if connect is visible to user | ||
UserUtils.switchUser(connect_admin); | ||
it('Connect admin should see shared adapters of other users', () => { | ||
const connectAdminUser = UserUtils.createUser( | ||
'user', | ||
UserRole.ROLE_CONNECT_ADMIN, | ||
); | ||
|
||
GeneralUtils.validateAmountOfNavigationIcons(3); | ||
ConnectUtils.addMachineDataSimulator('simulator'); | ||
|
||
ConnectUtils.goToConnect(); | ||
// Set adapter to public | ||
PermissionUtils.openManagePermissions(); | ||
cy.dataCy('authorized-user').type(`${connectAdminUser.email}{tab}`); | ||
|
||
ConnectUtils.checkAmountOfAdapters(1); | ||
// cy.dataCy('sp-manage-permissions-save').click(); | ||
|
||
// validate that adapter can be stopped and edited | ||
ConnectBtns.stopAdapter().click(); | ||
ConnectBtns.editAdapter().should('not.be.disabled'); | ||
ConnectBtns.editAdapter().click(); | ||
// UserUtils.switchUser(connectAdminUser); | ||
// | ||
// GeneralUtils.validateAmountOfNavigationIcons(3); | ||
// | ||
// // Validate that adapter is visible | ||
// ConnectUtils.checkAmountOfAdapters(1); | ||
}); | ||
}); |
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.