forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable save button if visualization is dirty (elastic#11576)
(backport: manual merge edits in test file)
- Loading branch information
1 parent
a65a652
commit 9641477
Showing
4 changed files
with
75 additions
and
0 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
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,59 @@ | ||
import expect from 'expect.js'; | ||
|
||
export default function ({ getService, getPageObjects }) { | ||
const log = getService('log'); | ||
const PageObjects = getPageObjects(['common', 'visualize', 'header']); | ||
|
||
describe('visualize app', function describeIndexTests() { | ||
beforeEach(async function () { | ||
const fromTime = '2015-09-19 06:31:44.000'; | ||
const toTime = '2015-09-23 18:31:44.000'; | ||
|
||
log.debug('navigateToApp visualize'); | ||
await PageObjects.common.navigateToUrl('visualize', 'new'); | ||
|
||
log.debug('clickLineChart'); | ||
await PageObjects.visualize.clickLineChart(); | ||
await PageObjects.visualize.clickNewSearch(); | ||
|
||
log.debug(`Set absolute time range from "${fromTime}" to "${toTime}"`); | ||
await PageObjects.header.setAbsoluteRange(fromTime, toTime); | ||
|
||
// make sure that changes in the test are what will make the visualization dirty | ||
await PageObjects.visualize.clickGo(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const isEnabled = await PageObjects.visualize.isSaveButtonEnabled(); | ||
expect(isEnabled).to.be(true); | ||
}); | ||
|
||
describe('editor', function indexPatternCreation() { | ||
it('should disable the save button if visualization is dirty', async function () { | ||
log.debug('Bucket = Split Chart'); | ||
await PageObjects.visualize.clickBucket('Split Chart'); | ||
log.debug('Aggregation = Terms'); | ||
await PageObjects.visualize.selectAggregation('Terms'); | ||
log.debug('Field = extension'); | ||
await PageObjects.visualize.selectField('extension.raw'); | ||
|
||
const isEnabled = await PageObjects.visualize.isSaveButtonEnabled(); | ||
expect(isEnabled).to.be(false); | ||
}); | ||
|
||
it('should enable the save button if changes are applied', async function () { | ||
log.debug('Bucket = Split Chart'); | ||
await PageObjects.visualize.clickBucket('Split Chart'); | ||
log.debug('Aggregation = Terms'); | ||
await PageObjects.visualize.selectAggregation('Terms'); | ||
log.debug('Field = extension'); | ||
await PageObjects.visualize.selectField('extension.raw'); | ||
|
||
await PageObjects.visualize.clickGo(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const isEnabled = await PageObjects.visualize.isSaveButtonEnabled(); | ||
expect(isEnabled).to.be(true); | ||
}); | ||
}); | ||
}); | ||
} |
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