Merge "test: Update e2e case"
This commit is contained in:
commit
5a98ca8692
@ -45,5 +45,6 @@ testFiles:
|
|||||||
# - pages/management/recycle-bin.spec.js
|
# - pages/management/recycle-bin.spec.js
|
||||||
- pages/configuration/metadata.spec.js
|
- pages/configuration/metadata.spec.js
|
||||||
- pages/configuration/system.spec.js
|
- pages/configuration/system.spec.js
|
||||||
|
- pages/configuration/setting.spec.js
|
||||||
- pages/heat/stack.spec.js
|
- pages/heat/stack.spec.js
|
||||||
|
|
||||||
|
66
test/e2e/fixtures/flavor-family.json
Normal file
66
test/e2e/fixtures/flavor-family.json
Normal 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": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
@ -17,7 +17,6 @@ import { flavorListUrl } from '../../../support/constants';
|
|||||||
describe('The Flavor Page', () => {
|
describe('The Flavor Page', () => {
|
||||||
const listUrl = flavorListUrl;
|
const listUrl = flavorListUrl;
|
||||||
const name = `e2e-flavor-${Cypress._.random(0, 1e6)}`;
|
const name = `e2e-flavor-${Cypress._.random(0, 1e6)}`;
|
||||||
const customName = '1C.1G';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.loginAdmin(listUrl);
|
cy.loginAdmin(listUrl);
|
||||||
@ -51,7 +50,6 @@ describe('The Flavor Page', () => {
|
|||||||
.checkDetailName(name)
|
.checkDetailName(name)
|
||||||
.clickDetailTab('Instance', 'members');
|
.clickDetailTab('Instance', 'members');
|
||||||
cy.goBackToList(listUrl);
|
cy.goBackToList(listUrl);
|
||||||
cy.clickTab('Custom').goToDetail().clickDetailTab('Instance', 'members');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully manage access', () => {
|
it('successfully manage access', () => {
|
||||||
@ -64,7 +62,6 @@ describe('The Flavor Page', () => {
|
|||||||
|
|
||||||
it('successfully manage metadata', () => {
|
it('successfully manage metadata', () => {
|
||||||
cy.clickTab('Custom')
|
cy.clickTab('Custom')
|
||||||
.tableSearchText(customName)
|
|
||||||
.clickActionButtonByTitle('Manage Metadata')
|
.clickActionButtonByTitle('Manage Metadata')
|
||||||
.wait(5000)
|
.wait(5000)
|
||||||
.formTransferLeftCheck('systems', 0)
|
.formTransferLeftCheck('systems', 0)
|
||||||
@ -72,7 +69,6 @@ describe('The Flavor Page', () => {
|
|||||||
|
|
||||||
// todo: remove key-value metadata
|
// todo: remove key-value metadata
|
||||||
cy.clickTab('Custom')
|
cy.clickTab('Custom')
|
||||||
.tableSearchText(customName)
|
|
||||||
.clickActionButtonByTitle('Manage Metadata')
|
.clickActionButtonByTitle('Manage Metadata')
|
||||||
.wait(5000)
|
.wait(5000)
|
||||||
.formTransferRightCheck('systems', 0)
|
.formTransferRightCheck('systems', 0)
|
||||||
|
@ -20,6 +20,7 @@ describe('The Ironic Page', () => {
|
|||||||
const name = `e2e-ironic-${uuid}`;
|
const name = `e2e-ironic-${uuid}`;
|
||||||
const newname = `${name}-1`;
|
const newname = `${name}-1`;
|
||||||
const password = 'passW0rd_1';
|
const password = 'passW0rd_1';
|
||||||
|
const flavorName = `e2e-flavor-for-ironic-${uuid}`;
|
||||||
const networkName = `e2e-network-for-ironic-${uuid}`;
|
const networkName = `e2e-network-for-ironic-${uuid}`;
|
||||||
const routerName = `e2e-router-for-ironic-${uuid}`;
|
const routerName = `e2e-router-for-ironic-${uuid}`;
|
||||||
const imageName = Cypress.env('imageName');
|
const imageName = Cypress.env('imageName');
|
||||||
@ -29,6 +30,10 @@ describe('The Ironic Page', () => {
|
|||||||
cy.login(listUrl);
|
cy.login(listUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('successfully prepair resource by admin', () => {
|
||||||
|
cy.loginAdmin().createIronicFlavor(flavorName);
|
||||||
|
});
|
||||||
|
|
||||||
it('successfully prepair resource', () => {
|
it('successfully prepair resource', () => {
|
||||||
cy.createNetwork({ name: networkName });
|
cy.createNetwork({ name: networkName });
|
||||||
cy.createRouter({ name: routerName, network: networkName });
|
cy.createRouter({ name: routerName, network: networkName });
|
||||||
@ -179,5 +184,6 @@ describe('The Ironic Page', () => {
|
|||||||
cy.deleteAll('fip');
|
cy.deleteAll('fip');
|
||||||
cy.deleteRouter(routerName, networkName);
|
cy.deleteRouter(routerName, networkName);
|
||||||
cy.deleteAll('network', networkName);
|
cy.deleteAll('network', networkName);
|
||||||
|
cy.loginAdmin().deleteAll('flavor', flavorName, 'Bare Metal');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
54
test/e2e/integration/pages/configuration/setting.spec.js
Normal file
54
test/e2e/integration/pages/configuration/setting.spec.js
Normal 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'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
@ -86,7 +86,8 @@ describe('The Virtual Adapter Page', () => {
|
|||||||
|
|
||||||
it('successfully associate floating IP', () => {
|
it('successfully associate floating IP', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickActionInMore('Associate Floating IP')
|
.goToDetail()
|
||||||
|
.clickDetailActionInMore('Associate Floating IP')
|
||||||
.wait(5000)
|
.wait(5000)
|
||||||
.formTableSelect('fixed_ip')
|
.formTableSelect('fixed_ip')
|
||||||
.wait(5000)
|
.wait(5000)
|
||||||
|
@ -55,6 +55,7 @@ export const domainListUrl = '/identity/domain-admin';
|
|||||||
// configuration
|
// configuration
|
||||||
export const metadataListUrl = '/configuration-admin/metadata';
|
export const metadataListUrl = '/configuration-admin/metadata';
|
||||||
export const infoListUrl = '/configuration-admin/info';
|
export const infoListUrl = '/configuration-admin/info';
|
||||||
|
export const settingUrl = '/configuration-admin/setting';
|
||||||
|
|
||||||
// stack
|
// stack
|
||||||
export const stackListUrl = '/heat/stack';
|
export const stackListUrl = '/heat/stack';
|
||||||
@ -63,6 +64,7 @@ export default {
|
|||||||
// compute
|
// compute
|
||||||
instance: instanceListUrl,
|
instance: instanceListUrl,
|
||||||
image: imageListUrl,
|
image: imageListUrl,
|
||||||
|
flavor: flavorListUrl,
|
||||||
|
|
||||||
// storage
|
// storage
|
||||||
volume: volumeListUrl,
|
volume: volumeListUrl,
|
||||||
|
@ -34,3 +34,15 @@ Cypress.Commands.add('clickDetailTab', (label, urlTab, waitTime = 2000) => {
|
|||||||
}
|
}
|
||||||
cy.waitTableLoading();
|
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);
|
||||||
|
});
|
||||||
|
@ -137,11 +137,12 @@ Cypress.Commands.add('formText', (formItemName, value) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('formJsonInput', (formItemName, content) => {
|
Cypress.Commands.add('formJsonInput', (formItemName, content) => {
|
||||||
const value = JSON.stringify(content).replace('{', '{{}');
|
const value = JSON.stringify(content);
|
||||||
cy.get(getId(formItemName))
|
cy.get(getId(formItemName))
|
||||||
.find('textarea')
|
.find('textarea')
|
||||||
.clear({ force: true })
|
.clear({ force: true })
|
||||||
.type(value, { force: true });
|
.wait(1000)
|
||||||
|
.type(value, { force: true, parseSpecialCharSequences: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('formInputName', (formItemName, typeName) => {
|
Cypress.Commands.add('formInputName', (formItemName, typeName) => {
|
||||||
|
@ -25,6 +25,8 @@ import urlMap, {
|
|||||||
fipListUrl,
|
fipListUrl,
|
||||||
imageListUrl,
|
imageListUrl,
|
||||||
projectListUrl,
|
projectListUrl,
|
||||||
|
settingUrl,
|
||||||
|
flavorListUrl,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
Cypress.Commands.add('createInstance', ({ name, networkName }) => {
|
Cypress.Commands.add('createInstance', ({ name, networkName }) => {
|
||||||
@ -229,6 +231,28 @@ Cypress.Commands.add('createProject', ({ name }) => {
|
|||||||
.clickModalActionSubmitButton();
|
.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 }) => {
|
Cypress.Commands.add('createIronicImage', ({ name }) => {
|
||||||
const filename = 'cirros-0.4.0-x86_64-disk.qcow2';
|
const filename = 'cirros-0.4.0-x86_64-disk.qcow2';
|
||||||
cy.visitPage(imageListUrl)
|
cy.visitPage(imageListUrl)
|
||||||
|
Loading…
Reference in New Issue
Block a user