Skip to content

Commit 2cfcff2

Browse files
committed
Fix test not working due to changes on Grafana
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
1 parent b441051 commit 2cfcff2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/cypress/support/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Cypress.Commands.add('addCmkDatasource', (cmkUser: string, cmkPass: string, edit
3737
cy.visit('/datasources/new');
3838
cy.get(GrafanaSelectors.AddDataSource.select_datasource_button('Checkmk')).contains('Checkmk').click();
3939

40-
cy.get(CheckMkSelectors.SetupForm.name).type(' ' + edition);
40+
cy.get(CheckMkSelectors.SetupForm.name).clear().type(`Checkmk ${edition}`);
4141
cy.get(CheckMkSelectors.SetupForm.url).type(Cypress.env('grafanaToCheckmkUrl'));
4242
cy.get(CheckMkSelectors.SetupForm.edition).type(edition + '{enter}');
4343
cy.contains(edition).should('exist');

tests/cypress/support/grafana_selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Selectors = {
1111
Login: {
1212
username_input: 'input[name="user"]',
1313
password_input: 'input[name="password"]',
14-
login_button: 'button[aria-label="Login button"]',
14+
login_button: 'button[data-testid="data-testid Login button"]',
1515
},
1616

1717
AddDataSource: {

0 commit comments

Comments
 (0)