-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maxim/bring heartbeats back to UI (#2550)
# What this PR does Bring heartbeats back to UI ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
- Loading branch information
1 parent
c843e66
commit 18da310
Showing
6 changed files
with
196 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { test, Page, expect, Locator } from '../fixtures'; | ||
|
||
import { generateRandomValue, selectDropdownValue } from '../utils/forms'; | ||
import { createIntegration } from '../utils/integrations'; | ||
|
||
test.describe("updating an integration's heartbeat interval works", async () => { | ||
test.slow(); | ||
|
||
const _openIntegrationSettingsPopup = async (page: Page): Promise<Locator> => { | ||
const integrationSettingsPopupElement = page.getByTestId('integration-settings-context-menu'); | ||
await integrationSettingsPopupElement.click(); | ||
return integrationSettingsPopupElement; | ||
}; | ||
|
||
const _openHeartbeatSettingsForm = async (page: Page) => { | ||
const integrationSettingsPopupElement = await _openIntegrationSettingsPopup(page); | ||
|
||
await integrationSettingsPopupElement.click(); | ||
|
||
await page.getByTestId('integration-heartbeat-settings').click(); | ||
}; | ||
|
||
test('"change heartbeat interval', async ({ adminRolePage: { page } }) => { | ||
const integrationName = generateRandomValue(); | ||
await createIntegration(page, integrationName); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatSettingsForm = page.getByTestId('heartbeat-settings-form'); | ||
|
||
const value = '30 minutes'; | ||
|
||
await selectDropdownValue({ | ||
page, | ||
startingLocator: heartbeatSettingsForm, | ||
selectType: 'grafanaSelect', | ||
value, | ||
optionExactMatch: false, | ||
}); | ||
|
||
await heartbeatSettingsForm.getByTestId('update-heartbeat').click(); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatIntervalValue = await heartbeatSettingsForm | ||
.locator('div[class*="grafana-select-value-container"] > div[class*="-singleValue"]') | ||
.textContent(); | ||
|
||
expect(heartbeatIntervalValue).toEqual(value); | ||
}); | ||
|
||
test('"send heartbeat', async ({ adminRolePage: { page } }) => { | ||
const integrationName = generateRandomValue(); | ||
await createIntegration(page, integrationName); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatSettingsForm = page.getByTestId('heartbeat-settings-form'); | ||
|
||
const endpoint = await heartbeatSettingsForm | ||
.getByTestId('input-wrapper') | ||
.locator('input[class*="input-input"]') | ||
.inputValue(); | ||
|
||
await page.goto(endpoint); | ||
|
||
await page.goBack(); | ||
|
||
const heartbeatBadge = await page.getByTestId('heartbeat-badge'); | ||
|
||
await expect(heartbeatBadge).toHaveClass(/--success/); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
...iners/IntegrationContainers/IntegrationHeartbeatForm/IntegrationHeartbeatForm.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.instruction { | ||
ol, | ||
ul { | ||
padding: 0; | ||
margin: 0; | ||
list-style: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.