skyline/test/e2e/integration/pages/network/router.spec.js
Jingwei.Zhang ddde1b9e8e feat: Support create port forwarding with internal/external port range
1. Update create port forwarding: support internal/external port range,
provides error hints for more explicit port usage
2. Update the port forwarding display in the floating ip list page: add pages to show large amounts of data
3. Update the port forwarding display in the port forwarding tab in the floating ip detail page: add id/description, support external port range filter,
support sort by api
4. Change `DNAT`, 'port forwarding rule' to 'port forwarding'

Change-Id: I40f6ccfb56949430b7c5f0256cc952d7ea5305aa
2022-08-15 16:27:29 +08:00

107 lines
3.2 KiB
JavaScript

// 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 { routerListUrl } from '../../../support/constants';
describe('The Router Page', () => {
const listUrl = routerListUrl;
const uuid = Cypress._.random(0, 1e6);
const name = `e2e-router-${uuid}`;
const newname = `${name}-1`;
const networkName = `e2e-network-router-${uuid}`;
beforeEach(() => {
cy.login(listUrl);
});
it('successfully prepare resource', () => {
cy.createNetwork({ name: networkName });
});
it('successfully create', () => {
cy.clickHeaderButton(1, 5000)
.formInput('name', name)
.formText('description', name)
.formTableSelect('hints')
.formCheckboxClick('openExternalNetwork')
.wait(2000)
.formTableSelect('externalNetwork')
.clickModalActionSubmitButton();
});
it('successfully detail', () => {
cy.tableSearchText(name)
.checkTableFirstRow(name)
.goToDetail()
.checkDetailName(name);
cy.clickDetailTab('Ports', 'ports').clickDetailTab(
'Static Routes',
'staticRoutes'
);
// .clickDetailTab('Port Forwardings', 'port_forwarding');
cy.goBackToList(listUrl);
});
it('successfully disable delete', () => {
cy.checkActionDisabledInFirstRow('Delete', name);
});
it('successfully connect subnet and disable delete', () => {
cy.tableSearchText(name)
.clickActionInMore('Connect Subnet', 5000)
.formTableSelectBySearch('network', networkName)
.wait(5000)
.formTableSelect('subnet')
.clickModalActionSubmitButton();
cy.checkActionDisabledInFirstRow('Delete', name);
});
it('successfully port detail', () => {
cy.tableSearchText(name)
.checkTableFirstRow(name)
.goToDetail()
.checkDetailName(name);
cy.clickDetailTab('Ports').goToDetail(0);
});
it('successfully disconnect subnet and disable delete', () => {
cy.tableSearchText(name)
.clickActionInMore('Disconnect Subnet', 5000)
.formTableSelect('subnet')
.clickModalActionSubmitButton();
cy.checkActionDisabledInFirstRow('Delete', name);
});
it('successfully edit', () => {
cy.tableSearchText(name)
.clickFirstActionButton()
.formInput('name', newname)
.formText('description', newname)
.clickModalActionSubmitButton()
.wait(2000);
});
it('successfully close external gateway and delete', () => {
cy.tableSearchText(newname)
.clickConfirmActionInMore('Close External Gateway')
.clickConfirmActionInMore('Delete')
.tableSearchText(newname)
.checkEmptyTable();
});
it('successfully delete related resources', () => {
cy.deleteAll('network', networkName);
});
});