Skip to content

Commit 25c41bb

Browse files
Stabilize SAML integration test cases for security dashboard CIs (opensearch-project#1641) (opensearch-project#1654)
Stabilize SAML integration test cases for security dashboard CIs (opensearch-project#1641) --------- Signed-off-by: Ryan Liang <jiallian@amazon.com> (cherry picked from commit 31c5a723cb54d8dcb6ab06de4a7a65b1036590e9) Co-authored-by: Ryan Liang <109499885+RyanL1997@users.noreply.github.com>
1 parent 22a7a42 commit 25c41bb

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

test/jest_integration/saml_auth.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ describe('start OpenSearch Dashboards server', () => {
4747
plugins: {
4848
scanDirs: [resolve(__dirname, '../..')],
4949
},
50+
home: { disableWelcomeScreen: true },
5051
server: {
5152
host: 'localhost',
5253
port: 5601,
@@ -266,7 +267,7 @@ describe('start OpenSearch Dashboards server', () => {
266267
});
267268

268269
it('Login to Dashboard with Hash', async () => {
269-
const urlWithHash = `http://localhost:5601/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(filters:!(),refreshInterval:(pause:!f,value:900000),time:(from:now-24h,to:now))&_a=(description:'Analyze%20mock%20flight%20data%20for%20OpenSearch-Air,%20Logstash%20Airways,%20OpenSearch%20Dashboards%20Airlines%20and%20BeatsWest',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!t,title:'%5BFlights%5D%20Global%20Flight%20Dashboard',viewMode:view)`;
270+
const urlWithHash = `http://localhost:5601/app/security-dashboards-plugin#/getstarted`;
270271
const driver = getDriver(browser, options).build();
271272
await driver.manage().deleteAllCookies();
272273
await driver.get(urlWithHash);

test/jest_integration/saml_multiauth.test.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ describe('start OpenSearch Dashboards server', () => {
4343
plugins: {
4444
scanDirs: [resolve(__dirname, '../..')],
4545
},
46+
home: { disableWelcomeScreen: true },
4647
server: {
4748
host: 'localhost',
4849
port: 5601,
@@ -235,8 +236,8 @@ describe('start OpenSearch Dashboards server', () => {
235236
});
236237

237238
it('Login to Dashboards and resume from nextUrl', async () => {
238-
const urlWithHash = `http://localhost:5601/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(filters:!(),refreshInterval:(pause:!f,value:900000),time:(from:now-24h,to:now))&_a=(description:'Analyze%20mock%20flight%20data%20for%20OpenSearch-Air,%20Logstash%20Airways,%20OpenSearch%20Dashboards%20Airlines%20and%20BeatsWest',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!t,title:'%5BFlights%5D%20Global%20Flight%20Dashboard',viewMode:view)`;
239-
const loginUrlWithNextUrl = `http://localhost:5601/app/login?nextUrl=%2Fapp%2Fdashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(filters:!(),refreshInterval:(pause:!f,value:900000),time:(from:now-24h,to:now))&_a=(description:'Analyze%20mock%20flight%20data%20for%20OpenSearch-Air,%20Logstash%20Airways,%20OpenSearch%20Dashboards%20Airlines%20and%20BeatsWest',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!t,title:'%5BFlights%5D%20Global%20Flight%20Dashboard',viewMode:view)`;
239+
const urlWithHash = `http://localhost:5601/app/security-dashboards-plugin#/getstarted`;
240+
const loginUrlWithNextUrl = `http://localhost:5601/app/login?nextUrl=%2Fapp%2Fsecurity-dashboards-plugin#/getstarted`;
240241
const driver = getDriver(browser, options).build();
241242
await driver.manage().deleteAllCookies();
242243
await driver.get(loginUrlWithNextUrl);
@@ -259,7 +260,7 @@ describe('start OpenSearch Dashboards server', () => {
259260
});
260261

261262
it('Login to Dashboards without nextUrl', async () => {
262-
const urlWithoutHash = `http://localhost:5601/app/home`;
263+
const urlWithoutHash = `http://localhost:5601/app/home#/`;
263264
const loginUrl = `http://localhost:5601/app/login`;
264265
const driver = getDriver(browser, options).build();
265266
await driver.manage().deleteAllCookies();
@@ -273,6 +274,15 @@ describe('start OpenSearch Dashboards server', () => {
273274
until.elementsLocated(By.xpath('/html/body/div[1]/div/header/div/div[2]')),
274275
20000
275276
);
277+
await driver.wait(until.elementsLocated(By.css('img[data-test-subj="defaultLogo"]')), 20000);
278+
await driver.wait(
279+
until.elementsLocated(By.css('section[aria-labelledby="homDataAdd__title"]')),
280+
20000
281+
);
282+
await driver.wait(
283+
until.elementsLocated(By.css('section[aria-labelledby="homDataManage__title"]')),
284+
20000
285+
);
276286
const windowHash = await driver.getCurrentUrl();
277287
console.log('windowHash: ' + windowHash);
278288
expect(windowHash).toEqual(urlWithoutHash);

0 commit comments

Comments
 (0)