mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [FTR] Add pause/resume auto refresh to header page object * remove unecessary promise.resolve
This commit is contained in:
parent
0e5137f456
commit
56b85f017b
2 changed files with 26 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
aria-label="{{ timefilter.refreshInterval.pause ? 'Resume refreshing data' : 'Pause refreshing data' }}"
|
||||
ng-click="toggleRefresh()"
|
||||
ng-show="timefilter.isAutoRefreshSelectorEnabled && (timefilter.refreshInterval.value > 0)"
|
||||
data-test-subj="globalTimepickerAutoRefreshButton"
|
||||
data-test-subj-state="{{ timefilter.refreshInterval.pause ? 'inactive' : 'active' }}"
|
||||
>
|
||||
<span
|
||||
class="kuiIcon"
|
||||
|
|
|
@ -169,6 +169,30 @@ export function HeaderPageProvider({ getService, getPageObjects }) {
|
|||
.findByLinkText(quickTime).click();
|
||||
}
|
||||
|
||||
async getAutoRefreshState() {
|
||||
return testSubjects.getAttribute('globalTimepickerAutoRefreshButton', 'data-test-subj-state');
|
||||
}
|
||||
|
||||
// check if the auto refresh state is active and to pause it
|
||||
async pauseAutoRefresh() {
|
||||
let result = false;
|
||||
if (await this.getAutoRefreshState() === 'active') {
|
||||
await testSubjects.click('globalTimepickerAutoRefreshButton');
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// check if the auto refresh state is inactive and to resume it
|
||||
async resumeAutoRefresh() {
|
||||
let result = false;
|
||||
if (await this.getAutoRefreshState() === 'inactive') {
|
||||
await testSubjects.click('globalTimepickerAutoRefreshButton');
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async getToastMessage(findTimeout = defaultFindTimeout) {
|
||||
const toastMessage =
|
||||
await find.displayedByCssSelector('kbn-truncated.toast-message.ng-isolate-scope', findTimeout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue