skyline/test/e2e/integration/pages/identity/project.spec.js
Jingwei.Zhang e47fa9e742 refactor: Refactor user
1. Refactor user store
2. Refactor user list
3. Refactor edit user system role
4. Update system-admin role check in rootStore
5. Refactor user detail page
6. Update forbidden user action to danger style
7. Refactor create user: add domain select && support multi role select for projects
8. Update project manager user e2e
9. Update create user e2e
10. Update user edit system role e2e
11. Remove create user in domain detail page

Closes-Bug: #1942285
Change-Id: Ieba70b002420e20ad7c3f04f5e4f6fb4b6fb1e76
2022-06-08 15:30:21 +08:00

99 lines
2.9 KiB
JavaScript

// Copyright 2021 99cloud
//
// Licensed 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 { projectListUrl } from '../../../support/constants';
describe('The Project Page', () => {
const listUrl = projectListUrl;
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-project-${uuid}`;
const newname = `${name}-1`;
const username = `e2e-user-for-project-${uuid}`;
const userGroupName = `e2e-ug-for-p-${Cypress._.random(0, 1e3)}`;
beforeEach(() => {
cy.loginAdmin(listUrl);
});
it('successfully prepare resource', () => {
cy.createUser({ name: username });
cy.createUserGroup({ name: userGroupName });
});
it('successfully create', () => {
cy.clickHeaderButton(1)
.formInput('name', name)
.clickModalActionSubmitButton()
.waitTableLoading();
});
it('successfully detail', () => {
cy.tableSearchText(name)
.goToDetail()
.checkDetailName(name)
.clickDetailTab('Project User Group', 'userGroup')
.clickDetailTab('Project Quota', 'quota');
cy.goBackToList(listUrl);
});
it('successfully edit quota', () => {
cy.tableSearchText(name)
.clickActionInMore('Edit Quota')
.formInput('instances', 11)
.formButtonClick('more')
.wait(2000)
.formButtonClick('more')
.clickModalActionSubmitButton();
});
it('successfully manage user', () => {
cy.tableSearchText(name)
.clickActionInMore('Manage User')
.wait(10000)
.formTransfer('select_user', username)
.clickModalActionSubmitButton();
});
it('successfully manage user group', () => {
cy.tableSearchText(name)
.clickActionInMore('Manage User Group')
.formTransfer('select_group', userGroupName)
.clickModalActionSubmitButton();
});
it('successfully forbidden project', () => {
cy.tableSearchText(name).clickConfirmActionInMore('Forbidden');
});
it('successfully enable project', () => {
cy.tableSearchText(name).clickConfirmActionInMore('Enable');
});
it('successfully edit', () => {
cy.tableSearchText(name)
.clickFirstActionButton()
.formInput('name', newname)
.clickModalActionSubmitButton();
});
it('successfully delete', () => {
cy.tableSearchText(newname).clickConfirmActionInMore('Delete');
});
it('successfully delete related resources', () => {
cy.deleteAll('user', username);
cy.deleteAll('userGroup', userGroupName);
});
});