-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathUiBuilderGrid.java
More file actions
72 lines (57 loc) · 2.58 KB
/
UiBuilderGrid.java
File metadata and controls
72 lines (57 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package solutions.bellatrix.servicenow.components.uiBuilder;
import solutions.bellatrix.web.components.Button;
import solutions.bellatrix.web.components.TextInput;
import solutions.bellatrix.web.components.WebComponent;
import solutions.bellatrix.web.components.contracts.ComponentDisabled;
import solutions.bellatrix.web.components.contracts.ComponentText;
import solutions.bellatrix.web.services.ComponentCreateService;
public class UiBuilderGrid extends WebComponent implements ComponentDisabled, ComponentText {
protected WebComponent customUiNowDateInputByLabel() {
return this.shadowRootCreateByCss(WebComponent.class, "now-input");
}
protected TextInput customUiDateInputByLabel() {
return customUiNowDateInputByLabel().shadowRootCreateByCss(TextInput.class, "input");
}
protected Button customUiNowDateInputCalendarButton() {
return this.shadowRootCreateByCss(Button.class, "*[icon='calendar-outline']");
}
protected WebComponent customUiDropDownSeismicHoist() {
return create().byCss(WebComponent.class, "seismic-hoist").getShadowRoot();
}
protected Button calendarPopUpOkayButton() {
return customUiDropDownSeismicHoist().shadowRootCreateByCss(Button.class, "sn-record-control:nth-of-type(2)");
}
protected Button calendarPopUpCloseButton() {
return customUiDropDownSeismicHoist().shadowRootCreateByCss(Button.class, "sn-record-control:nth-of-type(1)");
}
protected Button calendarDateCellByAriaLabel(String ariaLabel) {
return customUiDropDownSeismicHoist().shadowRootCreateByCss(Button.class, String.format("div[aria-label*='%s']", ariaLabel));
}
@Override
public boolean isDisabled() {
return false;
}
@Override
public String getText() {
return customUiDateInputByLabel().getWrappedElement().getAttribute("value");
}
public void pickDateByPartialAriaLabel(String partialAriaLabel) {
openCalendarPopUp();
calendarDateCellByAriaLabel(partialAriaLabel).click();
calendarPopUpOkayButton().scrollToVisible();
calendarPopUpOkayButton().click();
}
public void clickOnDateCellByPartialAriaLabel(String partialAriaLabel) {
calendarDateCellByAriaLabel(partialAriaLabel).click();
}
public void openCalendarPopUp() {
customUiNowDateInputCalendarButton().click();
browserService.waitForAjax();
}
public void setText(String text) {
customUiDateInputByLabel().setText(text);
}
protected ComponentCreateService create() {
return new ComponentCreateService();
}
}