Skip to content

Commit

Permalink
update ci tests for grafana 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeifer committed Mar 25, 2024
1 parent a3978b6 commit 6ac39b4
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
28 changes: 27 additions & 1 deletion cypress/e2e/datasources/redis.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('PCP Redis data source', () => {
cy.contains('Dashboard Imported');
});

it('should auto-complete metric names', () => {
it('should auto-complete metric names grafana 9', () => {
cy.visit('/dashboard/new');
cy.contains('Add a new panel').click();

Expand All @@ -40,4 +40,30 @@ describe('PCP Redis data source', () => {
// if the following assertion fails, check the wordPattern setting in the Monaco Editor
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_rawactive').blur();
});

it('should complete metric names grafana 10', () => {
cy.visit('/dashboard/new');
cy.contains('Add visualization').click();

//select redis datasource from the modal
cy.get('div.scrollbar-view').contains('PCP Redis').click({ force: true });

// start typing
cy.get('.monaco-editor textarea').type('disk.dev.by', { force: true });
cy.contains('disk.dev.total_bytes'); // auto-complete

// click on one auto-completion entry
cy.contains('disk.dev.write_bytes').click();
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_bytes').blur();

// remove '_bytes' from query editor and type '_' to open auto-completion again
cy.get('.monaco-editor textarea').type('{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}_', {
force: true,
});

// click on one auto-completion entry
cy.contains('disk.dev.write_rawactive').click();
// if the following assertion fails, check the wordPattern setting in the Monaco Editor
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_rawactive').blur();
})
});
34 changes: 33 additions & 1 deletion cypress/e2e/datasources/vector.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('PCP Vector data source', () => {
cy.contains('Dashboard Imported');
});

it('should auto-complete metric names', () => {
it('should auto-complete metric names grafana 9', () => {
cy.visit('/dashboard/new');
cy.contains('Add a new panel').click();

Expand All @@ -44,4 +44,36 @@ describe('PCP Vector data source', () => {
// if the following assertion fails, check the wordPattern setting in the Monaco Editor
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_rawactive').blur();
});

it('should auto-complete metric names grafana 10', () => {
cy.visit('/dashboard/new');
cy.contains('Add visualization').click();

//select vector datasource from the modal
cy.get('div.scrollbar-view').contains('PCP Vector').click({ force: true });

// start typing
cy.get('.monaco-editor').type('disk.dev.write_b');
// auto-complete
cy.contains('disk.dev.write_bytes');
cy.contains('Semantics: counter');
cy.contains('Units: Kbyte');
cy.contains('per-disk count of bytes written');

// accept a suggestion
cy.contains('disk.dev.write_bytes').type('{enter}');
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_bytes').blur();

// remove '_bytes' from query editor and type '_' to open auto-completion again
cy.get('.monaco-editor textarea').type('{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}_', {
force: true,
});

// click on one auto-completion entry
cy.contains('disk.dev.write_rawactive').click();
// if the following assertion fails, check the wordPattern setting in the Monaco Editor
cy.get('.monaco-editor textarea').should('have.value', 'disk.dev.write_rawactive').blur();

});

});

0 comments on commit 6ac39b4

Please sign in to comment.