diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/HealthCheck.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/HealthCheck.spec.ts deleted file mode 100644 index f14ef934020..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/HealthCheck.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 Collate. - * 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 { interceptURL, verifyResponseStatusCode } from '../../common/common'; -import { GlobalSettingOptions } from '../../constants/settings.constant'; - -describe('Health Check for Openmetadata', () => { - before(() => { - cy.login(); - }); - - it('All 5 checks should be successful', () => { - interceptURL('GET', '/api/v1/system/status', 'getOMStatus'); - - cy.settingClick(GlobalSettingOptions.OM_HEALTH); - - verifyResponseStatusCode('@getOMStatus', 200); - - cy.get('[data-testid="database"] .success-status').should( - 'have.text', - 'Success' - ); - cy.get('[data-testid="searchInstance"] .success-status').should( - 'have.text', - 'Success' - ); - cy.get('[data-testid="pipelineServiceClient"] .success-status').should( - 'have.text', - 'Success' - ); - cy.get('[data-testid="jwks"] .success-status').should( - 'have.text', - 'Success' - ); - cy.get('[data-testid="migrations"] .success-status').should( - 'have.text', - 'Success' - ); - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/HealthCheck.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/HealthCheck.spec.ts new file mode 100644 index 00000000000..06df9b8c141 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/HealthCheck.spec.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Collate. + * 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 { expect, test } from '@playwright/test'; +import { GlobalSettingOptions } from '../../constant/settings'; +import { redirectToHomePage } from '../../utils/common'; +import { settingClick } from '../../utils/sidebar'; + +// use the admin user to login +test.use({ storageState: 'playwright/.auth/admin.json' }); + +test.describe('Health Check for OpenMetadata', () => { + test.beforeEach(async ({ page }) => { + await redirectToHomePage(page); + }); + + test('All 5 checks should be successful', async ({ page }) => { + const healthResponse = page.waitForResponse('/api/v1/system/status'); + await settingClick(page, GlobalSettingOptions.OM_HEALTH); + + await healthResponse; + + await expect( + page.locator('[data-testid="database"] .success-status') + ).toHaveText('Success'); + await expect( + page.locator('[data-testid="searchInstance"] .success-status') + ).toHaveText('Success'); + await expect( + page.locator('[data-testid="pipelineServiceClient"] .success-status') + ).toHaveText('Success'); + await expect( + page.locator('[data-testid="jwks"] .success-status') + ).toHaveText('Success'); + await expect( + page.locator('[data-testid="migrations"] .success-status') + ).toHaveText('Success'); + }); +});