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

e2e: grafana 10.0.0 #205

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 2 additions & 9 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure to have an up to date `dist/` folder using `yarn build`.

```BASH
cd tests/
docker compose up -d checkmk grafana
docker compose up -d checkmk grafana --pull always
yarn run cypress open
```

Expand All @@ -67,7 +67,7 @@ See the official [docs](https://docs.cypress.io/guides/overview/why-cypress) for

```BASH
cd tests/
docker compose up --exit-code-from=cypress
docker compose up --exit-code-from=cypress --pull always
```

This will run all tests without any further interaction necessary.
Expand Down Expand Up @@ -100,10 +100,3 @@ yarn run cypress run

Please note that the test have side effects on your Grafana and CheckMK instance,
such as creating a new automation user.

### Making sure you use the latest Grafana image
Docker (compose) reuses already downloaded images as much as it can. So in order to get the latest Grafana image
you need to remove the current image you have. The following snipped does a clean sweep.
```BASH
docker compose down --rmi all
```
2 changes: 2 additions & 0 deletions src/ui/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export const HostLabelFilter: React.FC<HostLabelProps> = (props) => {
onChange={onLabelsChange}
value={toMultiSelectValue(value)}
placeholder="Type to trigger search"
inputId="checkmk-filter-host-label-select-input"
/>
</InlineField>
);
Expand Down Expand Up @@ -487,6 +488,7 @@ export const OnlyActiveChildren = (props: OnlyActiveChildrenProps): JSX.Element
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
onChange={(value) => setActiveComponents((c) => [...c, value.value!])}
value={{ label: 'Add Filter' }}
inputId="checkmk-add-filter-input"
/>
</InlineField>
)}
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('e2e tests', () => {
const CmkCRE = 'RAW Edition';

const inputDatasourceId = 'data-source-picker';
const inputFilterId = 'react-select-7-input';
const inputFilterId = 'checkmk-add-filter-input';
const inputGraphId = 'input_Predefined graph';
const inputGraphTypeId = 'input_Graph type';
const inputHostId = 'input_Hostname';
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('e2e tests', () => {
cy.inputLocatorById(inputFilterId).type('Host labels{enter}'); // Filter -> 'Host labels'
cy.contains('Host labels').should('exist');

cy.inputLocatorById('react-select-15-input').type('cmk/site:cm'); // Host labels -> 'cmk/site:cm' (one entry)
cy.inputLocatorById('checkmk-filter-host-label-select-input').type('cmk/site:cm'); // Host labels -> 'cmk/site:cm' (one entry)
// TODO: should only contain a single lable, but shows all?
cy.contains('cmk/site:cmk').should('exist');
cy.contains('cmk/site:cmk').click();
Expand Down
3 changes: 2 additions & 1 deletion tests/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Cypress.Commands.add('addNewPanel', () => {
// add a new panel in a new dashboard
cy.visit('/dashboard/new');
cy.get('button[aria-label="Add new panel"]').click();
cy.get('[role=dialog]').type('{esc}');
});

Cypress.Commands.add('addCmkDatasource', (cmkUser: string, cmkPass: string, edition: string) => {
Expand All @@ -37,7 +38,7 @@ Cypress.Commands.add('addCmkDatasource', (cmkUser: string, cmkPass: string, edit
cy.get('[data-test-id="checkmk-password"]').type(cmkPass);
cy.get('[id="checkmk-version"]').type('<{enter}');

cy.get('[aria-label="Data source settings page Save and Test button"]').click();
cy.get('[data-testid="data-testid Data source settings page Save and Test button"]').click();

cy.get('[data-testid="data-testid Alert success"]').should('be.visible');
cy.contains('Data source is working').should('be.visible');
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
grafana:
image: grafana/grafana-oss:9.5.3-ubuntu
image: grafana/grafana-oss:latest-ubuntu
volumes:
- ../dist/:/var/lib/grafana/plugins/grafana-checkmk-datasource
environment:
Expand Down