test: Update e2e case

1. Add setting case
2. Update ironic case: repaire flavor by ironic create
3. Update flavor case: remove given name by custom flavor
4. Update virutal adapater case: assocate fip in detail page

Change-Id: If5c23b6c69bf4fd19506d3b68e69a4a8ae0ac056
This commit is contained in:
Jingwei.Zhang 2021-09-28 15:50:29 +08:00
parent fc75f6e7a3
commit 513d2cb526
10 changed files with 170 additions and 7 deletions

View File

@ -45,5 +45,6 @@ testFiles:
# - pages/management/recycle-bin.spec.js
- pages/configuration/metadata.spec.js
- pages/configuration/system.spec.js
- pages/configuration/setting.spec.js
- pages/heat/stack.spec.js

View File

@ -0,0 +1,66 @@
[
{
"architecture": "x86_architecture",
"categories": [
{
"name": "general_purpose",
"properties": []
},
{
"name": "compute_optimized",
"properties": []
},
{
"name": "memory_optimized",
"properties": []
},
{
"name": "high_clock_speed",
"properties": []
}
]
},
{
"architecture": "heterogeneous_computing",
"categories": [
{
"name": "compute_optimized_type_with_gpu",
"properties": []
},
{
"name": "visualization_compute_optimized_type_with_gpu",
"properties": []
}
]
},
{
"architecture": "bare_metal",
"categories": [
{
"name": "general_purpose",
"properties": []
}
]
},
{
"architecture": "arm_architecture",
"categories": [
{
"name": "general_purpose",
"properties": []
},
{
"name": "compute_optimized",
"properties": []
},
{
"name": "memory_optimized",
"properties": []
},
{
"name": "high_clock_speed",
"properties": []
}
]
}
]

View File

@ -17,7 +17,6 @@ import { flavorListUrl } from '../../../support/constants';
describe('The Flavor Page', () => {
const listUrl = flavorListUrl;
const name = `e2e-flavor-${Cypress._.random(0, 1e6)}`;
const customName = '1C.1G';
beforeEach(() => {
cy.loginAdmin(listUrl);
@ -51,7 +50,6 @@ describe('The Flavor Page', () => {
.checkDetailName(name)
.clickDetailTab('Instance', 'members');
cy.goBackToList(listUrl);
cy.clickTab('Custom').goToDetail().clickDetailTab('Instance', 'members');
});
it('successfully manage access', () => {
@ -64,7 +62,6 @@ describe('The Flavor Page', () => {
it('successfully manage metadata', () => {
cy.clickTab('Custom')
.tableSearchText(customName)
.clickActionButtonByTitle('Manage Metadata')
.wait(5000)
.formTransferLeftCheck('systems', 0)
@ -72,7 +69,6 @@ describe('The Flavor Page', () => {
// todo: remove key-value metadata
cy.clickTab('Custom')
.tableSearchText(customName)
.clickActionButtonByTitle('Manage Metadata')
.wait(5000)
.formTransferRightCheck('systems', 0)

View File

@ -20,6 +20,7 @@ describe('The Ironic Page', () => {
const name = `e2e-ironic-${uuid}`;
const newname = `${name}-1`;
const password = 'passW0rd_1';
const flavorName = `e2e-flavor-for-ironic-${uuid}`;
const networkName = `e2e-network-for-ironic-${uuid}`;
const routerName = `e2e-router-for-ironic-${uuid}`;
const imageName = Cypress.env('imageName');
@ -29,6 +30,10 @@ describe('The Ironic Page', () => {
cy.login(listUrl);
});
it('successfully prepair resource by admin', () => {
cy.loginAdmin().createIronicFlavor(flavorName);
});
it('successfully prepair resource', () => {
cy.createNetwork({ name: networkName });
cy.createRouter({ name: routerName, network: networkName });
@ -179,5 +184,6 @@ describe('The Ironic Page', () => {
cy.deleteAll('fip');
cy.deleteRouter(routerName, networkName);
cy.deleteAll('network', networkName);
cy.loginAdmin().deleteAll('flavor', flavorName, 'Bare Metal');
});
});

View File

@ -0,0 +1,54 @@
// 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 { settingUrl, flavorListUrl } from '../../../support/constants';
describe('The Setting Page', () => {
const listUrl = settingUrl;
const name = 'flavor_families';
const filename = 'flavor-family.json';
beforeEach(() => {
cy.loginAdmin(listUrl);
});
it('successfully view', () => {
cy.tableSimpleSearchText(name)
.clickFirstActionButton()
.clickConfirmButtonInModal();
});
it('successfully edit', () => {
cy.fixture(filename).then((data) => {
cy.tableSimpleSearchText(name)
.clickActionInMore('Edit')
.formJsonInput('value', data)
.wait(2000)
.clickModalActionSubmitButton();
cy.visitPage(flavorListUrl)
.clickTab('Custom', 'custom')
.clickTab('Heterogeneous Computing', 'heterogeneous_computing')
.clickTab('ARM Architecture', 'arm_architecture')
.clickTab('X86 Architecture', 'x86_architecture')
.clickTab('Bare Metal', 'bare_metal');
});
});
it('successfully reset', () => {
cy.tableSimpleSearchText(name).clickConfirmActionInMore(
'Reset To Initial Value'
);
});
});

View File

@ -86,7 +86,8 @@ describe('The Virtual Adapter Page', () => {
it('successfully associate floating IP', () => {
cy.tableSearchText(name)
.clickActionInMore('Associate Floating IP')
.goToDetail()
.clickDetailActionInMore('Associate Floating IP')
.wait(5000)
.formTableSelect('fixed_ip')
.wait(5000)

View File

@ -55,6 +55,7 @@ export const domainListUrl = '/identity/domain-admin';
// configuration
export const metadataListUrl = '/configuration-admin/metadata';
export const infoListUrl = '/configuration-admin/info';
export const settingUrl = '/configuration-admin/setting';
// stack
export const stackListUrl = '/heat/stack';
@ -63,6 +64,7 @@ export default {
// compute
instance: instanceListUrl,
image: imageListUrl,
flavor: flavorListUrl,
// storage
volume: volumeListUrl,

View File

@ -34,3 +34,15 @@ Cypress.Commands.add('clickDetailTab', (label, urlTab, waitTime = 2000) => {
}
cy.waitTableLoading();
});
Cypress.Commands.add('clickDetailActionInMore', (title, waitTime = 2000) => {
cy.get('.detail-main')
.first()
.find('.ant-dropdown-trigger')
.trigger('mouseover');
const realTitle = getTitle(title);
cy.get('ul.ant-dropdown-menu-light')
.contains(realTitle)
.click({ force: true })
.wait(waitTime);
});

View File

@ -137,11 +137,12 @@ Cypress.Commands.add('formText', (formItemName, value) => {
});
Cypress.Commands.add('formJsonInput', (formItemName, content) => {
const value = JSON.stringify(content).replace('{', '{{}');
const value = JSON.stringify(content);
cy.get(getId(formItemName))
.find('textarea')
.clear({ force: true })
.type(value, { force: true });
.wait(1000)
.type(value, { force: true, parseSpecialCharSequences: false });
});
Cypress.Commands.add('formInputName', (formItemName, typeName) => {

View File

@ -25,6 +25,8 @@ import urlMap, {
fipListUrl,
imageListUrl,
projectListUrl,
settingUrl,
flavorListUrl,
} from './constants';
Cypress.Commands.add('createInstance', ({ name, networkName }) => {
@ -229,6 +231,28 @@ Cypress.Commands.add('createProject', ({ name }) => {
.clickModalActionSubmitButton();
});
Cypress.Commands.add('createIronicFlavor', (name) => {
const filename = 'flavor-family.json';
const settingName = 'flavor_families';
cy.fixture(filename).then((data) => {
cy.visitPage(settingUrl)
.tableSimpleSearchText(settingName)
.clickActionInMore('Edit')
.formJsonInput('value', data)
.wait(2000)
.clickModalActionSubmitButton();
cy.visitPage(flavorListUrl)
.clickTab('Bare Metal', 'bare_metal')
.clickHeaderButton(1)
.formRadioChoose('category', 0)
.formInput('name', name)
.clickStepActionNextButton()
.wait(2000)
.clickStepActionNextButton();
});
});
Cypress.Commands.add('createIronicImage', ({ name }) => {
const filename = 'cirros-0.4.0-x86_64-disk.qcow2';
cy.visitPage(imageListUrl)