Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit bd862658 authored by Mihai BOZ's avatar Mihai BOZ Committed by Mihai BOZ
Browse files

resolved PR comments

parent 9fa10d30
No related branches found
No related tags found
No related merge requests found
Pipeline #104188 passed with warnings
Showing
with 62 additions and 59 deletions
......@@ -4,7 +4,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class CommonCertificatePage extends CommonPageWithGrid {
public class CommonCertificatePage extends CommonPageWithTabsAndGrid {
/**
* Common page used for Keystore and Truststore
*/
......
......@@ -89,7 +89,8 @@ public class DomiSMPPage extends DComponent {
public boolean isExpiredDialoginbuttonEnabled() {
try {
return dialogOKbutton.isEnabled();
return weToDButton(dialogOKbutton).isPresent();
// return dialogOKbutton.isEnabled();
} catch (Exception e) {
LOG.info("Expiration poup not found", e);
return false;
......
......@@ -43,8 +43,8 @@ public class SetChangePasswordDialog extends DComponent {
}
public DomiSMPPage TryClickOnChangePassword(){
wait.forElementToBeClickable(setPasswordBtn);
if (weToDButton(setPasswordBtn).isEnabled() && fieldsError.isEmpty()) {
//wait.forElementToBeClickable(setPasswordBtn);
if (weToDButton(setPasswordBtn).isEnabled()) {
weToDButton(setPasswordBtn).click();
SuccesfullPasswordChangedPopup popup = new SuccesfullPasswordChangedPopup(driver);
popup.closePopup();
......
......@@ -40,13 +40,11 @@ public class LoginPage extends DomiSMPPage {
weToDButton(loginBtn).click();
try {
if (isExpiredDialoginbuttonEnabled()) {
if (getBreadcrump().getCurrentPage().equals("Login")) {
getExpiredDialoginbutton().click();
}
} catch (Exception e) {
LOG.debug("Password expiration popup is not present");
throw new RuntimeException("Password expiration popup is not present", e);
}
......
......@@ -42,6 +42,7 @@ public class DomainTab extends DComponent {
public void fillDomainData(DomainModel domainModel) {
domainIdInput.sendKeys(domainModel.getDomainCode());
weToDSelect(responseSignatureCertificateDdl).selectByVisibleText(domainModel.getSignatureKeyAlias(), true);
weToDSelect(visibilityOfDomainDdl).selectValue(domainModel.getVisibility());
}
......
......@@ -43,7 +43,7 @@ public class SMLIntegrationTab extends DComponent {
weToDInput(smlDomainInput).fill(domainModel.getSmlSubdomain());
weToDInput(smlsmpIdentifierInput).fill(domainModel.getSmlSmpId());
//TODO : check of clientcertificatealias is changed from mat-select to select
weToDSelect(smlClientCertificateAliasDdl).selectByVisibleText(domainModel.getSignatureKeyAlias());
weToDSelect(smlClientCertificateAliasDdl).selectByVisibleText(domainModel.getSignatureKeyAlias(), true);
weToDButton(useClientCertBtn).click();
} catch (Exception e) {
......
......@@ -35,9 +35,11 @@ public class PropertiesPage extends DomiSMPPage {
return new PropGrid(driver, propertyTableContainer);
}
//TODO: property grid is not loaded yet when the search is done. Maybe we can improve the application
public void propertySearch(String propertyname) {
LOG.info("Search for property");
wait.forElementToBeVisible(searchPropertyField).sendKeys(propertyname);
wait.forXMillis(500);
wait.forElementToBeClickable(searchBtn).click();
wait.forXMillis(500);
}
......
......@@ -39,7 +39,7 @@ public class DomainModel {
domainModel.smlClientCertAuth = true;
domainModel.smlSubdomain = "AUTDomSML" + Generator.randomAlphaNumeric(6);
domainModel.smlSmpId = "AUTSMLSMP" + Generator.randomAlphaNumeric(4);
domainModel.smlClientKeyAlias = Utils.randomEnum(new ResponseCertificates[]{SMP_DOMAIN_01, SMP_DOMAIN_02}).getName();
domainModel.smlClientKeyAlias = Utils.randomEnum(new ResponseCertificates[]{SMP_DOMAIN_01, SMP_DOMAIN_02}).toString().toLowerCase();
return domainModel;
}
......
......@@ -123,7 +123,7 @@ public class UserModel {
userModel.emailAddress = "AUT_email_" + Generator.randomAlphaNumeric(4) + "@automation.com";
userModel.fullName = "AUT_fullname_" + Generator.randomAlphaNumeric(4);
userModel.smpTheme = SMPThemes.getRandomTheme();
userModel.smpLocale = "Dutch";
userModel.smpLocale = "English";
return userModel;
}
......
......@@ -220,7 +220,7 @@ public class TestRunData {
public String getPropertyValue(TestEnvironmentProperty propertyName) {
String value = System.getProperty(propertyName.getPropertyName(), prop.getProperty(propertyName.getPropertyName(), propertyName.getDefaultValue()));
LOG.debug("Get Property [{}] value: [{}]", propertyName.getPropertyName(), value);
// LOG.debug("Get Property [{}] value: [{}]", propertyName.getPropertyName(), value);
return value;
}
......
File deleted
File added
......@@ -40,49 +40,57 @@ public class KeystorePgTests extends SeleniumTest {
@Test(description = "KEYS-02 System admin is able to import JKS Keystore", priority = 0)
public void systemAdminIsAbleToImportJKS() throws Exception {
String path = FileUtils.getAbsoluteKeystorePath("expired_keystore_JKS.jks");
String path = FileUtils.getAbsoluteKeystorePath("valid_keystore.jks");
KeyStoreImportDialog keyStoreImportDialog = keystorePage.clickImportkeyStoreBtn();
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "test1234");
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "test123");
keyStoreImportDialog.clickImport();
String value = keystorePage.getAlertArea().getAlertMessage();
String value = keystorePage.getAlertArea().getAlertMessage();
String alias = Utils.getAliasFromMessage(value);
keystorePage.getGrid().searchAndClickElementInColumn("Alias", alias);
soft.assertEquals(keystorePage.getPublicKeyTypeValue(),"RSA");
soft.assertEquals(keystorePage.getSmpCertificateIdValue(), "CN=blue_gw,O=edelivery,C=BE:00000000645901cb");
soft.assertEquals(keystorePage.getSubjectNameValue(),"CN=blue_gw,O=edelivery,C=BE" );
soft.assertEquals(keystorePage.getValidFromValue(),"5/8/2023, 5:06:03 PM");
soft.assertEquals(keystorePage.getValidToValue(), "5/1/2023, 5:06:03 PM");
soft.assertEquals(keystorePage.getIssuerValue(), "CN=blue_gw,O=edelivery,C=BE");
soft.assertEquals(keystorePage.getSerialNumberValue(),"645901cb");
keystorePage.getLeftSideGrid().searchAndClickElementInColumn("Alias", alias);
soft.assertEquals(keystorePage.getPublicKeyTypeValue(), "RSA");
soft.assertEquals(keystorePage.getSmpCertificateIdValue(), "CN=blue_gw,O=eDelivery,C=BE:e07b6b956330a19a");
soft.assertEquals(keystorePage.getSubjectNameValue(), "C=BE,O=eDelivery,CN=blue_gw");
soft.assertEquals(keystorePage.getValidFromValue(), "9/14/2017, 10:27:39 AM");
soft.assertEquals(keystorePage.getValidToValue(), "12/1/2025, 9:27:39 AM");
soft.assertEquals(keystorePage.getIssuerValue(), "C=BE,O=eDelivery,CN=blue_gw");
soft.assertEquals(keystorePage.getSerialNumberValue(), "e07b6b956330a19a");
sofAssertThatContains("Certificates added [blue_gw", value);
soft.assertAll();
}
@Test(description = "KEYS-xx Wrong keystore type")
public void systemAdminImportFailedWithWrongKeystoreType() throws Exception {
String path = FileUtils.getAbsoluteKeystorePath("expired_keystore_JKS.jks");
@Test(description = "KEYS-03 System admin is NOT able to import keystore with wrong password", priority = 0)
public void systemAdminIsNotAbleToImportWithWrongPassword() throws Exception {
String path = FileUtils.getAbsoluteKeystorePath("valid_keystore.jks");
KeyStoreImportDialog keyStoreImportDialog = keystorePage.clickImportkeyStoreBtn();
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.PKCS12, "test1234");
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "wrongPassword");
keyStoreImportDialog.clickImport();
String value = keystorePage.getAlertArea().getAlertMessage();
String value = keystorePage.getAlertArea().getAlertMessage();
sofAssertThatContains("Error occurred while importing keystore", value);
soft.assertAll();
}
@Test(description = "KEYS-xx Wrong keystore password")
public void systemAdminImportFailedWithWrongPassword() throws Exception {
String path = FileUtils.getAbsoluteKeystorePath("expired_keystore_JKS.jks");
@Test(description = "KEYS-03 SSystem admin is able to import duplicated keystore", priority = 1)
public void systemAdminIsAbleToImportDuplicatedKeyStores() throws Exception {
String path = FileUtils.getAbsoluteKeystorePath("valid_keystore.jks");
KeyStoreImportDialog keyStoreImportDialog = keystorePage.clickImportkeyStoreBtn();
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "wrongPassword");
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "test123");
keyStoreImportDialog.clickImport();
String value = keystorePage.getAlertArea().getAlertMessage();
String alias = Utils.getAliasFromMessage(value);
soft.assertTrue(keystorePage.getLeftSideGrid().isValuePresentInColumn("Alias", alias));
keyStoreImportDialog = keystorePage.clickImportkeyStoreBtn();
keyStoreImportDialog.addCertificate(path, KeyStoreTypes.JKS, "test123");
keyStoreImportDialog.clickImport();
String duplicatedAlertMessage = keystorePage.getAlertArea().getAlertMessage();
String duplicatedAlias = Utils.getAliasFromMessage(duplicatedAlertMessage);
soft.assertTrue(keystorePage.getLeftSideGrid().isValuePresentInColumn("Alias", duplicatedAlias));
String value = keystorePage.getAlertArea().getAlertMessage();
sofAssertThatContains("Error occurred while importing keystore", value);
soft.assertAll();
}
......
......@@ -6,7 +6,6 @@ import ddsl.enums.Pages;
import domiSMPTests.SeleniumTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
import pages.LoginPage;
......@@ -139,7 +138,6 @@ public class ProfilePgTests extends SeleniumTest {
}
@Ignore
@Test(description = "PROF-04 User should be able to change his password")
public void userShouldBeAbleToChangeHisPassword() throws Exception {
UserModel adminUser = UserModel.generateUserWithADMINrole();
......@@ -163,7 +161,6 @@ public class ProfilePgTests extends SeleniumTest {
loginPage.login(adminUser.getUsername(), newPass);
profilePage = loginPage.getSidebar().navigateTo(Pages.USER_SETTINGS_PROFILE);
Assert.assertNotSame(profilePage.profileData.getLastSetValue(), oldLastSet, "Last set value is not reseted");
//TODO: passwordexpiresOn label has a different id after the value is set reason why the test is failing with not element found
Assert.assertNotSame(profilePage.profileData.getPasswordExpiresOnValue(), oldPasswordExpiresOn, "Password expires on value is not reseted");
}
}
......@@ -3,7 +3,6 @@ package domiSMPTests.ui;
import ddsl.DomiSMPPage;
import ddsl.enums.Pages;
import domiSMPTests.SeleniumTest;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
import pages.LoginPage;
......@@ -14,7 +13,7 @@ public class TrustorePgTests extends SeleniumTest {
@Test(description = "TRST-01 System admin is able to import certificates")
public void systemAdminIsAbleToImportCertificates() throws Exception {
public void SystemAdminIsAbleToImportCertificates() throws Exception {
SoftAssert soft = new SoftAssert();
DomiSMPPage homePage = new DomiSMPPage(driver);
......@@ -27,19 +26,22 @@ public class TrustorePgTests extends SeleniumTest {
String certificateALias = truststorepage.addCertificateAndReturnAlias(path);
soft.assertNotNull(certificateALias);
soft.assertEquals(truststorepage.getPublicKeyTypeLbl(), "RSA");
soft.assertEquals(truststorepage.getAliasIdLbl(), certificateALias);
soft.assertEquals(truststorepage.getSmpCertificateIdLbl(), "CN=red_gw,O=eDelivery,C=BE:00000000110fa0d8");
soft.assertEquals(truststorepage.getSubjectNameLbl(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getValidFromLbl(), "23/3/2023, 10:49:22");
soft.assertEquals(truststorepage.getValidToLbl(), "22/3/2033, 10:49:22");
soft.assertEquals(truststorepage.getIssuerLbl(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getSerialNumberLbl(), "110fa0d8");
soft.assertEquals(truststorepage.getPublicKeyTypeValue(), "RSA");
soft.assertEquals(truststorepage.getAliasIdValue(), certificateALias);
soft.assertEquals(truststorepage.getSmpCertificateIdValue(), "CN=red_gw,O=eDelivery,C=BE:00000000110fa0d8");
soft.assertEquals(truststorepage.getSubjectNameValue(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getValidFromValue(), "23/3/2023, 10:49:22");
soft.assertEquals(truststorepage.getValidToValue(), "22/3/2033, 10:49:22");
soft.assertEquals(truststorepage.getIssuerValue(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getSerialNumberValue(), "110fa0d8");
soft.assertAll();
}
@Test(description = "TRST-02 System admin is able to import duplicated certificates")
@Test(description = "TRST-02 System admin is able to import certificates")
public void systemAdminIsAbleToImportDuplicatedCertificates() throws Exception {
SoftAssert soft = new SoftAssert();
......@@ -52,22 +54,16 @@ public class TrustorePgTests extends SeleniumTest {
String path = FileUtils.getAbsolutePath("./src/main/resources/truststore/validCertificate.cer");
String certificateALias = truststorepage.addCertificateAndReturnAlias(path);
String duplicatedCertificateALias = truststorepage.addCertificateAndReturnAlias(path);
WebElement certificate = truststorepage.getCertificateGrid().searchAndGetElementInColumn("Alias", certificateALias);
soft.assertNotNull(certificate);
truststorepage.getLeftSideGrid().searchAndGetElementInColumn("Alias", duplicatedCertificateALias);
soft.assertTrue(truststorepage.getLeftSideGrid().isValuePresentInColumn("Alias", certificateALias));
soft.assertNotNull(certificateALias);
String duplicatedCertificateALias = truststorepage.addCertificateAndReturnAlias(path);
soft.assertNotNull(duplicatedCertificateALias);
soft.assertEquals(truststorepage.getPublicKeyTypeLbl(), "RSA");
soft.assertEquals(truststorepage.getAliasIdLbl(), duplicatedCertificateALias);
soft.assertEquals(truststorepage.getSmpCertificateIdLbl(), "CN=red_gw,O=eDelivery,C=BE:00000000110fa0d8");
soft.assertEquals(truststorepage.getSubjectNameLbl(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getValidFromLbl(), "23/3/2023, 10:49:22");
soft.assertEquals(truststorepage.getValidToLbl(), "22/3/2033, 10:49:22");
soft.assertEquals(truststorepage.getIssuerLbl(), "C=BE,O=eDelivery,CN=red_gw");
soft.assertEquals(truststorepage.getSerialNumberLbl(), "110fa0d8");
soft.assertTrue(truststorepage.getLeftSideGrid().isValuePresentInColumn("Alias", duplicatedCertificateALias));
soft.assertAll();
}
}
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