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 aa641c7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
29 changes: 28 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,31 @@ 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.type('PCP Redis');
cy.contains('PCP Redis').click();

// 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.contains('PCP Vector').click();

// 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 aa641c7

Please sign in to comment.