test: Update e2e test according to service enabled

1. Add extenstions in config.yaml to support skip e2e case when service is disabled
2. Support compute, storage, network, other(identity, heat, configuration) config files to runthe corresponding cases

Change-Id: I310f4481d083319221045708cf5b311d51802b8c
This commit is contained in:
Jingwei.Zhang 2021-09-30 12:34:48 +08:00
parent 7f273e41c1
commit 69bae6f166
18 changed files with 1323 additions and 1062 deletions

View File

@ -97,6 +97,7 @@
"@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.13.13",
"@cypress/code-coverage": "^3.9.5",
"@cypress/skip-test": "^2.6.1",
"autoprefixer": "^9.3.1",
"babel-eslint": "^9.0.0",
"babel-jest": "^26.6.3",

View File

@ -0,0 +1,27 @@
# For the use case configuration under the compute menu
covarage: true
baseUrl: http://localhost:8081
env:
switchToAdminProject: false
username: e2e
password: passW0rdY_
usernameAdmin: e2e-admin
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
imageCanChangePassword: false
extensions:
- ironic
testFiles:
# compute
- pages/compute/image.spec.js
- pages/compute/flavor.spec.js
- pages/compute/server-group.spec.js
- pages/compute/keypair.spec.js
- pages/compute/instance.spec.js
- pages/compute/ironic.spec.js
- pages/compute/aggregate.spec.js
- pages/compute/hypervisor.spec.js
- pages/compute/baremetal.spec.js

View File

@ -0,0 +1,30 @@
# For the use case configuration under the network menu
covarage: true
baseUrl: http://localhost:8081
env:
switchToAdminProject: false
username: e2e
password: passW0rdY_
usernameAdmin: e2e-admin
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
imageCanChangePassword: false
extensions:
- neutron::qos
- neutron::vpn
- neutron::port-forwarding
- octavia
testFiles:
# network
- pages/network/router.spec.js
- pages/network/network.spec.js
- pages/network/virtual-adapter.spec.js
- pages/network/qos-policy.spec.js
- pages/network/floatingip.spec.js
- pages/network/security-group.spec.js
- pages/network/vpn.spec.js
- pages/network/lb.spec.js
- pages/network/topology.spec.js

View File

@ -0,0 +1,31 @@
# For the use case configuration under the identity, configuration, heat menu
covarage: true
baseUrl: http://localhost:8081
env:
switchToAdminProject: false
username: e2e
password: passW0rdY_
usernameAdmin: e2e-admin
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
imageCanChangePassword: false
extensions:
- heat
testFiles:
- pages/login.spec.js
- pages/error.spec.js
# identity
- pages/identity/role.spec.js
- pages/identity/domain.spec.js
- pages/identity/user.spec.js
- pages/identity/project.spec.js
- pages/identity/user-group.spec.js
# configuration
- pages/configuration/metadata.spec.js
- pages/configuration/system.spec.js
- pages/configuration/setting.spec.js
# heat
- pages/heat/stack.spec.js

View File

@ -0,0 +1,24 @@
# For the use case configuration under the storage menu
covarage: true
baseUrl: http://localhost:8081
env:
switchToAdminProject: false
username: e2e
password: passW0rdY_
usernameAdmin: e2e-admin
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
imageCanChangePassword: false
extensions:
- cinder::buckup
testFiles:
# storage
- pages/storage/qos.spec.js
- pages/storage/volume-type.spec.js
- pages/storage/volume.spec.js
- pages/storage/backup.spec.js
- pages/storage/snapshot.spec.js
- pages/storage/storage.spec.js

View File

@ -11,20 +11,31 @@ env:
imageType: Others
imageDownloadUrl: http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
imageCanChangePassword: false
extensions:
- cinder::buckup
- neutron::qos
- neutron::vpn
- neutron::port-forwarding
- octavia
- heat
- ironic
testFiles:
- pages/login.spec.js
- pages/error.spec.js
# identity
- pages/identity/role.spec.js
- pages/identity/domain.spec.js
- pages/identity/user.spec.js
- pages/identity/project.spec.js
- pages/identity/user-group.spec.js
# storage
- pages/storage/qos.spec.js
- pages/storage/volume-type.spec.js
- pages/storage/volume.spec.js
- pages/storage/backup.spec.js
- pages/storage/snapshot.spec.js
- pages/storage/storage.spec.js
# network
- pages/network/router.spec.js
- pages/network/network.spec.js
- pages/network/virtual-adapter.spec.js
@ -34,6 +45,7 @@ testFiles:
- pages/network/vpn.spec.js
- pages/network/lb.spec.js
- pages/network/topology.spec.js
# compute
- pages/compute/image.spec.js
- pages/compute/flavor.spec.js
- pages/compute/server-group.spec.js
@ -44,8 +56,9 @@ testFiles:
- pages/compute/hypervisor.spec.js
- pages/compute/baremetal.spec.js
# - pages/management/recycle-bin.spec.js
# configuration
- pages/configuration/metadata.spec.js
- pages/configuration/system.spec.js
- pages/configuration/setting.spec.js
# heat
- pages/heat/stack.spec.js

View File

@ -12,9 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { bareMetalListUrl } from '../../../support/constants';
const ironicServiceEnabled = (Cypress.env('extensions') || []).includes(
'ironic'
);
onlyOn(!ironicServiceEnabled, () => {
describe('Skip The Bare Metal Page', () => {
it('successfully skip', () => {});
});
});
describe('The Bare Metal Page', () => {
onlyOn(ironicServiceEnabled, () => {
const listUrl = bareMetalListUrl;
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-node-${uuid}`;
@ -32,10 +44,10 @@ describe('The Bare Metal Page', () => {
10,
99
)}:${Cypress._.random(10, 99)}`;
const macPort2 = `AD:78:BE:AF:${Cypress._.random(10, 99)}:${Cypress._.random(
const macPort2 = `AD:78:BE:AF:${Cypress._.random(
10,
99
)}`;
)}:${Cypress._.random(10, 99)}`;
const macPortGroup2 = `B1:F1:2D:A8:${Cypress._.random(
10,
99
@ -94,7 +106,9 @@ describe('The Bare Metal Page', () => {
});
it('successfully auto inspect', () => {
cy.tableSimpleSearchText(nodeName).clickConfirmActionInMore('Auto Inspect');
cy.tableSimpleSearchText(nodeName).clickConfirmActionInMore(
'Auto Inspect'
);
});
it('successfully enter maintenace mode', () => {
@ -198,3 +212,4 @@ describe('The Bare Metal Page', () => {
.clickModalActionSubmitButton();
});
});
});

View File

@ -12,8 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { instanceListUrl } from '../../../support/constants';
const ironicServiceEnabled = (Cypress.env('extensions') || []).includes(
'ironic'
);
onlyOn(!ironicServiceEnabled, () => {
describe('Skip The Ironic Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(ironicServiceEnabled, () => {
describe('The Ironic Page', () => {
const listUrl = instanceListUrl;
const uuid = Cypress._.random(0, 1e6);
@ -187,3 +199,4 @@ describe('The Ironic Page', () => {
cy.loginAdmin().deleteAll('flavor', flavorName, 'Bare Metal');
});
});
});

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { infoListUrl } from '../../../support/constants';
describe('The System Info Page', () => {
@ -26,6 +27,8 @@ describe('The System Info Page', () => {
const routerName = `e2e-router-for-neutronAgent-${uuid}`;
const networkName = `e2e-network-for-neutronAgent-${uuid}`;
const heatServiceEnabled = (Cypress.env('extensions') || []).includes('heat');
beforeEach(() => {
cy.loginAdmin(listUrl);
});
@ -150,9 +153,11 @@ describe('The System Info Page', () => {
.clickModalActionSubmitButton();
});
onlyOn(heatServiceEnabled, () => {
it('successfully orchestration services', () => {
cy.clickTab(orchestrationServicesTab, 'heatService');
});
});
it('successfully delete related resources', () => {
cy.login();

View File

@ -12,8 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { stackListUrl } from '../../../support/constants';
const heatServiceEnabled = (Cypress.env('extensions') || []).includes('heat');
onlyOn(!heatServiceEnabled, () => {
describe('Skip The Stack Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(heatServiceEnabled, () => {
describe('The Stack Page', () => {
const listUrl = stackListUrl;
const uuid = Cypress._.random(0, 1e6);
@ -120,3 +130,4 @@ describe('The Stack Page', () => {
cy.deleteAll('volume', volumeNameAbandon);
});
});
});

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { fipListUrl, instanceListUrl } from '../../../support/constants';
describe('The Floating IP Page', () => {
@ -21,14 +22,19 @@ describe('The Floating IP Page', () => {
const networkName = `e2e-network-for-fip-${uuid}`;
const instanceName = `e2e-instance-for-fip-${uuid}`;
const routerName = `e2e-router-for-fip-${uuid}`;
const qosServiceEnabled = (Cypress.env('extensions') || []).includes(
'neutron::qos'
);
beforeEach(() => {
cy.login(listUrl);
});
onlyOn(qosServiceEnabled, () => {
it('successfully prepair resource by admin', () => {
cy.loginAdmin().wait(5000).createNetworkPolicy({ name: policyName });
});
});
it('successfully prepair resource', () => {
cy.createNetwork({ name: networkName });
@ -84,7 +90,17 @@ describe('The Floating IP Page', () => {
.clickConfirmActionInMore('Disassociate');
});
it('successfully edit', () => {
onlyOn(!qosServiceEnabled, () => {
it('successfully edit with qos', () => {
cy.clickFirstActionButton()
.formText('description', 'description')
.clickModalActionSubmitButton()
.wait(2000);
});
});
onlyOn(qosServiceEnabled, () => {
it('successfully edit with qos', () => {
cy.clickFirstActionButton()
.formText('description', 'description')
.formTabClick('qos_policy_id', 1)
@ -93,6 +109,7 @@ describe('The Floating IP Page', () => {
.clickModalActionSubmitButton()
.wait(2000);
});
});
it('successfully delete', () => {
cy.tableSearchSelect('Status', 'Down')
@ -105,6 +122,8 @@ describe('The Floating IP Page', () => {
cy.deleteRouter(routerName, networkName);
cy.deleteAll('network', networkName);
cy.loginAdmin().wait(5000);
onlyOn(qosServiceEnabled, () => {
cy.deleteAll('networkQosPolicy', policyName);
});
});
});

View File

@ -12,8 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { lbListUrl } from '../../../support/constants';
const lbServiceEnabled = (Cypress.env('extensions') || []).includes('octavia');
onlyOn(!lbServiceEnabled, () => {
describe('Skip The LB Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(lbServiceEnabled, () => {
describe('The LB Page', () => {
const listUrl = lbListUrl;
const uuid = Cypress._.random(0, 1e6);
@ -229,3 +239,4 @@ describe('The LB Page', () => {
cy.deleteAll('fip');
});
});
});

View File

@ -12,8 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { policyListUrl } from '../../../support/constants';
const qosServiceEnabled = (Cypress.env('extensions') || []).includes(
'neutron::qos'
);
onlyOn(!qosServiceEnabled, () => {
describe('Skip The Network Qos Policy Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(qosServiceEnabled, () => {
describe('The Network Qos Policy Page', () => {
const listUrl = policyListUrl;
const name = `e2e-policy-${Cypress._.random(0, 1e6)}`;
@ -117,3 +129,4 @@ describe('The Network Qos Policy Page', () => {
cy.tableSearchText(newname).checkEmptyTable();
});
});
});

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { virtualAdapterListUrl } from '../../../support/constants';
describe('The Virtual Adapter Page', () => {
@ -24,14 +25,19 @@ describe('The Virtual Adapter Page', () => {
const networkName = `e2e-network-for-virtual-adapter-${uuid}`;
const instanceName = `e2e-instance-for-virtual-adapter-${uuid}`;
const routerName = `e2e-router-for-virtual-adapter-${uuid}`;
const qosServiceEnabled = (Cypress.env('extensions') || []).includes(
'neutron::qos'
);
beforeEach(() => {
cy.login(listUrl);
});
onlyOn(qosServiceEnabled, () => {
it('successfully prepair resource by admin', () => {
cy.loginAdmin().wait(5000).createNetworkPolicy({ name: policyName });
});
});
it('successfully prepair resource', () => {
cy.createFip();
@ -115,6 +121,7 @@ describe('The Virtual Adapter Page', () => {
cy.tableSearchText(name).clickConfirmActionInMore('Detach');
});
onlyOn(qosServiceEnabled, () => {
it('successfully modify qos', () => {
cy.tableSearchText(name)
.clickActionInMore('Modify QoS')
@ -125,6 +132,7 @@ describe('The Virtual Adapter Page', () => {
.formTableSelectBySearch('qos_policy_id', policyName)
.clickModalActionSubmitButton();
});
});
it('successfully manage security group', () => {
cy.tableSearchText(name)
@ -180,6 +188,8 @@ describe('The Virtual Adapter Page', () => {
cy.deleteAll('network', networkName);
cy.deleteAll('fip');
cy.loginAdmin().wait(5000);
onlyOn(qosServiceEnabled, () => {
cy.deleteAll('networkQosPolicy', policyName);
});
});
});

View File

@ -12,8 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { vpnListUrl } from '../../../support/constants';
const vpnServiceEnabled = (Cypress.env('extensions') || []).includes(
'neutron::vpn'
);
onlyOn(!vpnServiceEnabled, () => {
describe('The VPN Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(vpnServiceEnabled, () => {
describe('The VPN Page', () => {
const listUrl = vpnListUrl;
const uuid = Cypress._.random(0, 1e6);
@ -186,3 +198,4 @@ describe('The VPN Page', () => {
cy.deleteAll('network', networkName);
});
});
});

View File

@ -12,8 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { backupListUrl, volumeListUrl } from '../../../support/constants';
const backupServiceEnabled = (Cypress.env('extensions') || []).includes(
'cinder::buckup'
);
onlyOn(!backupServiceEnabled, () => {
describe('Skip The Volume Backup Page', () => {
it('successfully skip', () => {});
});
});
onlyOn(backupServiceEnabled, () => {
describe('The Volume Backup Page', () => {
const listUrl = backupListUrl;
const uuid = Cypress._.random(0, 1e6);
@ -38,8 +50,7 @@ describe('The Volume Backup Page', () => {
.clickModalActionSubmitButton()
.wait(5000)
.waitTableLoading();
cy.wait(30000);
cy.tableSearchText(name).waitStatusTextByFresh('Available');
});
it('successfully create increment bakcup', () => {
@ -50,6 +61,7 @@ describe('The Volume Backup Page', () => {
.clickModalActionSubmitButton()
.wait(5000)
.waitTableLoading();
cy.tableSearchText(nameInc).waitStatusTextByFresh('Available');
});
it('successfully detail', () => {
@ -100,3 +112,4 @@ describe('The Volume Backup Page', () => {
cy.deleteAll('volume', volumeNameByBackup);
});
});
});

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { onlyOn } from '@cypress/skip-test';
import { volumeListUrl, volumeTypeListUrl } from '../../../support/constants';
describe('The Volume Page', () => {
@ -32,6 +33,10 @@ describe('The Volume Page', () => {
const networkName = `e2e-network-for-volume-${uuid}`;
const instanceName = `e2e-instance-for-volume-${uuid}`;
const backupServiceEnabled = (Cypress.env('extensions') || []).includes(
'cinder::buckup'
);
beforeEach(() => {
cy.login(listUrl);
});
@ -96,6 +101,7 @@ describe('The Volume Page', () => {
cy.deleteAll('volumeSnapshot', snapshotName);
});
onlyOn(backupServiceEnabled, () => {
it('successfully create backup', () => {
cy.tableSearchText(name)
.clickActionInMore('Create Backup')
@ -116,6 +122,7 @@ describe('The Volume Page', () => {
cy.deleteAll('backup', backupIncName);
cy.wait(5000).deleteAll('backup', backupName);
});
});
it('successfully clone volume', () => {
cy.tableSearchText(name)

View File

@ -1550,6 +1550,11 @@
tunnel-agent "^0.6.0"
uuid "^3.3.2"
"@cypress/skip-test@^2.6.1":
version "2.6.1"
resolved "https://registry.yarnpkg.com/@cypress/skip-test/-/skip-test-2.6.1.tgz#44a4bc4c2b2e369a7661177c9b38e50d417a36ea"
integrity sha512-X+ibefBiuOmC5gKG91wRIT0/OqXeETYvu7zXktjZ3yLeO186Y8ia0K7/gQUpAwuUi28DuqMd1+7tBQVtPkzbPA==
"@cypress/xvfb@^1.2.4":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a"