Skip to content

Commit 8129fc2

Browse files
EliNedyalkovaEliNedyalkova
authored andcommitted
refactoring bellatrix.servicenow
update getting-started\bellatrix.servicenow
1 parent 242f9b1 commit 8129fc2

File tree

17 files changed

+28
-28
lines changed

17 files changed

+28
-28
lines changed

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/components/serviceNow/SnDate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public String getText() {
2828
}
2929

3030
public void setText(LocalDate localDate) {
31-
var dateTimeFormat = calendarButton().getAttribute("models-date_time_format");
31+
var dateTimeFormat = calendarButton().getAttribute("data-date_time_format");
3232
var dateAsString = DateTimeFormatter.ofPattern(dateTimeFormat).format(localDate);
3333

3434
setText(dateAsString);

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/components/serviceNow/SnDateTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public String getText() {
2828
}
2929

3030
public void setText(LocalDateTime localDateTime) {
31-
var dateTimeFormat = calendarButton().getAttribute("models-date_time_format");
31+
var dateTimeFormat = calendarButton().getAttribute("data-date_time_format");
3232
var dateAsString = DateTimeFormatter.ofPattern(dateTimeFormat).format(localDateTime);
3333

3434
setText(dateAsString);

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/components/serviceNow/SnDefaultComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void validateIsDisabled(boolean isDisabled) {
110110
}
111111

112112
public String getType() {
113-
var xpathLocator = ".//div[@models-type='label']";
113+
var xpathLocator = ".//div[@data-type='label']";
114114
return this.createByXPath(Span.class, xpathLocator).getWrappedElement().getAttribute("type");
115115
}
116116

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/components/serviceNow/SnGlideTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public String getText() {
2828
}
2929

3030
public void setText(LocalDateTime localDateTime) {
31-
var dateTimeFormat = calendarButton().getAttribute("models-date_time_format");
31+
var dateTimeFormat = calendarButton().getAttribute("data-date_time_format");
3232
var dateAsString = DateTimeFormatter.ofPattern(dateTimeFormat).format(localDateTime);
3333

3434
setText(dateAsString);

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/components/uiBuilder/UIBDefaultComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void validateIsDisabled(boolean isDisabled) {
118118
}
119119

120120
public String getType() {
121-
var xpathLocator = ".//div[@models-type='label']";
121+
var xpathLocator = ".//div[@data-type='label']";
122122
return this.createByXPath(Span.class, xpathLocator).getWrappedElement().getAttribute("type");
123123
}
124124

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/infrastructure/core/repositories/CurlLoggingFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private List<String> generateCurl(FilterableRequestSpecification requestSpec) {
3737
curlParts.add("--header '%s: %s' \\".formatted(header.getName(), header.getValue()));
3838
}
3939
if (body != null && !body.isEmpty()) {
40-
curlParts.add("--models '" + body.replace("'", "'\"'\"'") + "'");
40+
curlParts.add("--data '" + body.replace("'", "'\"'\"'") + "'");
4141
}
4242
return curlParts;
4343
}

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/models/enums/SnFormFieldType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
public enum SnFormFieldType {
99
INPUT("input", TextInput.class, "(//div[contains(@class,'form-group') and .//span[text()='%s']]//input[not(@type='hidden')])[1]"),
10-
TEXTAREA("textarea", TextArea.class, "//div[@models-type='label' and .//span[text()='%s']]/following-sibling::div/textarea"),
11-
SELECT("select", Select.class, "//div[@models-type='label' and .//span[text()='%s']]/following-sibling::div/select");
10+
TEXTAREA("textarea", TextArea.class, "//div[@data-type='label' and .//span[text()='%s']]/following-sibling::div/textarea"),
11+
SELECT("select", Select.class, "//div[@data-type='label' and .//span[text()='%s']]/following-sibling::div/select");
1212

1313
private final String value;
1414
private final Class componentClass;

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/pages/baseServiceNowRecordViewPage/Map.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ public Button selectFormInput(String element, String fieldName) {
3939
}
4040

4141
public Select selectFormInput(String label) {
42-
var locator = String.format("//div[@models-type='label' and .//span[text()='%s']]/following-sibling::div/select", label);
42+
var locator = String.format("//div[@data-type='label' and .//span[text()='%s']]/following-sibling::div/select", label);
4343
return create().byXPath(Select.class, locator);
4444
}
4545

4646
public Anchor cellByTableAndText(String tableName, String cellText) {
47-
var locator = String.format("//caption[contains(@models-read-label,'%s')]//following-sibling::tbody[contains(@class,'list2_body')]//td/descendant-or-self::*[text()='%s']", tableName, cellText);
47+
var locator = String.format("//caption[contains(@data-read-label,'%s')]//following-sibling::tbody[contains(@class,'list2_body')]//td/descendant-or-self::*[text()='%s']", tableName, cellText);
4848
return create().byXPath(Anchor.class, locator);
4949
}
5050

5151
public Button buttonByTitle(String title) {
52-
var xpath = String.format("//button[@models-original-title='%s']", title);
52+
var xpath = String.format("//button[@data-original-title='%s']", title);
5353
return create().byXPath(Button.class, xpath);
5454
}
5555

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/pages/baseUiBuilderPage/Map.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Button selectButton(String label) {
6767
}
6868

6969
public Button recordSaveButton() {
70-
var xpathLocator = "(//div[./now-record-common-record-presence]//button[@models-ariadescribedby='Save'])[1]";
70+
var xpathLocator = "(//div[./now-record-common-record-presence]//button[@data-ariadescribedby='Save'])[1]";
7171
return customUiMainMacroponent().createByXPath(Button.class, xpathLocator);
7272
}
7373

bellatrix.servicenow/src/main/java/solutions/bellatrix/servicenow/pages/sections/availableSelectPopUpSection/Map.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public Button rolesOkButton() {
1616
}
1717

1818
public Button arrowAddButton() {
19-
return create().byXPath(Button.class, "//a[@models-original-title='Add']");
19+
return create().byXPath(Button.class, "//a[@data-original-title='Add']");
2020
}
2121
}

0 commit comments

Comments
 (0)