diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 096c3737..7247b0c1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -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 ``` @@ -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. @@ -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 -``` \ No newline at end of file diff --git a/src/ui/components.tsx b/src/ui/components.tsx index 8fb4c782..c888ada5 100644 --- a/src/ui/components.tsx +++ b/src/ui/components.tsx @@ -410,6 +410,7 @@ export const HostLabelFilter: React.FC = (props) => { onChange={onLabelsChange} value={toMultiSelectValue(value)} placeholder="Type to trigger search" + inputId="checkmk-filter-host-label-select-input" /> ); @@ -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" /> )} diff --git a/tests/cypress/e2e/spec.cy.ts b/tests/cypress/e2e/spec.cy.ts index 55b7e293..ea1f3ed1 100644 --- a/tests/cypress/e2e/spec.cy.ts +++ b/tests/cypress/e2e/spec.cy.ts @@ -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'; @@ -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(); diff --git a/tests/cypress/support/commands.ts b/tests/cypress/support/commands.ts index 37bddd86..8ccaa358 100644 --- a/tests/cypress/support/commands.ts +++ b/tests/cypress/support/commands.ts @@ -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) => { @@ -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'); diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 5d33e7b3..5f4eb4ae 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -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: