test: Update instance e2e
1. Remove useless case: expand root volume 2. Update wait status text by fresh 3. Skip change password according to config 4. Todo: remove resize until support confirm/rollback resize Change-Id: I28d044816949a5f6773e85f857817f40a193aed6
This commit is contained in:
parent
520a48e954
commit
e5d85114a2
@ -10,6 +10,7 @@ env:
|
|||||||
imageName: cirros-0.5.2-x86_64-disk
|
imageName: cirros-0.5.2-x86_64-disk
|
||||||
imageType: Others
|
imageType: Others
|
||||||
imageDownloadUrl: http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
|
imageDownloadUrl: http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
|
||||||
|
imageCanChangePassword: false
|
||||||
testFiles:
|
testFiles:
|
||||||
- pages/login.spec.js
|
- pages/login.spec.js
|
||||||
- pages/error.spec.js
|
- pages/error.spec.js
|
||||||
@ -33,7 +34,7 @@ testFiles:
|
|||||||
- pages/network/vpn.spec.js
|
- pages/network/vpn.spec.js
|
||||||
- pages/network/lb.spec.js
|
- pages/network/lb.spec.js
|
||||||
- pages/network/topology.spec.js
|
- pages/network/topology.spec.js
|
||||||
- pages/compute/image.spec.js # need to put an image file in fixtures
|
- pages/compute/image.spec.js
|
||||||
- pages/compute/flavor.spec.js
|
- pages/compute/flavor.spec.js
|
||||||
- pages/compute/server-group.spec.js
|
- pages/compute/server-group.spec.js
|
||||||
- pages/compute/keypair.spec.js
|
- pages/compute/keypair.spec.js
|
||||||
|
@ -25,6 +25,7 @@ describe('The Instance Page', () => {
|
|||||||
const routerName = `e2e-router-for-instance-${uuid}`;
|
const routerName = `e2e-router-for-instance-${uuid}`;
|
||||||
const imageName = Cypress.env('imageName');
|
const imageName = Cypress.env('imageName');
|
||||||
const imageType = Cypress.env('imageType');
|
const imageType = Cypress.env('imageType');
|
||||||
|
const ableChangePwd = Cypress.env('imageCanChangePassword') || false;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login(listUrl);
|
cy.login(listUrl);
|
||||||
@ -103,9 +104,8 @@ describe('The Instance Page', () => {
|
|||||||
it('successfully stop', () => {
|
it('successfully stop', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickConfirmActionInMoreSub('Stop', 'Instance Status')
|
.clickConfirmActionInMoreSub('Stop', 'Instance Status')
|
||||||
.wait(10000)
|
|
||||||
.tableSearchText(name)
|
.tableSearchText(name)
|
||||||
.checkColumnValue(6, 'Shutoff')
|
.waitStatusTextByFresh('Shutoff')
|
||||||
.selectFirst()
|
.selectFirst()
|
||||||
.clickHeaderButtonByTitle('Stop')
|
.clickHeaderButtonByTitle('Stop')
|
||||||
.checkDisableAction(2000);
|
.checkDisableAction(2000);
|
||||||
@ -124,9 +124,8 @@ describe('The Instance Page', () => {
|
|||||||
it('successfully suspend', () => {
|
it('successfully suspend', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickConfirmActionInMoreSub('Suspend', 'Instance Status')
|
.clickConfirmActionInMoreSub('Suspend', 'Instance Status')
|
||||||
.wait(10000)
|
|
||||||
.tableSearchText(name)
|
.tableSearchText(name)
|
||||||
.checkColumnValue(6, 'Suspended');
|
.waitStatusTextByFresh('Suspended');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully resume', () => {
|
it('successfully resume', () => {
|
||||||
@ -138,9 +137,8 @@ describe('The Instance Page', () => {
|
|||||||
it('successfully pause', () => {
|
it('successfully pause', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickConfirmActionInMoreSub('Pause', 'Instance Status')
|
.clickConfirmActionInMoreSub('Pause', 'Instance Status')
|
||||||
.wait(10000)
|
|
||||||
.tableSearchText(name)
|
.tableSearchText(name)
|
||||||
.checkColumnValue(6, 'Paused');
|
.waitStatusTextByFresh('Paused');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully unpause', () => {
|
it('successfully unpause', () => {
|
||||||
@ -152,7 +150,7 @@ describe('The Instance Page', () => {
|
|||||||
it('successfully shelve', () => {
|
it('successfully shelve', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickConfirmActionInMoreSub('Shelve', 'Instance Status')
|
.clickConfirmActionInMoreSub('Shelve', 'Instance Status')
|
||||||
.wait(20000);
|
.waitStatusTextByFresh('Shelved');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully unshelve', () => {
|
it('successfully unshelve', () => {
|
||||||
@ -248,15 +246,10 @@ describe('The Instance Page', () => {
|
|||||||
.clickModalActionCancelButton();
|
.clickModalActionCancelButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully extend root volume', () => {
|
|
||||||
cy.tableSearchText(name)
|
|
||||||
.clickActionInMoreSub('Extend Root Volume', 'Configuration Update')
|
|
||||||
.wait(5000)
|
|
||||||
.clickModalActionSubmitButton()
|
|
||||||
.wait(30000);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('successfully change password', () => {
|
it('successfully change password', () => {
|
||||||
|
if (!ableChangePwd) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const passowrdNew = `${password}_1`;
|
const passowrdNew = `${password}_1`;
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickActionInMoreSub('Change Password', 'Configuration Update')
|
.clickActionInMoreSub('Change Password', 'Configuration Update')
|
||||||
@ -269,20 +262,22 @@ describe('The Instance Page', () => {
|
|||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
.clickActionInMoreSub('Rebuild Instance', 'Configuration Update')
|
.clickActionInMoreSub('Rebuild Instance', 'Configuration Update')
|
||||||
.wait(5000)
|
.wait(5000)
|
||||||
.formTableSelect('image')
|
.formRadioChooseByLabel('image', imageType)
|
||||||
|
.formTableSelectBySearch('image', imageName)
|
||||||
.clickModalActionSubmitButton()
|
.clickModalActionSubmitButton()
|
||||||
.waitStatusActiveByRefresh();
|
.waitStatusActiveByRefresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully resize', () => {
|
// todo: need a confirm resize button
|
||||||
cy.tableSearchText(name)
|
// it('successfully resize', () => {
|
||||||
.clickActionInMoreSub('Resize', 'Configuration Update')
|
// cy.tableSearchText(name)
|
||||||
.wait(5000)
|
// .clickActionInMoreSub('Resize', 'Configuration Update')
|
||||||
.formTableSelect('newFlavor')
|
// .wait(5000)
|
||||||
.formCheckboxClick('option')
|
// .formTableSelect('newFlavor')
|
||||||
.clickModalActionSubmitButton()
|
// .formCheckboxClick('option')
|
||||||
.waitStatusActiveByRefresh();
|
// .clickModalActionSubmitButton()
|
||||||
});
|
// .waitStatusActiveByRefresh();
|
||||||
|
// });
|
||||||
|
|
||||||
it('successfully edit', () => {
|
it('successfully edit', () => {
|
||||||
cy.tableSearchText(name)
|
cy.tableSearchText(name)
|
||||||
@ -293,7 +288,7 @@ describe('The Instance Page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('successfully delete', () => {
|
it('successfully delete', () => {
|
||||||
cy.deleteInstance(newname);
|
cy.forceDeleteInstance(newname);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('successfully delete related resources', () => {
|
it('successfully delete related resources', () => {
|
||||||
|
@ -118,8 +118,7 @@ Cypress.Commands.add('deleteRouter', (name, networkName) => {
|
|||||||
Cypress.Commands.add('deleteInstance', (name, deleteRecycleBin = true) => {
|
Cypress.Commands.add('deleteInstance', (name, deleteRecycleBin = true) => {
|
||||||
cy.visitPage(instanceListUrl)
|
cy.visitPage(instanceListUrl)
|
||||||
.tableSearchText(name)
|
.tableSearchText(name)
|
||||||
.clickConfirmActionInMore('Delete')
|
.clickConfirmActionInMore('Delete');
|
||||||
.checkEmptyTable();
|
|
||||||
|
|
||||||
if (deleteRecycleBin) {
|
if (deleteRecycleBin) {
|
||||||
cy.visitPage(recycleBinListUrl)
|
cy.visitPage(recycleBinListUrl)
|
||||||
|
@ -296,6 +296,37 @@ Cypress.Commands.add('checkColumnValue', (columnIndex, value) => {
|
|||||||
.should('exist');
|
.should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add(
|
||||||
|
'getStatusValueLength',
|
||||||
|
(value, hasLengthCallback, noLengthCallback) => {
|
||||||
|
const eles = Cypress.$('.ant-badge-status-text').filter(
|
||||||
|
`:contains(${value})`
|
||||||
|
);
|
||||||
|
if (eles.length > 0) {
|
||||||
|
hasLengthCallback();
|
||||||
|
} else {
|
||||||
|
noLengthCallback();
|
||||||
|
cy.getStatusValueLength(value, hasLengthCallback, noLengthCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Cypress.Commands.add('waitStatusTextByFresh', (text) => {
|
||||||
|
let index = 0;
|
||||||
|
const hasLengthCallback = () => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('contain', index);
|
||||||
|
};
|
||||||
|
const noLengthCallback = () => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('not contain', index);
|
||||||
|
cy.freshTable();
|
||||||
|
index += 1;
|
||||||
|
cy.wait(5000);
|
||||||
|
};
|
||||||
|
cy.getStatusValueLength(text, hasLengthCallback, noLengthCallback);
|
||||||
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('selectFirst', () => {
|
Cypress.Commands.add('selectFirst', () => {
|
||||||
cy.get('.ant-table-row')
|
cy.get('.ant-table-row')
|
||||||
.first()
|
.first()
|
||||||
|
Loading…
Reference in New Issue
Block a user