Skip to content

Commit 4ba6b47

Browse files
committed
Separate login from datasource creation
We here modify the datasource-creation function not to perform the login inside of it but rather in the tests' module.
1 parent 014461b commit 4ba6b47

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

tests/cypress/e2e/helpers.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,7 @@ export function addNewPanel() {
2424
cy.get('button[aria-label="Add new panel"]').click();
2525
}
2626

27-
export function addCmkDatasource(
28-
cmkUsername: string,
29-
cmkPassword: string,
30-
grafanaUsername: string,
31-
passwordGrafana: string
32-
) {
33-
loginGrafana(grafanaUsername, passwordGrafana);
34-
27+
export function addCmkDatasource(cmkUsername: string, cmkPassword: string) {
3528
cy.visit('/datasources/new');
3629
cy.get('button[aria-label="Add data source Checkmk"]').contains('Checkmk').click();
3730

tests/cypress/e2e/spec.cy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ describe('e2e tests', () => {
4242
executeServiceDiscovery(hostName1, 'new');
4343
activateCmkChanges('cmk');
4444

45-
addCmkDatasource(cmkUser, cmkPassword, Cypress.env('grafanaUsername'), Cypress.env('grafanaPassword'));
45+
loginGrafana(Cypress.env('grafanaUsername'), Cypress.env('grafanaPassword'));
46+
addCmkDatasource(cmkUser, cmkPassword);
4647
});
4748

4849
it('time-usage panel by service (single host)', {}, () => {

0 commit comments

Comments
 (0)