fix: Update e2e

1. Update password value to fit value check
2. Remove cases in backup e2e: remove backup by volume which is used by instance
3. Update waittime for fip list page to ensure create form can be opened
4. Update image select when create instance
5. Add volume case:create backup and backup inc
6. Update force delete instance command

Change-Id: I45e4bba0b670171860d85e4e5cb402962a41becd
This commit is contained in:
Jingwei.Zhang 2021-09-28 10:22:55 +08:00
parent d3fb5a334b
commit c549b50538
15 changed files with 81 additions and 81 deletions

View File

@ -5,7 +5,7 @@
"video": false,
"env": {
"username": "administrator",
"password": "passw0rd",
"password": "passW0rd",
"region": "RegionOne",
"domain": "Default",
"sessionKey": "X-Auth-Token",

View File

@ -17,7 +17,7 @@ Generally, when testing the corresponding functions of a resource, follow the fo
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-instance-${uuid}`;
const newname = `${name}-1`;
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const volumeName = `e2e-instance-attach-volume-${uuid}`;
const networkName = `e2e-network-for-instance-${uuid}`;
const routerName = `e2e-router-for-instance-${uuid}`;

View File

@ -17,7 +17,7 @@
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-instance-${uuid}`;
const newname = `${name}-1`;
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const volumeName = `e2e-instance-attach-volume-${uuid}`;
const networkName = `e2e-network-for-instance-${uuid}`;
const routerName = `e2e-router-for-instance-${uuid}`;

View File

@ -3,10 +3,13 @@ baseUrl: http://localhost:8081
env:
switchToAdminProject: false
username: e2e
password: passw0rdY_
password: passW0rdY_
usernameAdmin: e2e-admin
passwordAdmin: passw0rdY_
passwordAdmin: passW0rdY_
userIsRegisted: true
imageName: cirros-0.5.2-x86_64-disk
imageType: Others
imageDownloadUrl: http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
testFiles:
- pages/login.spec.js
- pages/error.spec.js

View File

@ -21,7 +21,7 @@ describe('The Bare Metal Page', () => {
const ip = `10.10.${Cypress._.random(50, 100)}.${Cypress._.random(5, 250)}`;
const newname = `${name}-1`;
const username = 'admin';
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const nodeName = 'node-0';
const portGroupName = `e2e-node-port-group-${uuid}`;
const macPort = `AD:78:BE:AF:${Cypress._.random(10, 99)}:${Cypress._.random(

View File

@ -19,10 +19,12 @@ describe('The Instance Page', () => {
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-instance-${uuid}`;
const newname = `${name}-1`;
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const volumeName = `e2e-instance-attach-volume-${uuid}`;
const networkName = `e2e-network-for-instance-${uuid}`;
const routerName = `e2e-router-for-instance-${uuid}`;
const imageName = Cypress.env('imageName');
const imageType = Cypress.env('imageType');
beforeEach(() => {
cy.login(listUrl);
@ -41,7 +43,8 @@ describe('The Instance Page', () => {
.should('include', `${listUrl}/create`)
.wait(5000)
.formTableSelect('flavor')
.formTableSelect('image')
.formRadioChooseByLabel('image', imageType)
.formTableSelectBySearch('image', imageName)
.formSelect('systemDisk')
.formAddSelectAdd('dataDisk')
.formSelect('dataDisk')

View File

@ -19,10 +19,11 @@ describe('The Ironic Page', () => {
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-ironic-${uuid}`;
const newname = `${name}-1`;
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const networkName = `e2e-network-for-ironic-${uuid}`;
const routerName = `e2e-router-for-ironic-${uuid}`;
const imageName = `e2e-image-for-ironic-${uuid}`;
const imageName = Cypress.env('imageName');
const imageType = Cypress.env('imageType');
beforeEach(() => {
cy.login(listUrl);
@ -32,13 +33,13 @@ describe('The Ironic Page', () => {
cy.createNetwork({ name: networkName });
cy.createRouter({ name: routerName, network: networkName });
cy.createFip();
cy.createIronicImage({ name: imageName });
});
it('successfully create', () => {
cy.clickHeaderButton(2)
.wait(5000)
.formTableSelect('flavor')
.formRadioChooseByLabel('image', imageType)
.formTableSelectBySearch('image', imageName)
.clickStepActionNextButton()
.wait(5000)
@ -178,6 +179,5 @@ describe('The Ironic Page', () => {
cy.deleteAll('fip');
cy.deleteRouter(routerName, networkName);
cy.deleteAll('network', networkName);
cy.deleteAll('image', imageName);
});
});

View File

@ -17,9 +17,11 @@ import { serverGroupListUrl } from '../../../support/constants';
describe('The Server Group Page', () => {
const listUrl = serverGroupListUrl;
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-server-group-${Cypress._.random(0, 1e6)}`;
const name = `e2e-server-group-${uuid}`;
const instanceName = `e2e-instance-by-server-group-${uuid}`;
const networkName = `e2e-network-for-server-group-${uuid}`;
const imageName = Cypress.env('imageName');
const imageType = Cypress.env('imageType');
beforeEach(() => {
cy.login(listUrl);
@ -45,12 +47,13 @@ describe('The Server Group Page', () => {
});
it('successfully create instance', () => {
const password = 'passw0rd_1';
const password = 'passW0rd_1';
cy.tableSearchText(name)
.goToDetail()
.clickHeaderButton(1)
.formTableSelect('flavor')
.formTableSelect('image')
.formRadioChooseByLabel('image', imageType)
.formTableSelectBySearch('image', imageName)
.formSelect('systemDisk')
.clickStepActionNextButton()
.wait(5000)
@ -75,9 +78,9 @@ describe('The Server Group Page', () => {
});
it('successfully delete', () => {
cy.clickFirstActionDisabled();
cy.tableSearchText(name).clickFirstActionDisabled();
cy.forceDeleteInstance(instanceName);
cy.wait(5000);
cy.wait(10000);
cy.visitPage(listUrl)
.tableSearchText(name)
.clickConfirmActionInFirst()

View File

@ -21,7 +21,7 @@ describe('The User Page', () => {
const newname = `${name}-1`;
const email = `${name}@example.com`;
const phone = '18500000000';
const password = 'passw0rd_';
const password = 'passW0rd_';
const tmpPassword = `${password}1`;
const projectName = `e2e-project-for-user-${uuid}`;
const projectName2 = `e2e-project2-for-user-${uuid}`;

View File

@ -37,6 +37,7 @@ describe('The Floating IP Page', () => {
});
it('successfully create', () => {
cy.wait(2000);
cy.intercept('GET', '/networks').as('networks');
cy.clickHeaderButton(1)
.wait('@networks')
@ -45,6 +46,7 @@ describe('The Floating IP Page', () => {
});
it('successfully batch create', () => {
cy.wait(2000);
cy.intercept('GET', '/networks').as('networks');
cy.clickHeaderButton(1)
.wait('@networks')

View File

@ -99,8 +99,8 @@ describe('The VPN Page', () => {
.wait(2000)
.formInput('peer_address', '192.168.1.1')
.formSelect('peer_ep_group_id', endpointPeer)
.formInput('password', 'passw0rd')
.formInput('confirmPassword', 'passw0rd')
.formInput('password', 'passW0rd')
.formInput('confirmPassword', 'passW0rd')
.formButtonClick('more')
.clickModalActionSubmitButton();
});

View File

@ -19,11 +19,7 @@ describe('The Volume Backup Page', () => {
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-backup-${uuid}`;
const nameInc = `${name}-inc`;
const nameIns = `e2e-backup-ins-${uuid}`;
const nameInsInc = `${nameIns}-inc`;
const volumeName = `e2e-volume-for-backup-${uuid}`;
const networkName = `e2e-network-for-backup-${uuid}`;
const instanceName = `e2e-instance-for-backup-${uuid}`;
const volumeNameByBackup = `e2e-volume-by-backup-${uuid}`;
const newname = `${name}-1`;
@ -33,8 +29,6 @@ describe('The Volume Backup Page', () => {
it('successfully prepair resource', () => {
cy.createVolume(volumeName);
cy.createNetwork({ name: networkName });
cy.createInstance({ name: instanceName, networkName });
});
it('successfully create full bakcup', () => {
@ -45,11 +39,6 @@ describe('The Volume Backup Page', () => {
.wait(5000)
.waitTableLoading();
cy.clickHeaderButton(1, 5000)
.formInput('name', nameIns)
.formTableSelectBySearchOption('volume', 'Status', 'In-use')
.clickModalActionSubmitButton();
cy.wait(30000);
});
@ -61,12 +50,6 @@ describe('The Volume Backup Page', () => {
.clickModalActionSubmitButton()
.wait(5000)
.waitTableLoading();
cy.clickHeaderButton(1, 5000)
.formInput('name', nameInsInc)
.formRadioChoose('incremental', 1)
.formTableSelectBySearchOption('volume', 'Status', 'In-use')
.clickModalActionSubmitButton();
});
it('successfully detail', () => {
@ -110,15 +93,9 @@ describe('The Volume Backup Page', () => {
cy.tableSearchText(newname)
.clickConfirmActionInMore('Delete')
.tableSearchText(newname);
cy.tableSearchText(nameIns)
.clickConfirmActionInMore('Delete')
.tableSearchText(nameIns);
});
it('successfully delete related resources', () => {
cy.forceDeleteInstance(instanceName);
cy.deleteAll('network', networkName);
cy.deleteAll('volume', volumeName);
cy.deleteAll('volume', volumeNameByBackup);
});

View File

@ -23,11 +23,9 @@ describe('The Volume Page', () => {
0,
1e6
)}`;
// eslint-disable-next-line no-unused-vars
const imageName = `e2e-image-by-volume-${uuid}`;
const snapshotName = `e2e-snapshot-by-volume-${uuid}`;
const backupName = `e2e-backup-by-volume-${uuid}`;
// eslint-disable-next-line no-unused-vars
const backupIncName = `e2e-backup-inc-by-volume-${uuid}`;
const cloneVolumeName = `e2e-clone-volume-${uuid}`;
@ -57,6 +55,7 @@ describe('The Volume Page', () => {
.url()
.should('include', creatUrl)
.wait(5000)
.formInput('size', 1)
.formInput('name', name)
.clickFormActionSubmitButton()
.wait(2000)
@ -80,13 +79,6 @@ describe('The Volume Page', () => {
cy.goBackToList(listUrl);
});
it('successfully extend volume', () => {
cy.tableSearchText(name)
.clickActionInMore('Extend Volume')
.clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh();
});
it('successfully create snapshot', () => {
cy.tableSearchText(name).clickFirstActionButton();
cy.wait(2000)
@ -113,16 +105,17 @@ describe('The Volume Page', () => {
.waitStatusActiveByRefresh();
});
// it("successfully create backup inc", () => {
// cy.tableSearchText(name)
// .clickActionInMore("Create Backup")
// .formInput("name", backupIncName)
// .formRadioChoose("incremental", 1)
// .clickModalActionSubmitButton()
// .tableSearchText(name)
// .waitStatusActive();
// cy.deleteAll("backup");
// });
it('successfully create backup inc', () => {
cy.tableSearchText(name)
.clickActionInMore('Create Backup')
.formInput('name', backupIncName)
.formRadioChoose('incremental', 1)
.clickModalActionSubmitButton()
.tableSearchText(name)
.waitStatusActive();
cy.deleteAll('backup', backupIncName);
cy.wait(5000).deleteAll('backup', backupName);
});
it('successfully clone volume', () => {
cy.tableSearchText(name)
@ -147,21 +140,23 @@ describe('The Volume Page', () => {
.wait(5000)
.formTableSelect('instance')
.clickModalActionSubmitButton();
cy.tableSearchText(name).checkColumnValue(3, 'Available');
cy.tableSearchText(name).waitStatusActiveByRefresh();
});
// it('successfully create image', () => {
// cy.tableSearchText(name)
// .clickActionInMore('Create Image')
// .formInput('image_name', imageName)
// .clickModalActionSubmitButton()
// .waitStatusActiveByRefresh();
it('successfully create image', () => {
cy.tableSearchText(name)
.clickActionInMore('Create Image')
.formInput('image_name', imageName)
.clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh();
});
// cy.clearTableSearch()
// .tableSearchSelect('Status', 'In-use')
// .checkActionDisabled('Create Image');
// });
it('successfully extend volume', () => {
cy.tableSearchText(name)
.clickActionInMore('Extend Volume')
.clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh();
});
it('successfully change type', () => {
cy.tableSearchText(name)
@ -183,11 +178,11 @@ describe('The Volume Page', () => {
});
it('successfully delete related resources', () => {
cy.deleteAll('image', imageName);
cy.deleteAll('volume', cloneVolumeName);
cy.forceDeleteInstance(instanceName);
cy.deleteAll('network', networkName);
cy.loginAdmin().wait(5000);
cy.deleteAll('volumeType', volumeTypeName);
// cy.deleteAll('image', imageName);
});
});

View File

@ -255,6 +255,15 @@ Cypress.Commands.add('formRadioChoose', (formItemName, itemIndex = 0) => {
.click();
});
Cypress.Commands.add('formRadioChooseByLabel', (formItemName, label) => {
const realName = getTitle(label);
cy.get(getId(formItemName))
.find('.ant-radio-button-wrapper')
.contains(realName)
.first()
.click();
});
Cypress.Commands.add('formAttachFile', (formItemName, filename) => {
cy.get(getId(formItemName)).find('input').attachFile(filename).wait(2000);
});

View File

@ -28,12 +28,15 @@ import urlMap, {
} from './constants';
Cypress.Commands.add('createInstance', ({ name, networkName }) => {
const password = 'passw0rd_1';
const password = 'passW0rd_1';
const imageName = Cypress.env('imageName');
const imageType = Cypress.env('imageType');
cy.visitPage(instanceListUrl)
.clickHeaderButton(1)
.wait(5000)
.wait(8000)
.formTableSelect('flavor')
.formTableSelect('image')
.formRadioChooseByLabel('image', imageType)
.formTableSelectBySearch('image', imageName)
.formSelect('systemDisk')
.clickStepActionNextButton()
.wait(5000)
@ -127,7 +130,11 @@ Cypress.Commands.add('deleteInstance', (name, deleteRecycleBin = true) => {
Cypress.Commands.add('forceDeleteInstance', (name) => {
cy.visitPage(instanceListUrl)
.tableSearchText(name)
.clickConfirmActionInMore('Delete');
.clickActionInMore('Delete');
cy.get('.ant-modal-confirm-content')
.find('.ant-checkbox-input')
.click()
.clickConfirmActionSubmitButton();
});
Cypress.Commands.add('deleteAllAvailableVolume', () => {
@ -140,7 +147,7 @@ Cypress.Commands.add('deleteAllAvailableVolume', () => {
Cypress.Commands.add(
'createInstanceByResource',
({ name, networkName, resource }) => {
const password = 'passw0rd_1';
const password = 'passW0rd_1';
cy.formTableSelect('flavor')
.formTableSelect(resource)
.formSelect('systemDisk')
@ -183,6 +190,7 @@ Cypress.Commands.add('createSecurityGrouop', ({ name }) => {
Cypress.Commands.add('createFip', () => {
cy.intercept('GET', '/networks').as('networks');
cy.visitPage(fipListUrl)
.wait(2000)
.clickHeaderButton(1)
.wait('@networks')
.formSelect('floating_network_id')
@ -199,7 +207,7 @@ Cypress.Commands.add('createUserGroup', ({ name }) => {
Cypress.Commands.add('createUser', ({ name }) => {
const email = `${name}@example.com`;
const phone = '18500000000';
const password = 'passw0rd_';
const password = 'passW0rd_';
cy.visitPage(userListUrl)
.clickHeaderButton(1)
.wait(2000)