---------

**Commit 1:**
Fix functional tests for Share UI.

* Original sha: 2fb22ed124
* Authored by CJ Cenizal <cj@cenizal.com> on 2016-09-14T01:38:38Z
This commit is contained in:
Elastic Jasper 2016-09-14 16:58:48 -04:00
parent def3653cfa
commit bc43b2acfa
3 changed files with 14 additions and 14 deletions

View file

@ -2,7 +2,10 @@
<!-- Left panel -->
<div class="share-panel share-panel--left">
<!-- Title -->
<div class="share-panel__title">
<div
data-test-subj="shareUiTitle"
class="share-panel__title"
>
Share saved {{share.objectType}}
</div>
@ -146,6 +149,7 @@
</div>
<div class="share-panel-header__actions">
<a
data-test-subj="sharedSnapshotShortUrlButton"
class="share-panel-header__action"
ng-if="!share.urlFlags.shortSnapshot"
ng-click="share.toggleShortSnapshotUrl()"
@ -162,6 +166,7 @@
</a>
<a
data-test-subj="sharedSnapshotCopyButton"
class="share-panel-header__action"
ng-click="share.copyToClipboard('#snapshotUrl')"
>
@ -172,6 +177,7 @@
<!-- Input -->
<input
data-test-subj="sharedSnapshotUrl"
id="snapshotUrl"
class="share-panel-input"
type="text"

View file

@ -52,14 +52,14 @@ bdd.describe('shared links', function describeIndexTests() {
bdd.describe('shared link', function () {
bdd.it('should show "Share a link" caption', function () {
var expectedCaption = 'Share a link';
var expectedCaption = 'Share saved';
return PageObjects.discover.clickShare()
.then(function () {
PageObjects.common.saveScreenshot('Discover-share-link');
return PageObjects.discover.getShareCaption();
})
.then(function (actualCaption) {
expect(actualCaption).to.be(expectedCaption);
expect(actualCaption).to.contain(expectedCaption);
});
});
@ -100,7 +100,7 @@ bdd.describe('shared links', function describeIndexTests() {
.then(function () {
return PageObjects.common.try(function tryingForTime() {
PageObjects.common.saveScreenshot('Discover-shorten-url-button');
return PageObjects.discover.getShortenedUrl()
return PageObjects.discover.getSharedUrl()
.then(function (actualUrl) {
expect(actualUrl).to.match(re);
});

View file

@ -202,31 +202,25 @@ export default class DiscoverPage {
clickShortenUrl() {
return this.findTimeout
.findByCssSelector('button.shorten-button')
.findByCssSelector('[data-test-subj="sharedSnapshotShortUrlButton"]')
.click();
}
clickCopyToClipboard() {
return this.findTimeout
.findDisplayedByCssSelector('button.clipboard-button')
.findByCssSelector('[data-test-subj="sharedSnapshotCopyButton"]')
.click();
}
getShareCaption() {
return this.findTimeout
.findByCssSelector('.vis-share label')
.findByCssSelector('[data-test-subj="shareUiTitle"]')
.getVisibleText();
}
getSharedUrl() {
return this.findTimeout
.findByCssSelector('.url')
.getProperty('value');
}
getShortenedUrl() {
return this.findTimeout
.findByCssSelector('.url')
.findByCssSelector('[data-test-subj="sharedSnapshotUrl"]')
.getProperty('value');
}