fix: Add X-Openstack-Request-Id for e2e request

1. Add X-Openstack-Request-Id for the e2e login request which is a necessary header for requesting the skyline api
2. Update e2e case

Change-Id: I443f928efeb9157bbfe952740c48d721f71e66b2
Signed-off-by: Jingwei Zhang <zhang.jingwei@99cloud.net>
This commit is contained in:
zhangjingwei
2025-08-06 01:46:03 +00:00
parent 4a7d5f0315
commit 5124e1706e
3 changed files with 8 additions and 8 deletions

View File

@@ -69,6 +69,7 @@ describe('The Network Page', () => {
cy.tableSearchText(name).checkTableFirstRow(name).goToDetail(); cy.tableSearchText(name).checkTableFirstRow(name).goToDetail();
cy.clickDetailTab('Subnets'); cy.clickDetailTab('Subnets');
cy.tableSearchText(subnetName2).clickConfirmActionButton('Delete'); cy.tableSearchText(subnetName2).clickConfirmActionButton('Delete');
cy.wait(10000);
cy.tableSearchText(subnetName2).checkEmptyTable(); cy.tableSearchText(subnetName2).checkEmptyTable();
}); });

View File

@@ -71,7 +71,7 @@ describe('The Port Page', () => {
cy.goBackToList(listUrl); cy.goBackToList(listUrl);
}); });
it('successfully create allowed address pair', () => { it('successfully create and delete allowed address pair', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.goToDetail() .goToDetail()
.clickDetailTab('Allowed Address Pairs') .clickDetailTab('Allowed Address Pairs')
@@ -81,13 +81,7 @@ describe('The Port Page', () => {
.formSelect('mac_address') .formSelect('mac_address')
.clickModalActionSubmitButton() .clickModalActionSubmitButton()
.wait(10000); .wait(10000);
}); cy.clickConfirmActionInFirst();
it('successfully delete allowed address pair', () => {
cy.tableSearchText(name)
.goToDetail()
.clickDetailTab('Allowed Address Pairs')
.clickConfirmActionInFirst();
}); });
it('successfully associate floating IP', () => { it('successfully associate floating IP', () => {

View File

@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { v4 as uuidv4 } from 'uuid';
import getTitle from './common'; import getTitle from './common';
Cypress.Commands.add('setLanguage', (value) => { Cypress.Commands.add('setLanguage', (value) => {
@@ -69,10 +70,14 @@ Cypress.Commands.add(
region: Cypress.env('region'), region: Cypress.env('region'),
domain: Cypress.env('domain'), domain: Cypress.env('domain'),
}; };
const uuid = uuidv4();
cy.request({ cy.request({
url: '/api/openstack/skyline/api/v1/login', url: '/api/openstack/skyline/api/v1/login',
body, body,
method: 'POST', method: 'POST',
headers: {
'X-Openstack-Request-Id': `req-${uuid}`,
},
}).then((res) => { }).then((res) => {
const { body: resBody, headers } = res; const { body: resBody, headers } = res;
const [sessionCookie, ...rest] = headers['set-cookie']; const [sessionCookie, ...rest] = headers['set-cookie'];