Skip to content

Commit

Permalink
Fix test not working due to changes on Grafana
Browse files Browse the repository at this point in the history
Last Grafana's version updated some controls at the login page and our
tests were unable to run. This commit updates the selectors on our test
suite

CMK-15488
  • Loading branch information
lpetrora committed Dec 21, 2023
1 parent b441051 commit 2cfcff2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Cypress.Commands.add('addCmkDatasource', (cmkUser: string, cmkPass: string, edit
cy.visit('/datasources/new');
cy.get(GrafanaSelectors.AddDataSource.select_datasource_button('Checkmk')).contains('Checkmk').click();

cy.get(CheckMkSelectors.SetupForm.name).type(' ' + edition);
cy.get(CheckMkSelectors.SetupForm.name).clear().type(`Checkmk ${edition}`);
cy.get(CheckMkSelectors.SetupForm.url).type(Cypress.env('grafanaToCheckmkUrl'));
cy.get(CheckMkSelectors.SetupForm.edition).type(edition + '{enter}');
cy.contains(edition).should('exist');
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/support/grafana_selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Selectors = {
Login: {
username_input: 'input[name="user"]',
password_input: 'input[name="password"]',
login_button: 'button[aria-label="Login button"]',
login_button: 'button[data-testid="data-testid Login button"]',
},

AddDataSource: {
Expand Down

0 comments on commit 2cfcff2

Please sign in to comment.