Skip to content

Commit

Permalink
e2e: grafana 10.0.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktSeidl committed Jun 14, 2023
1 parent 692290a commit 903e22c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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

0 comments on commit 903e22c

Please sign in to comment.