[ACA-1800] add tests for unsure file (#734)

small other changes
This commit is contained in:
Adina Parpalita
2018-10-18 20:32:46 +03:00
committed by Denys Vuika
parent 4536c43c9f
commit 3bf9cc1fb2
7 changed files with 946 additions and 112 deletions

View File

@@ -33,14 +33,16 @@ export class ConfirmDialog extends Component {
title: '.mat-dialog-title',
content: '.mat-dialog-content',
delete: 'adf-confirm-accept',
keep: 'adf-confirm-cancel'
accept: 'adf-confirm-accept',
cancel: 'adf-confirm-cancel',
actionButton: 'adf-confirm'
};
title: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.title));
content: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.content));
deleteButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.delete));
keepButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.keep));
acceptButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.accept));
cancelButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.cancel));
actionButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.actionButton));
constructor(ancestor?: ElementFinder) {
super(ConfirmDialog.selectors.root, ancestor);
@@ -50,6 +52,14 @@ export class ConfirmDialog extends Component {
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
}
async waitForDialogToOpen() {
await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT);
}
async isDialogOpen() {
return await browser.isElementPresent(by.css(ConfirmDialog.selectors.root));
}
async getTitle() {
return await this.title.getText();
}
@@ -58,12 +68,17 @@ export class ConfirmDialog extends Component {
return await this.content.getText();
}
async clickDelete() {
await this.deleteButton.click();
getButtonByName(name: string) {
return this.component.element(by.buttonText(name));
}
async clickKeep() {
await this.keepButton.click();
await this.waitForDialogToClose();
async clickButton(name: string) {
const button = this.getButtonByName(name);
await button.click();
}
async isButtonEnabled(name: string) {
const button = this.getButtonByName(name);
return await button.isEnabled();
}
}

View File

@@ -111,11 +111,16 @@ export class ShareDialog extends Component {
return this.expireInput;
}
async isShareToggleEnabled() {
async isShareToggleChecked() {
const toggleClass = await this.getShareToggle().getAttribute('class');
return toggleClass.includes('checked');
}
async isShareToggleEnabled() {
const toggleClass = await this.getShareToggle().getAttribute('class');
return toggleClass.includes('mat-disabled');
}
async isExpireToggleEnabled() {
const toggleClass = await this.getExpireToggle().getAttribute('class');
return toggleClass.includes('checked');
@@ -143,4 +148,7 @@ export class ShareDialog extends Component {
await this.expireToggle.click();
}
async clickShareToggle() {
await this.shareToggle.click();
}
}