-
Notifications
You must be signed in to change notification settings - Fork 51
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
Merge Frontend for OpenSearch Integrations #618
Merged
Merged
Changes from all commits
Commits
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
This file contains 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,105 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { | ||
TEST_INTEGRATION_INSTANCE, TEST_SAMPLE_INSTANCE, | ||
} from '../utils/constants'; | ||
|
||
let testInstanceSuffix = (Math.random() + 1).toString(36).substring(7); | ||
let testInstance = `${TEST_INTEGRATION_INSTANCE}_${testInstanceSuffix}`; | ||
|
||
const moveToIntegrationsHome = () => { | ||
cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/available`); | ||
}; | ||
|
||
const moveToAvailableNginxIntegration = () => { | ||
cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/available/nginx`); | ||
}; | ||
|
||
const moveToAddedIntegrations = () => { | ||
cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/installed`); | ||
}; | ||
|
||
|
||
describe('Basic sanity test for integrations plugin', () => { | ||
it('Navigates to integrations plugin and expects the correct header', () => { | ||
moveToIntegrationsHome(); | ||
cy.get('[data-test-subj="integrations-header"]').should('exist'); | ||
}); | ||
|
||
it('Navigates to integrations plugin and tests that clicking the nginx cards navigates to the nginx page', () => { | ||
moveToIntegrationsHome(); | ||
cy.get('[data-test-subj="integration_card_nginx"]').click(); | ||
cy.url().should('include', '/available/nginx') | ||
}) | ||
|
||
it('Navigates to nginx page and asserts the page to be as expected', () => { | ||
moveToAvailableNginxIntegration(); | ||
cy.get('[data-test-subj="nginx-overview"]').should('exist') | ||
cy.get('[data-test-subj="nginx-details"]').should('exist') | ||
cy.get('[data-test-subj="nginx-screenshots"]').should('exist') | ||
cy.get('[data-test-subj="nginx-assets"]').should('exist') | ||
cy.get('[data-test-subj="fields"]').click(); | ||
cy.get('[data-test-subj="nginx-fields"]').should('exist') | ||
}) | ||
}); | ||
|
||
describe('Tests the add nginx integration instance flow', () => { | ||
it('Navigates to nginx page and triggers the adds the instance flow', () => { | ||
moveToAvailableNginxIntegration(); | ||
cy.get('[data-test-subj="add-integration-button"]').click(); | ||
cy.get('[data-test-subj="new-instance-name"]').should('have.value', 'nginx'); | ||
cy.get('[data-test-subj="createInstanceButton"]').should('be.disabled') | ||
cy.get('[data-test-subj="addIntegrationFlyoutTitle"]').should('exist') | ||
cy.get('[data-test-subj="data-source-name"]').type('test'); | ||
cy.get('[data-test-subj="new-instance-name"]').type(testInstance.substring(5)); | ||
cy.get('[data-test-subj="createInstanceButton"]').click(); | ||
cy.get('.euiToastHeader__title').should('contain', 'successfully'); | ||
}) | ||
|
||
it('Navigates to installed integrations page and verifies that nginx-test exists', () => { | ||
moveToAddedIntegrations(); | ||
cy.contains(testInstance).should('exist'); | ||
cy.get(`[data-test-subj="${testInstance}IntegrationLink"]`).click(); | ||
}) | ||
|
||
it('Navigates to added integrations page and verifies that nginx-test exists and linked asset works as expected', () => { | ||
moveToAddedIntegrations(); | ||
cy.contains(TEST_INTEGRATION_INSTANCE).should('exist'); | ||
cy.get(`[data-test-subj="${testInstance}IntegrationLink"]`).click(); | ||
cy.get(`[data-test-subj="IntegrationAssetLink"]`).click(); | ||
cy.url().should('include', '/dashboards#/') | ||
}) | ||
|
||
it('Navigates to installed nginx-test instance page and deletes it', () => { | ||
moveToAddedIntegrations(); | ||
cy.contains(testInstance).should('exist'); | ||
cy.get(`[data-test-subj="${testInstance}IntegrationLink"]`).click(); | ||
cy.get('[data-test-subj="deleteInstanceButton"]').click(); | ||
|
||
cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('be.disabled'); | ||
|
||
cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', { | ||
delay: 50, | ||
}); | ||
cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('not.be.disabled'); | ||
cy.get('button[data-test-subj="popoverModal__deleteButton"]').click(); | ||
cy.get('.euiToastHeader__title').should('contain', 'successfully'); | ||
}) | ||
}); | ||
|
||
describe('Tests the add nginx integration instance flow', () => { | ||
it('Navigates to nginx page and triggers the try it flow', () => { | ||
moveToAvailableNginxIntegration(); | ||
cy.get('[data-test-subj="try-it-button"]').click(); | ||
cy.get('.euiToastHeader__title').should('contain', 'successfully'); | ||
moveToAddedIntegrations(); | ||
cy.contains(TEST_SAMPLE_INSTANCE).should('exist'); | ||
}) | ||
}); | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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,16 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest'; | ||
export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard']; | ||
export const INTEGRATION_TEMPLATE_OPTIONS = ['nginx', 'aws_elb']; | ||
export const INTEGRATION_CATEOGRY_OPTIONS = [ | ||
'communication', | ||
'http', | ||
'cloud', | ||
'aws_elb', | ||
'container', | ||
'logs', | ||
]; |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add cleanup on each test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't consider this a blocking note. Create a follow-on issue for tracking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call out, sometime I run into issues where i have added too many on my local that it shows up on second page, created an issue: #620