Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f0bf4487 authored by Catalin Comanici's avatar Catalin Comanici
Browse files

fixed merge conflicts

parent 6865c949
No related branches found
No related tags found
No related merge requests found
Pipeline #19825 passed with warnings
......@@ -33,7 +33,8 @@ public class DomainPopup extends PageComponent {
@FindBy(css = "#smlClientKeyAlias_id")
WebElement smlClientAliasSelectContainer;
GenericSelect smlClientAliasSelect;
@FindBy(css = "#MetadataTextArea")
private WebElement metadataTextArea;
public DomainPopup(WebDriver driver) {
super(driver);
PageFactory.initElements(new AjaxElementLocatorFactory(driver, PROPERTIES.TIMEOUT), this);
......@@ -137,6 +138,30 @@ public class DomainPopup extends PageComponent {
}
public String domainCode63CharValidationGetErrMsg() {
try {
waitForElementToBeVisible(domainCodeValidationError);
return domainCodeValidationError.getAttribute("value");
} catch (Exception e) {
}
return null;
}
public String getSmlSmpId63CharValidationMsg() {
WebElement invalidSmlSmpIdErrorMsg = driver.findElement(By.cssSelector("div.mat-form-field-infix > div.ng-star-inserted"));
try {
waitForElementToBeVisible(invalidSmlSmpIdErrorMsg);
return invalidSmlSmpIdErrorMsg.getAttribute("value");
} catch (Exception e) {
}
return null;
}
public String xmlFieldVALUE() {
log.info("value is " + metadataTextArea.getAttribute("value"));
return metadataTextArea.getAttribute("value");
}
public void clearAndFillDomainCodeInput(String domainCode) {
log.info("clear and fill domain code data");
clearAndFillInput(domainCodeInput, domainCode);
......
......@@ -176,6 +176,7 @@ public class DomainPgTest extends BaseTest {
popup.fillDataForNewDomain(rndString, rndString, rndString, rndString);
popup.waitForXMillis(1000);
popup.clickOK();
soft.assertTrue(page.isSaveButtonEnabled(), "Save button is enabled");
......@@ -505,4 +506,20 @@ public class DomainPgTest extends BaseTest {
soft.assertAll();
}
@Test(description = "USR-150")
public void verifyNoOfCharcterAllowanceLimitInDomaincodeAndSMLSMPId() {
SoftAssert soft = new SoftAssert();
DomainPage page = new DomainPage(driver);
String randstring = Generator.randomAlphaNumeric(10);
String string = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz12345678901g";
soft.assertTrue(page.isLoaded(), "Check that the page is not loaded");
DomainPopup popup = page.clickNew();
soft.assertTrue(popup.isLoaded(), "Domain popup is not loaded");
popup.fillDataForNewDomain(string, randstring, string, randstring);
soft.assertEquals(popup.domainCode63CharValidationGetErrMsg(), SMPMessages.DOMAINCODE_VALIDATION_MESSAGE, "Message is not in the list");
soft.assertEquals(popup.getSmlSmpId63CharValidationMsg(), SMPMessages.SMLSMPID_VALIDATION_MESSAGE, "Error message is not in list");
soft.assertAll();
}
}
......@@ -10,6 +10,7 @@ import pages.service_groups.ServiceGroupGrid;
import pages.service_groups.ServiceGroupRow;
import pages.service_groups.edit.*;
import utils.Generator;
import utils.enums.SMPMessages;
import utils.rest.SMPRestClient;
import java.util.List;
......@@ -436,6 +437,74 @@ public class EditPgTest extends BaseTest {
soft.assertAll();
}
@Test(description = "EDT-140")
public void serviceMetadataXMLValidationRule() {
SoftAssert soft = new SoftAssert();
EditPage page = new EditPage(driver);
String generator = Generator.randomAlphaNumeric(10);
ServiceGroupGrid grid = page.getGrid();
Integer index = 0;
ServiceGroupRowE row0 = grid.getRowsAs(ServiceGroupRowE.class).get(index);
ServiceMetadataPopup metadataPopup = row0.clickAddMetadata();
metadataPopup.fillForm(generator, generator, generator);
metadataPopup.clickValidateBtn();
soft.assertEquals(metadataPopup.getXMLValidationMessage(), SMPMessages.VALID_XML_MESSAGE, "The message is not in list");
metadataPopup.clickClearBtn();
metadataPopup.clickValidateBtn();
soft.assertEquals(metadataPopup.getXMLValidationMessage(), SMPMessages.EMPTY_XML_WARN_MESSAGE, "The message is not in list");
metadataPopup.clickGenerateXMLBtn();
String xml1 = metadataPopup.captureTextOfMetadataTextArea();
String invalidxml1 = xml1 + "xcvjdvxv";
metadataPopup.addTextToMetadataTextArea(invalidxml1);
metadataPopup.clickValidateBtn();
soft.assertEquals(metadataPopup.getXMLValidationMessage(), SMPMessages.INVALID_XML_MESSAGE3, "The message error message is not in list");
metadataPopup.clickClearBtn();
metadataPopup.addTextToMetadataTextArea("xjvnkcfjblcf");
metadataPopup.clickValidateBtn();
soft.assertEquals(metadataPopup.getXMLValidationMessage(), SMPMessages.INVALID_XML_MESSAGE2, "The message error message is not in list");
metadataPopup.clickClearBtn();
soft.assertAll();
}
@Test(description = "EDT-150")
public void verifyServiceMetadataXMLClearBtn() {
SoftAssert soft = new SoftAssert();
EditPage page = new EditPage(driver);
String generator = Generator.randomAlphaNumeric(10);
ServiceGroupGrid grid = page.getGrid();
Integer index = 0;
ServiceGroupRowE row0 = grid.getRowsAs(ServiceGroupRowE.class).get(index);
ServiceMetadataPopup metadataPopup = row0.clickAddMetadata();
metadataPopup.fillForm(generator, generator, generator);
soft.assertNotEquals(metadataPopup.xmlFieldVALUE(), "", "The xml field area is empty");
metadataPopup.clickClearBtn();
soft.assertEquals(metadataPopup.xmlFieldVALUE(), "", "The clear button did not clear the xml field");
soft.assertAll();
}
@Test(description = "EDT-160")
public void verifyServiceMetadataWizardOkBtn() {
SoftAssert soft = new SoftAssert();
EditPage page = new EditPage(driver);
String generator = Generator.randomAlphaNumeric(10);
ServiceGroupGrid grid = page.getGrid();
int index = 0;
ServiceGroupRowE row0 = grid.getRowsAs(ServiceGroupRowE.class).get(index);
ServiceMetadataPopup metadataPopup = row0.clickAddMetadata();
ServiceMetadataWizardPopup metadataWizard = metadataPopup.clickMetadataWizard();
soft.assertTrue(!metadataPopup.isParticipantIdentifierEnabled(), "participantId field is enabled for an existing service group in service metadata popup");
soft.assertTrue(!metadataPopup.isParticipantSchemeEnabled(), "participantScheme field is enabled for an existing service group in service metadata popup");
soft.assertFalse(metadataWizard.isEnableOkBtn(), "OK button is enable before providing the valid data");
metadataWizard.fillForm(generator, generator, generator, generator, "bdxr-transport-ebms3-as4-v1p0", "internal/rest/domain");
metadataWizard.fillCerificateBox(generator);
soft.assertTrue(metadataWizard.isEnableOkBtn(), "OK button is disable after providing the valid data");
soft.assertAll();
}
private int scrollToSG(String pi) {
EditPage page = new EditPage(driver);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment