|
|
|
@@ -9,31 +9,33 @@ it('allows user to log in and log out', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('allows creating a dashboard with a panel', () => {
|
|
|
|
|
const PANEL_TITLE = 'Test panel title';
|
|
|
|
|
const PANEL_DESCRIPTION = 'Test panel description';
|
|
|
|
|
const DASHBOARD_TITLE = 'Dashboard title';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('dashboard/new');
|
|
|
|
|
cy.contains('button', 'Add a new panel').click();
|
|
|
|
|
cy.get('[value*="Panel Title"]').clear().type(`${PANEL_TITLE}.${random}`);
|
|
|
|
|
cy.get('textarea#description-text-area').type(
|
|
|
|
|
`${PANEL_DESCRIPTION}.${random}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
cy.contains('button', 'Apply').click();
|
|
|
|
|
cy.fixture('panels').then((panel) => {
|
|
|
|
|
cy.get('[value*="Panel Title"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${panel.newPanel.title} ${random}`);
|
|
|
|
|
cy.get('textarea#description-text-area').type(
|
|
|
|
|
`${panel.newPanel.description} ${random}`
|
|
|
|
|
);
|
|
|
|
|
cy.contains('button', 'Apply').click();
|
|
|
|
|
cy.contains('.panel-title', `${panel.newPanel.title} ${random}`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cy.contains('.panel-title', PANEL_TITLE);
|
|
|
|
|
cy.get('[aria-label*="Save dashboard"]').click();
|
|
|
|
|
cy.get('button[aria-label*="Close dialogue"]');
|
|
|
|
|
cy.get('[name*="title"]').clear().type(`${DASHBOARD_TITLE}.${random}`);
|
|
|
|
|
cy.fixture('dashboards').then((dashboard) => {
|
|
|
|
|
cy.get('[name*="title"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${dashboard.newDashboard.title} ${random}`);
|
|
|
|
|
});
|
|
|
|
|
cy.get('[type*="submit"]').click();
|
|
|
|
|
verifySuccesOfAction();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('checks if it is possible to upload a dashboard as JSON file', () => {
|
|
|
|
|
const DASHBOARD_TITLE = 'New Test dashboard';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('dashboard/import');
|
|
|
|
|
cy.contains('label', 'Upload JSON').click();
|
|
|
|
@@ -41,39 +43,40 @@ it('checks if it is possible to upload a dashboard as JSON file', () => {
|
|
|
|
|
'cypress/fixtures/test-dashboard.json',
|
|
|
|
|
{ force: true }
|
|
|
|
|
);
|
|
|
|
|
cy.get('[data-testid*="data-testid-import-dashboard-title"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${DASHBOARD_TITLE}.${random}`);
|
|
|
|
|
cy.get('[data-testid*="data-testid-import-dashboard-submit"]').click();
|
|
|
|
|
cy.visit('dashboards');
|
|
|
|
|
cy.contains('div', DASHBOARD_TITLE);
|
|
|
|
|
|
|
|
|
|
cy.fixture('dashboards').then((dashboard) => {
|
|
|
|
|
cy.get('[data-testid*="data-testid-import-dashboard-title"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${dashboard.newDashboard.uploadedTitle} ${random}`);
|
|
|
|
|
cy.get('[data-testid*="data-testid-import-dashboard-submit"]').click();
|
|
|
|
|
cy.visit('dashboards');
|
|
|
|
|
cy.contains('div', `${dashboard.newDashboard.uploadedTitle} ${random}`);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('allows inviting a user', () => {
|
|
|
|
|
const TEST_EMAIL_ADDRESS = 'test@email.com';
|
|
|
|
|
const INVITE_USER_NAME = 'Invited test user';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('/org/users/invite');
|
|
|
|
|
cy.get('[name*="loginOrEmail"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${TEST_EMAIL_ADDRESS}.${random}`);
|
|
|
|
|
cy.get('[name*="name"]').clear().type(`${INVITE_USER_NAME}.${random}`);
|
|
|
|
|
cy.fixture('users').then((user) => {
|
|
|
|
|
cy.get('[name*="loginOrEmail"]')
|
|
|
|
|
.clear()
|
|
|
|
|
.type(`${user.newUser.email}.${random}`);
|
|
|
|
|
cy.get('[name*="name"]').clear().type(`${user.newUser.userName}.${random}`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cy.get('[name*="sendEmail"]').click({ force: true });
|
|
|
|
|
cy.get('[type*="submit"]').click();
|
|
|
|
|
verifySuccesOfAction();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('checks if smtp is configured', () => {
|
|
|
|
|
const SMTP_ADDRESS = 'test@smtp.com';
|
|
|
|
|
const SMTP_NAME = 'test_smtp';
|
|
|
|
|
const SMTP_USER = 'smtp_user';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('admin/settings');
|
|
|
|
|
cy.contains('td', SMTP_ADDRESS);
|
|
|
|
|
cy.contains('td', SMTP_NAME);
|
|
|
|
|
cy.contains('td', SMTP_USER);
|
|
|
|
|
cy.fixture('smtps').then((smtp) => {
|
|
|
|
|
cy.contains('td', smtp.newSMTPConfig.email);
|
|
|
|
|
cy.contains('td', smtp.newSMTPConfig.name);
|
|
|
|
|
cy.contains('td', smtp.newSMTPConfig.user);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('checks if plugin page is showing plugins', () => {
|
|
|
|
@@ -83,15 +86,19 @@ it('checks if plugin page is showing plugins', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('checks if it is possible to create and delete a data source', () => {
|
|
|
|
|
const DATASOURCE = 'Prometheus';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('/datasources/new');
|
|
|
|
|
cy.get('input[placeholder*="Filter by name or type"]').type(DATASOURCE);
|
|
|
|
|
cy.get(`button[aria-label*="Add data source ${DATASOURCE}"]`).click();
|
|
|
|
|
cy.contains('div', 'Datasource added');
|
|
|
|
|
cy.visit('/datasources');
|
|
|
|
|
cy.contains('a', DATASOURCE).click({ force: true });
|
|
|
|
|
cy.fixture('datasources').then((datasource) => {
|
|
|
|
|
cy.get('input[placeholder*="Filter by name or type"]').type(
|
|
|
|
|
datasource.newDatasource.name
|
|
|
|
|
);
|
|
|
|
|
cy.get(
|
|
|
|
|
`button[aria-label*="Add data source ${datasource.newDatasource.name}"]`
|
|
|
|
|
).click();
|
|
|
|
|
cy.contains('div', 'Datasource added');
|
|
|
|
|
cy.visit('/datasources');
|
|
|
|
|
cy.contains('a', datasource.newDatasource.name).click({ force: true });
|
|
|
|
|
});
|
|
|
|
|
cy.contains('button', 'Delete').click();
|
|
|
|
|
cy.contains('div', 'Are you sure you want to delete');
|
|
|
|
|
cy.get('button[aria-label*="Confirm Modal Danger Button"]').click();
|
|
|
|
@@ -99,14 +106,16 @@ it('checks if it is possible to create and delete a data source', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('checks if an API key can be added and deleted', () => {
|
|
|
|
|
const API_KEY_NAME = 'test_api_key';
|
|
|
|
|
|
|
|
|
|
cy.login();
|
|
|
|
|
cy.visit('org/apikeys');
|
|
|
|
|
cy.get(
|
|
|
|
|
'[data-testid*="data-testid Call to action button New API key"]'
|
|
|
|
|
).click();
|
|
|
|
|
cy.get('input[placeholder*="Name"]').type(`${API_KEY_NAME}.${random}`);
|
|
|
|
|
cy.fixture('apikeys').then((apikey) => {
|
|
|
|
|
cy.get('input[placeholder*="Name"]').type(
|
|
|
|
|
`${apikey.newAPIKey.name}.${random}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
cy.contains('button', 'Add').click({ force: true });
|
|
|
|
|
cy.contains('h2', 'API Key Created');
|
|
|
|
|
cy.get('button[aria-label*="Close dialogue"]').click();
|
|
|
|
|