Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Select Git revision
  • 8071cebb37f7410cbb574e9a22c3865f78276dc1
  • tug-dev default
  • amdm3/develop
  • fix/scripts1
  • amdm2/develop
  • amdm2/main
  • playground
  • feat/changelog
  • fix/solution_tests
  • test/full_release_process
  • test/art10_test_execution
  • test/gitlab_files_api
  • test/multiplatform_david
  • trgbot
  • set-sast-config-3
  • set-sast-config-2
  • set-secret-detection-config-2
  • set-secret-detection-config-1
  • set-sast-config-1
  • test-linux-fixes
  • tug-stable
  • Release/v4.3.2
  • v1.0.1
  • v1.0.0
  • Build/v0.7.10.2996
  • v0.7.5b0+2524.multistep
  • Release/v3.3.14.2981-RC
  • Build/v0.7.9.2975
  • Release/v3.3.13.2924
  • Release/v3.3.13.2891-RC
  • Build/0.7.9.2890
  • Build/v0.7.9.2864
  • Build/v0.7.9.2849
  • Build/v0.7.9.2836
  • Release/TrailerTool_V0.9.0.2759
  • Release/TrailerTool_V0.9.0.2735
  • Release/TrailerTool_V0.9.0.2799
  • Release/v3.3.12.2800
  • Release/v3.3.12.2769-RC
  • Build/v0.7.9.2741
  • Build/v0.5.0.1812_VectoFF
41 results

README.md

Blame
  • Forked from VECTO / VECTO Sim
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    TrustorePgTests.java 3.04 KiB
    package domiSMPTests.ui;
    
    import ddsl.DomiSMPPage;
    import ddsl.enums.Pages;
    import domiSMPTests.SeleniumTest;
    import org.testng.annotations.Test;
    import org.testng.asserts.SoftAssert;
    import pages.LoginPage;
    import pages.systemSettings.TruststorePage;
    import utils.FileUtils;
    
    public class TrustorePgTests extends SeleniumTest {
    
    
        @Test(description = "TRST-01 System admin is able to import certificates")
        public void systemAdminIsAbleToImportCertificates() throws Exception {
    
            SoftAssert soft = new SoftAssert();
            DomiSMPPage homePage = new DomiSMPPage(driver);
    
            LoginPage loginPage = homePage.goToLoginPage();
            loginPage.login(data.getAdminUser().get("username"), data.getAdminUser().get("password"));
    
            TruststorePage truststorepage = homePage.getSidebar().navigateTo(Pages.SYSTEM_SETTINGS_TRUSTSTORE);
            String path = FileUtils.getAbsolutePath("./src/main/resources/truststore/validCertificate.cer");
    
            String certificateALias = truststorepage.addCertificateAndReturnAlias(path);
            soft.assertNotNull(certificateALias);
            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");
            // TODO: set date validation Locale independent. Currently it fails when CEST and CET changes
            //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 certificates")
        public void systemAdminIsAbleToImportDuplicatedCertificates() throws Exception {
    
            SoftAssert soft = new SoftAssert();
            DomiSMPPage homePage = new DomiSMPPage(driver);
    
            LoginPage loginPage = homePage.goToLoginPage();
            loginPage.login(data.getAdminUser().get("username"), data.getAdminUser().get("password"));
    
            TruststorePage truststorepage = homePage.getSidebar().navigateTo(Pages.SYSTEM_SETTINGS_TRUSTSTORE);
            String path = FileUtils.getAbsolutePath("./src/main/resources/truststore/validCertificate.cer");
    
            String certificateALias = truststorepage.addCertificateAndReturnAlias(path);
            soft.assertTrue(truststorepage.getLeftSideGrid().isValuePresentInColumn("Alias", certificateALias));
            soft.assertNotNull(certificateALias);
    
            String duplicatedCertificateALias = truststorepage.addCertificateAndReturnAlias(path);
            soft.assertNotNull(duplicatedCertificateALias);
            soft.assertTrue(truststorepage.getLeftSideGrid().isValuePresentInColumn("Alias", duplicatedCertificateALias));
            soft.assertAll();
    
        }
    
    }