[ADF-5463] Rework Protractor tests - changes related to element/element… (#7284)

* ADF-5463 Rework Protractor tests - changes related to element/elements and duplication of locators

* Fix one which I missed

* Remove console.logs

* Remove console.logs

* Reverse the timeouts

* Fixed things TSLint

* Remove unused import

* Fixed broken tests

* Last test fixed
This commit is contained in:
MichalFidor
2021-10-08 17:28:37 +02:00
committed by GitHub
parent db6a638a2d
commit 1e62b46060
156 changed files with 1653 additions and 1647 deletions

View File

@@ -16,15 +16,15 @@
*/
import { TogglePage } from '@alfresco/adf-testing';
import { element, by } from 'protractor';
import { $ } from 'protractor';
export class AppSettingsTogglesPage {
togglePage = new TogglePage();
showDetailsHeaderToggle = element(by.id('adf-show-header'));
showTaskFilterIconsToggle = element(by.id('adf-show-task-filter-icon'));
showProcessFilterIconsToggle = element(by.id('adf-show-process-filter-icon'));
showDetailsHeaderToggle = $('#adf-show-header');
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
async enableShowHeader(): Promise<void> {
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);

View File

@@ -15,15 +15,15 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { $ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class ChecklistDialog {
nameField = element(by.css('input[data-automation-id="checklist-name"]'));
addChecklistButton = element(by.css('button[id="add-check"] span'));
closeButton = element(by.css('button[id="close-check-dialog"] span'));
dialogTitle = element(by.id('add-checklist-title'));
nameField = $('input[data-automation-id="checklist-name"]');
addChecklistButton = $('button[id="add-check"] span');
closeButton = $('button[id="close-check-dialog"] span');
dialogTitle = $('#add-checklist-title');
async addName(name: string): Promise<void> {
await BrowserActions.clearSendKeys(this.nameField, name);

View File

@@ -15,20 +15,20 @@
* limitations under the License.
*/
import { element, by, Key, ElementFinder } from 'protractor';
import { element, by, Key, ElementFinder, $ } from 'protractor';
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
export class StartTaskDialogPage {
name = element(by.css('input[id="name_id"]'));
dueDate = element(by.css('input[id="date_id"]'));
description = element(by.css('textarea[id="description_id"]'));
assignee = element(by.css('div#people-widget-content input'));
startButton = element(by.css('button[id="button-start"]'));
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
cancelButton = element(by.css('button[id="button-cancel"]'));
name = $('input[id="name_id"]');
dueDate = $('input[id="date_id"]');
description = $('textarea[id="description_id"]');
assignee = $('div#people-widget-content input');
startButton = $('button[id="button-start"]');
startButtonEnabled = $('button[id="button-start"]:not(disabled)');
cancelButton = $('button[id="button-cancel"]');
selectFormDropdown = new DropdownPage(element(by.css('mat-select[id="form_id"]')));
selectFormDropdown = new DropdownPage($('mat-select[id="form_id"]'));
selectAssigneeDropdown = new DropdownPage();
async addName(userName: string): Promise<void> {
@@ -74,7 +74,7 @@ export class StartTaskDialogPage {
}
async checkStartButtonIsDisabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('button[id="button-start"]:disabled')));
await BrowserVisibility.waitUntilElementIsVisible($('button[id="button-start"]:disabled'));
}
async clickCancelButton(): Promise<void> {