Skip to content

Commit

Permalink
Fix cypress reporting (#123)
Browse files Browse the repository at this point in the history
* fix create test
Signed-off-by: David Cui <davidcui@amazon.com>
  • Loading branch information
davidcui1225 authored Jul 10, 2021
1 parent 48570bd commit 8e2470f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
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');
});
});
3 changes: 3 additions & 0 deletions dashboards-reports/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"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

0 comments on commit 8e2470f

Please sign in to comment.