-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #7332 - saving vis with % in name causes error #7701
Changes from 4 commits
db32541
25d34d0
ef372ca
721d3bc
a484283
2f4e5aa
30fcbb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,31 @@ bdd.describe('visualize app', function describeIndexTests() { | |
bdd.describe('area charts', function indexPatternCreation() { | ||
var vizName1 = 'Visualization AreaChart'; | ||
|
||
bdd.it('should save and load with special characters', function pageHeader() { | ||
let vizName2 = vizName1 + '/?&=%'; | ||
return PageObjects.visualize.saveVisualization(vizName2) | ||
.then(function (message) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment, our style guide recommends putting chained methods at the same indentation level as the first line in the chain https://github.com/elastic/kibana/blob/master/style_guides/js_style_guide.md#chaining-operations. |
||
PageObjects.common.debug('Saved viz message = ' + message); | ||
PageObjects.common.saveScreenshot('Visualize-area-chart-save-toast'); | ||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName2 + '\"'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you might be able to use string interpolation in these tests now? |
||
}) | ||
.then(function testVisualizeWaitForToastMessageGone() { | ||
return PageObjects.visualize.waitForToastMessageGone(); | ||
}) | ||
.then(function loadSavedVisualization() { | ||
return PageObjects.visualize.loadSavedVisualization(vizName2); | ||
}) | ||
.then(function () { | ||
return PageObjects.visualize.waitForVisualization(); | ||
}) | ||
// We have to sleep sometime between loading the saved visTitle | ||
// and trying to access the chart below with getXAxisLabels | ||
// otherwise it hangs. | ||
.then(function sleep() { | ||
return PageObjects.common.sleep(2000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there's really any reason to wait for the toast message, load the viz and wait for it if we're not running assertions on it. I think the only reason the test below does so is to set things up for the test that follows it. |
||
}); | ||
}); | ||
|
||
bdd.it('should save and load', function pageHeader() { | ||
return PageObjects.visualize.saveVisualization(vizName1) | ||
.then(function (message) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer const over let. Also maybe a more descriptive variable name, like vizNameWithSpecialChars?