Fix analytics test (#3936)

This commit is contained in:
cristinaj
2018-11-01 10:37:10 +02:00
committed by Eugenio Romano
parent e7ae685bb2
commit 50a93ff869

View File

@@ -34,13 +34,26 @@ var AnalyticsPage = function () {
this.changeReportTitle = function (title) { this.changeReportTitle = function (title) {
Util.waitUntilElementIsVisible(reportContainer); Util.waitUntilElementIsVisible(reportContainer);
Util.waitUntilElementIsVisible(toolbarTitleContainer); Util.waitUntilElementIsVisible(toolbarTitleContainer);
Util.waitUntilElementIsClickable(toolbarTitleContainer);
toolbarTitleContainer.click(); toolbarTitleContainer.click();
Util.waitUntilElementIsVisible(toolbarTitleInput); Util.waitUntilElementIsVisible(toolbarTitleInput);
toolbarTitleInput.clear(); toolbarTitleInput.click();
this.clearReportTitle();
toolbarTitleInput.sendKeys(title); toolbarTitleInput.sendKeys(title);
toolbarTitleInput.sendKeys(protractor.Key.ENTER); toolbarTitleInput.sendKeys(protractor.Key.ENTER);
}; };
this.clearReportTitle = function() {
Util.waitUntilElementIsVisible(toolbarTitleInput);
toolbarTitleInput.getAttribute('value').then( function (value) {
var i;
for (i = value.length; i >= 0; i--) {
toolbarTitleInput.sendKeys(protractor.Key.BACK_SPACE);
}
});
Util.waitUntilElementIsVisible(toolbarTitleInput);
}
this.getReportTitle = function () { this.getReportTitle = function () {
Util.waitUntilElementIsVisible(toolbarTitle); Util.waitUntilElementIsVisible(toolbarTitle);
return toolbarTitle.getText(); return toolbarTitle.getText();