From 5124e1706e5595ad2dd57231a833e71d2aea8ac0 Mon Sep 17 00:00:00 2001 From: zhangjingwei Date: Wed, 6 Aug 2025 01:46:03 +0000 Subject: [PATCH] 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 --- test/e2e/integration/pages/network/network.spec.js | 1 + test/e2e/integration/pages/network/port.spec.js | 10 ++-------- test/e2e/support/commands.js | 5 +++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/e2e/integration/pages/network/network.spec.js b/test/e2e/integration/pages/network/network.spec.js index 9f5f2e62..0c51cda9 100644 --- a/test/e2e/integration/pages/network/network.spec.js +++ b/test/e2e/integration/pages/network/network.spec.js @@ -69,6 +69,7 @@ describe('The Network Page', () => { cy.tableSearchText(name).checkTableFirstRow(name).goToDetail(); cy.clickDetailTab('Subnets'); cy.tableSearchText(subnetName2).clickConfirmActionButton('Delete'); + cy.wait(10000); cy.tableSearchText(subnetName2).checkEmptyTable(); }); diff --git a/test/e2e/integration/pages/network/port.spec.js b/test/e2e/integration/pages/network/port.spec.js index 8ebaad2a..0841e0d5 100644 --- a/test/e2e/integration/pages/network/port.spec.js +++ b/test/e2e/integration/pages/network/port.spec.js @@ -71,7 +71,7 @@ describe('The Port Page', () => { cy.goBackToList(listUrl); }); - it('successfully create allowed address pair', () => { + it('successfully create and delete allowed address pair', () => { cy.tableSearchText(name) .goToDetail() .clickDetailTab('Allowed Address Pairs') @@ -81,13 +81,7 @@ describe('The Port Page', () => { .formSelect('mac_address') .clickModalActionSubmitButton() .wait(10000); - }); - - it('successfully delete allowed address pair', () => { - cy.tableSearchText(name) - .goToDetail() - .clickDetailTab('Allowed Address Pairs') - .clickConfirmActionInFirst(); + cy.clickConfirmActionInFirst(); }); it('successfully associate floating IP', () => { diff --git a/test/e2e/support/commands.js b/test/e2e/support/commands.js index ae2c4c05..563ad1c0 100644 --- a/test/e2e/support/commands.js +++ b/test/e2e/support/commands.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { v4 as uuidv4 } from 'uuid'; import getTitle from './common'; Cypress.Commands.add('setLanguage', (value) => { @@ -69,10 +70,14 @@ Cypress.Commands.add( region: Cypress.env('region'), domain: Cypress.env('domain'), }; + const uuid = uuidv4(); cy.request({ url: '/api/openstack/skyline/api/v1/login', body, method: 'POST', + headers: { + 'X-Openstack-Request-Id': `req-${uuid}`, + }, }).then((res) => { const { body: resBody, headers } = res; const [sessionCookie, ...rest] = headers['set-cookie'];