Skip to content
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

Backport: fix reports dashboard cypress tests #148

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion dashboards-reports/.cypress/integration/01-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
* permissions and limitations under the License.
*/

describe('Adding sample data', () => {
it('Adds sample data', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardflights"]').contains(/(Add|View) data/).click();
cy.wait(3000);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardecommerce"]').contains(/(Add|View) data/).click();
cy.wait(3000);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardlogs"]').contains(/(Add|View) data/).click();
cy.wait(3000);
});
});

describe('Cypress', () => {
it('Visits Reporting homepage', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/reports-dashboards#/`);
Expand Down Expand Up @@ -59,10 +73,20 @@ describe('Cypress', () => {
cy.get('#reportSettingsDescription').type('Description for cypress test');

// select a report source
cy.get('.euiComboBox').click({ force: true });
cy.get('[data-test-subj="comboBoxInput"]').eq(0).click({ force: true });

// select drop-down option in report source list
cy.contains('[Logs] Web Traffic').click();

cy.wait(500);

// create an on-demand report definition
cy.get('#createNewReportDefinition').click({ force: true });

cy.wait(12500);

// check that re-direct to
cy.get('#reportDefinitionDetailsLink').should('exist');
});

it('Create a new scheduled report definition', () => {
Expand All @@ -80,6 +104,14 @@ describe('Cypress', () => {
// enter a report description
cy.get('#reportSettingsDescription').type('Description for cypress test');

// select a report source
cy.get('[data-test-subj="comboBoxInput"]').eq(0).click({ force: true });

// select drop-down option in report source list
cy.contains('[Logs] Web Traffic').click();

cy.wait(500);

// set report trigger to Schedule option
cy.get('[type="radio"]').check({ force: true });

Expand All @@ -88,5 +120,10 @@ describe('Cypress', () => {

// create scheduled report definition
cy.get('#createNewReportDefinition').click({ force: true });

cy.wait(12500);

// check that re-direct to
cy.get('#reportDefinitionDetailsLink').should('exist');
});
});
5 changes: 4 additions & 1 deletion dashboards-reports/cypress.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"video": false,
"video": true,
"fixturesFolder": ".cypress/fixtures",
"integrationFolder": ".cypress/integration",
"pluginsFile": ".cypress/plugins/index.js",
"screenshotsFolder": ".cypress/screenshots",
"supportFile": ".cypress/support/index.js",
"videosFolder": ".cypress/videos",
"requestTimeout": 60000,
"responseTimeout": 60000,
"defaultCommandTimeout": 60000,
"env": {
"opensearch": "localhost:9200",
"opensearchDashboards": "localhost:5601",
Expand Down