-
Notifications
You must be signed in to change notification settings - Fork 78
frontend: e2e tests (#6) #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
frontend: e2e tests (#6) #1633
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a531813
frontend: e2e tests
ivakoleva 7cd6579
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2a941fa
Merge branch 'main' into person/ikoleva/frontend-data-pipelines-6
ivakoleva c8f246d
frontend: e2e tests
ivakoleva edd96d6
frontend: e2e tests
ivakoleva 7363ad3
frontend: e2e tests
ivakoleva 4787847
Merge branch 'main' into person/ikoleva/frontend-data-pipelines-6
ivakoleva 00dd425
Merge branch 'main' into person/ikoleva/frontend-data-pipelines-6
ivakoleva ecc2293
Merge branch 'main' into person/ikoleva/frontend-data-pipelines-6
ivakoleva 6a85679
Merge branch 'main' into person/ikoleva/frontend-data-pipelines-6
ivakoleva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
projects/frontend/data-pipelines/gui/e2e/fixtures/e2e-cy-dp-failing.job.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "job_name": "e2e-cp-$env-placeholder$-failing-job", | ||
| "description": "Testing failing job, that is used in data-pipelines CI/CD for UI e2e tests. It is intended to be always available in order to speed up deployment and if deleted will be automatically re-created by the e2e tests.", | ||
| "config": { | ||
| "db_default_type": "IMPALA", | ||
| "contacts": { | ||
| "notified_on_job_failure_user_error": [], | ||
| "notified_on_job_failure_platform_error": [], | ||
| "notified_on_job_success": [], | ||
| "notified_on_job_deploy": [] | ||
| }, | ||
| "schedule": { | ||
| "schedule_cron": "0 */12 * * *" | ||
| }, | ||
| "generate_keytab": true, | ||
| "enable_execution_notifications": true | ||
| }, | ||
| "team": "taurus" | ||
| } |
Binary file added
BIN
+6.24 KB
projects/frontend/data-pipelines/gui/e2e/fixtures/e2e-cy-dp-failing.job.zip
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
projects/frontend/data-pipelines/gui/e2e/fixtures/lib/explore/additional-test-job.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "config": { | ||
| "contacts": { | ||
| "notified_on_job_deploy": [ | ||
| "auserov3@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_platform_error": [ | ||
| "buserov3@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_user_error": [ | ||
| "cuserov3@vmware.com" | ||
| ], | ||
| "notified_on_job_success": [ | ||
| "duserov3@vmware.com" | ||
| ] | ||
| }, | ||
| "db_default_type": "IMPALA", | ||
| "generate_keytab": false, | ||
| "schedule": { | ||
| "schedule_cron": "0 0 03 * 5" | ||
| } | ||
| }, | ||
| "description": "Test description 3 with a long text on the line", | ||
| "job_name": "e2e-cp-$env-placeholder$-a-test-job-3", | ||
| "status": "disabled", | ||
| "team": "e2e-cp-$env-placeholder$-a-test-team-3" | ||
| } | ||
56 changes: 56 additions & 0 deletions
56
projects/frontend/data-pipelines/gui/e2e/fixtures/lib/explore/test-jobs.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [ | ||
| { | ||
| "config": { | ||
| "contacts": { | ||
| "notified_on_job_deploy": [ | ||
| "auserov1@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_platform_error": [ | ||
| "buserov1@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_user_error": [ | ||
| "cuserov1@vmware.com" | ||
| ], | ||
| "notified_on_job_success": [ | ||
| "duserov1@vmware.com" | ||
| ] | ||
| }, | ||
| "db_default_type": "IMPALA", | ||
| "generate_keytab": false, | ||
| "schedule": { | ||
| "schedule_cron": "0 0 01 * 5" | ||
| } | ||
| }, | ||
| "description": "Test description 1 with a long text on the line", | ||
| "job_name": "e2e-cp-$env-placeholder$-a-test-job-1", | ||
| "status": "disabled", | ||
| "team": "e2e-cp-$env-placeholder$-a-test-team-1" | ||
| }, | ||
| { | ||
| "config": { | ||
| "contacts": { | ||
| "notified_on_job_deploy": [ | ||
| "auserov2@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_platform_error": [ | ||
| "buserov2@vmware.com" | ||
| ], | ||
| "notified_on_job_failure_user_error": [ | ||
| "cuserov2@vmware.com" | ||
| ], | ||
| "notified_on_job_success": [ | ||
| "duserov2@vmware.com" | ||
| ] | ||
| }, | ||
| "db_default_type": "IMPALA", | ||
| "generate_keytab": false, | ||
| "schedule": { | ||
| "schedule_cron": "0 0 02 * 5" | ||
| } | ||
| }, | ||
| "description": "Test description 2 with a long text on the line", | ||
| "job_name": "e2e-cp-$env-placeholder$-a-test-job-2", | ||
| "status": "disabled", | ||
| "team": "e2e-cp-$env-placeholder$-a-test-team-2" | ||
| } | ||
| ] |
19 changes: 19 additions & 0 deletions
19
projects/frontend/data-pipelines/gui/e2e/fixtures/lib/manage/e2e-cypress-dp-test.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "job_name": "e2e-cp-$env-placeholder$-test-job", | ||
| "description": "Testing job, that is used in data-pipelines CI/CD for UI e2e tests. It is intended to be always available in order to speed up deployment and if deleted will be automatically re-created by the e2e tests." , | ||
| "config": { | ||
| "db_default_type": "IMPALA" , | ||
| "contacts": { | ||
| "notified_on_job_failure_user_error": [] , | ||
| "notified_on_job_failure_platform_error": [] , | ||
| "notified_on_job_success": [] , | ||
| "notified_on_job_deploy": [] | ||
| } , | ||
| "schedule": { | ||
| "schedule_cron": "11 23 5 8 1" | ||
|
ivakoleva marked this conversation as resolved.
|
||
| } , | ||
| "generate_keytab": true , | ||
| "enable_execution_notifications": true | ||
| } , | ||
| "team": "taurus" | ||
| } | ||
Binary file added
BIN
+4.5 KB
projects/frontend/data-pipelines/gui/e2e/fixtures/lib/manage/e2e-cypress-dp-test.zip
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
projects/frontend/data-pipelines/gui/e2e/integration/app/app.spec.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright 2021-2023 VMware, Inc. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /// <reference types="cypress" /> | ||
|
|
||
| import { AppPage } from '../../support/pages/app/app.po'; | ||
|
|
||
| describe('App Page', { tags: ['@dataPipelines'] }, () => { | ||
| before(() => { | ||
| return AppPage.recordHarIfSupported() | ||
| .then(() => cy.clearLocalStorageSnapshot('app')) | ||
| .then(() => AppPage.login()) | ||
| .then(() => cy.saveLocalStorage('app')); | ||
| }); | ||
|
|
||
| after(() => { | ||
| AppPage.saveHarIfSupported(); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| cy.restoreLocalStorage('app'); | ||
| }); | ||
|
|
||
| it('App Page - Main Title Component have text: Data Pipelines', () => { | ||
| AppPage.navigateTo(); | ||
|
|
||
| const page = AppPage.getPage(); | ||
|
|
||
| page | ||
| .waitForInitialPageLoad(); | ||
|
|
||
| page | ||
| .getMainTitle() | ||
| .should('have.text', 'Data Pipelines'); | ||
| }); | ||
| }); |
142 changes: 142 additions & 0 deletions
142
...s/frontend/data-pipelines/gui/e2e/integration/app/getting-started/getting-started.spec.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| /* | ||
| * Copyright 2021-2023 VMware, Inc. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /// <reference types="cypress" /> | ||
| import { DataPipelinesBasePO } from '../../../support/application/data-pipelines-base.po'; | ||
|
ivakoleva marked this conversation as resolved.
|
||
| import { GettingStartedPage } from '../../../support/pages/app/getting-started/getting-started.po'; | ||
| import { DataJobsHealthPanelComponentPO } from '../../../support/pages/app/getting-started/data-jobs-health-panel-component.po'; | ||
| import { DataJobManageDetailsPage } from '../../../support/pages/app/lib/manage/data-job-details.po'; | ||
| import { DataJobManageExecutionsPage } from '../../../support/pages/app/lib/manage/data-job-executions.po'; | ||
| import { applyGlobalEnvSettings } from '../../../support/helpers/commands.helpers'; | ||
|
|
||
| describe('Getting Started Page', { tags: ['@dataPipelines'] }, () => { | ||
| let testJob; | ||
|
|
||
| before(() => { | ||
| return DataPipelinesBasePO.recordHarIfSupported() | ||
| .then(() => cy.clearLocalStorageSnapshot('getting-started')) | ||
| .then(() => DataPipelinesBasePO.login()) | ||
| .then(() => cy.saveLocalStorage('getting-started')) | ||
| .then(() => cy.prepareLongLivedFailingTestJob()) | ||
| .then(() => cy.createExecutionsLongLivedFailingTestJob()) | ||
| .then(() => cy.fixture('e2e-cy-dp-failing.job.json')) | ||
| .then((failingTestJob) => { | ||
| testJob = applyGlobalEnvSettings(failingTestJob); | ||
|
|
||
| return cy.wrap({ context: 'getting-started.spec::before()', action: 'continue' }); | ||
| }); | ||
| }); | ||
|
|
||
| after(() => { | ||
| DataPipelinesBasePO.saveHarIfSupported(); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| cy.restoreLocalStorage('getting-started'); | ||
|
|
||
| DataPipelinesBasePO.initBackendRequestInterceptor(); | ||
| }); | ||
|
|
||
| it('Main Title Component have text: Get Started with Data Pipelines', () => { | ||
| GettingStartedPage | ||
| .navigateTo() | ||
| .getMainTitle() | ||
| .should('have.text', 'Get Started with Data Pipelines'); | ||
| }); | ||
|
|
||
| describe('Data Jobs Health Overview Panel', () => { | ||
| it('Verify Widgets rendered correct data and failing jobs navigates correctly', () => { | ||
| GettingStartedPage | ||
| .navigateTo(); | ||
|
|
||
| let dataJobsHealthPanel = DataJobsHealthPanelComponentPO | ||
| .getComponent(); | ||
| dataJobsHealthPanel | ||
| .waitForViewToRender(); | ||
| dataJobsHealthPanel | ||
| .getDataJobsHealthPanel() | ||
| .scrollIntoView(); | ||
|
|
||
| dataJobsHealthPanel | ||
| .getExecutionsSuccessPercentage() | ||
| .should('be.gte', 0) | ||
| .should('be.lte', 100); | ||
| dataJobsHealthPanel | ||
| .getNumberOfFailedExecutions() | ||
| .should('be.gte', 2); | ||
| dataJobsHealthPanel | ||
| .getExecutionsTotal() | ||
| .should('be.gte', 2); | ||
|
|
||
| dataJobsHealthPanel | ||
| .getAllFailingJobs() | ||
| .should('have.length.gte', 1); | ||
|
|
||
| dataJobsHealthPanel | ||
| .getAllMostRecentFailingJobsExecutions() | ||
| .should('have.length.gte', 1); | ||
|
|
||
| // navigate to failing job details | ||
| dataJobsHealthPanel | ||
| .navigateToFailingJobDetails(testJob.job_name); | ||
|
|
||
| const dataJobManageDetailsPage = DataJobManageDetailsPage | ||
| .getPage(); | ||
| dataJobManageDetailsPage | ||
| .getMainTitle() | ||
| .should('contain.text', testJob.job_name); | ||
| dataJobManageDetailsPage | ||
| .getDetailsTab() | ||
| .should('be.visible') | ||
| .should('have.class', 'active'); | ||
| dataJobManageDetailsPage | ||
| .getExecutionsTab() | ||
| .should('exist') | ||
| .should('not.have.class', 'active'); | ||
| dataJobManageDetailsPage | ||
| .showMoreDescription() | ||
| .getDescriptionFull() | ||
| .should('contain.text', testJob.description); | ||
| }); | ||
|
|
||
| it('Verify most recent failing executions Widget navigates correctly', () => { | ||
| GettingStartedPage | ||
| .navigateTo(); | ||
|
|
||
| let dataJobsHealthPanel = DataJobsHealthPanelComponentPO | ||
| .getComponent(); | ||
| dataJobsHealthPanel | ||
| .waitForViewToRender(); | ||
| dataJobsHealthPanel | ||
| .getDataJobsHealthPanel() | ||
| .scrollIntoView(); | ||
|
|
||
| dataJobsHealthPanel | ||
| .getAllMostRecentFailingJobsExecutions() | ||
| .should('have.length.gte', 1); | ||
|
|
||
| // navigate to most recent failing job executions | ||
| dataJobsHealthPanel | ||
| .navigateToMostRecentFailingJobExecutions(testJob.job_name); | ||
|
|
||
| const dataJobManageExecutionsPage = DataJobManageExecutionsPage | ||
| .getPage(); | ||
| dataJobManageExecutionsPage | ||
| .getMainTitle() | ||
| .should('contain.text', testJob.job_name); | ||
| dataJobManageExecutionsPage | ||
| .getDetailsTab() | ||
| .should('be.visible') | ||
| .should('not.have.class', 'active'); | ||
| dataJobManageExecutionsPage | ||
| .getExecutionsTab() | ||
| .should('be.visible') | ||
| .should('have.class', 'active'); | ||
| dataJobManageExecutionsPage | ||
| .getDataGridRows() | ||
| .should('have.length.gte', 1); | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.