Skip to content

Commit 1af59bf

Browse files
Subscription GUI: added AND & ARE between requirements and conditions (#69)
* Added AND & ARE between conditions and requirements
1 parent 710fbae commit 1af59bf

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

src/functionaltest/java/com/ericsson/ei/frontend/SubscriptionHandlingFunctionality.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,29 +204,31 @@ public void testSubscription() throws Exception {
204204
String requirementFieldID = "requirementID";
205205

206206
subscriptionPage.selectDropdown(selectAuthID, authValue);
207-
208207
subscriptionPage.addFieldValue(userNameID, userName);
209208
subscriptionPage.addFieldValue(tokenID, token);
210209
String kvID = "kvID";
211-
subscriptionPage.clickKVbtn(kvID);
210+
subscriptionPage.clickKVbtn(kvID);
212211
assert (new WebDriverWait(driver, 10).until((webdriver) -> driver.getPageSource().contains("Authorization")));
213-
214-
// Test "Repeat" dropdown: Select repeat value as "true" and then verify
215-
// the selected value
212+
213+
// Test "Repeat" dropdown: Select repeat value as "true" and then verify the selected value
216214
subscriptionPage.selectDropdown(selectRepeatID, repeatValue);
217215
assert (new WebDriverWait(driver, 10)
218-
.until((webdriver) -> (subscriptionPage.getValueFromSelectRepeat().equals(repeatValue))));
219-
220-
// Test "Add Condition" button: click add condition button and check
221-
// that it adds an additional "condition" field
216+
.until((webdriver) -> (subscriptionPage.getValueFromSelectRepeat().equals(repeatValue))));
217+
218+
// Test "Add Condition" button: click add condition button and check that it adds an additional "condition" field
222219
subscriptionPage.clickAddConditionBtn();
223220
assertEquals(2, subscriptionPage.countElements(conditionFieldID));
224-
225-
// Test "Add Requirement" button: click the button and assert that it
226-
// adds an additional "requirement" field
221+
222+
// Test "Add Requirement" button: click the button and assert that it adds an additional "requirement" field
227223
subscriptionPage.clickAddRequirementBtn();
228224
assertEquals(2, subscriptionPage.countElements(requirementFieldID));
229225

226+
// Test "Repeat" dropdown: Select repeat value as "true" and then verify
227+
// the selected value
228+
subscriptionPage.selectDropdown(selectRepeatID, repeatValue);
229+
assert (new WebDriverWait(driver, 10)
230+
.until((webdriver) -> (subscriptionPage.getValueFromSelectRepeat().equals(repeatValue))));
231+
230232
// Test save subscription form: add subscription name
231233
// as "selenium_test_subscription" and then click "save" button
232234
// verification that subscription is added in the datatable (and is
@@ -235,6 +237,5 @@ public void testSubscription() throws Exception {
235237
subscriptionPage.addFieldValue(subNameID, subName);
236238
subscriptionPage.clickFormsSaveBtn(responseSave);
237239
assert (subscriptionPage.textExistsInTable("Selenium_test_subscription"));
238-
239240
}
240241
}

src/main/resources/templates/subscription.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,23 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
249249

250250
<!-- ko foreach: { data: requirements, as: 'requirements_item' } -->
251251
<div class="pl-0 ml-0">
252+
<!-- ko if: $index() !== 0 -->
253+
<h5>OR</h5>
254+
<!-- /ko -->
252255
<img data-toggle="tooltip" data-placement="top" width="16" alt="Information" src="assets/images/information.png" title="Info: 'AND' is used between Conditions in Requirement groups, and 'OR' is used between Requirement groups"
253256
/>
254257
</div>
255-
<div class="p-1 border border-primary form-group">
258+
<div class="p-1 border border-primary form-group">
256259
<label class="control-label font-weight-bold">Requirement</label>
257260
<div id="requirementID">
258261

259262
<!-- ko foreach: requirements_item.conditions -->
260263
<div id="conditionID">
261-
<label class="control-label font-weight-bold">Condition</label>
264+
<!-- ko if: $index() !== 0 -->
265+
<h5 style="display:inline">AND</h5>
266+
<!-- /ko -->
267+
268+
<label style="display:inline" class="control-label font-weight-bold">Condition</label>
262269
<textarea data-toggle="tooltip" title="Write a Subscription Rule(JmePath)" data-bind="textInput:$data.jmespath()" name="jmespath"
263270
placeholder="jmespath" class="form-control" type="text"></textarea>
264271
<div class="pt-1 d-flex justify-content-end">

0 commit comments

Comments
 (0)