From d2b664353d2629479a61228182865b9aabaf27aa Mon Sep 17 00:00:00 2001 From: leleOFA Date: Thu, 18 Apr 2024 09:56:19 +0200 Subject: [PATCH 1/6] create new logic for create test --- .../mittente/NotificaMittentePagoPATest.java | 63 ++++++++++++++++++- .../InvioNotificaConSequence.feature | 27 ++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature diff --git a/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java b/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java index e95ad258f..09251bab5 100644 --- a/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java +++ b/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java @@ -166,6 +166,64 @@ public void nellaSectionInformazioniPreliminariInserireIDatiDellaNotificaSenzaPa informazioniPreliminariPASection.selectRaccomandataAR(); } + @And("Creazione notifica completa") + public void creazioneNotificaCompleta(Map datiNotificaMap) { + logger.info("Inserimento dei dati della notifica senza pagamento " ); + AllegatiPASection allegatiPASection = new AllegatiPASection(driver); + File notificaFile = new File("src/test/resources/notifichePdf/notifica.pdf"); + datiNotifica = dataPopulation.readDataPopulation(datiNotificaMap.get("nomeFileYaml") + ".yaml"); + + aggiornamentoNumeroProtocollo(); + + String gruppo = ""; + switch (variabileAmbiente) { + case "dev" -> gruppo = datiNotificaMap.get("gruppoDev"); + case "test", "uat" -> gruppo = datiNotificaMap.get("gruppoTest"); + } + + //Sezione preliminare + informazioniPreliminariPASection.insertOggettoNotifica(datiNotificaMap.get("oggettoDellaNotifica")); + informazioniPreliminariPASection.insertDescrizione(datiNotificaMap.get("descrizione")); + informazioniPreliminariPASection.insertNumeroDiProtocollo(datiNotifica.get("numeroProtocollo").toString()); + informazioniPreliminariPASection.insertGruppo(gruppo); + informazioniPreliminariPASection.insertCodiceTassonometrico(datiNotificaMap.get("codiceTassonometrico")); + informazioniPreliminariPASection.selectRaccomandataAR(); + cliccareSuContinua(); + + //Dati destinatario + siVisualizzaCorrettamenteLaPaginaPiattaformaNotificheSectionDestinatario(); + destinatarioPASection.selezionarePersonaFisica(); + destinatarioPASection.inserireNomeDestinatario(datiNotificaMap.get("nomePF")); + destinatarioPASection.inserireCognomeDestinatario(datiNotificaMap.get("cognomePF")); + destinatarioPASection.inserireCodiceFiscaleDestinatario(datiNotificaMap.get("codiceFiscalePF")); + destinatarioPASection.selezionaAggiungiUnIndirizzoFisico(); + destinatarioPASection.inserireIndirizzo(datiNotificaMap.get("indirizzoPF")); + destinatarioPASection.inserireNumeroCivico(datiNotificaMap.get("numeroCivicoPF")); + destinatarioPASection.inserireComune(datiNotificaMap.get("comunePF")); + destinatarioPASection.inserireProvincia(datiNotificaMap.get("provinciaPF")); + destinatarioPASection.inserireCodicePostale(datiNotificaMap.get("codicepostalePF")); + destinatarioPASection.inserireStato(datiNotificaMap.get("statoPF")); + destinatarioPASection.vaiInFondoAllaPagina(); + cliccareSuContinua(); + + + //Sezione allegati + siVisualizzaCorrettamenteLaPaginaPiattaformaNotificheSectionAllegati(); + String pathNotificaFile = notificaFile.getAbsolutePath(); + allegatiPASection.caricareNotificaPdfDalComputer(pathNotificaFile); + + if (allegatiPASection.verificaCaricamentoNotificaPdf()) { + logger.info("File notifica.pdf caricato correttamente"); + } else { + logger.error("File notifica.pdf non caricato"); + Assert.fail("File notifica.pdf non caricato"); + } + allegatiPASection.inserimentoNomeAllegato(datiNotificaMap.get("nomeDocumentoNotifica")); + nellaSectionAllegatiCliccareSulBottoneInvia(); + siVisualizzaCorrettamenteLaFraseLaNotificaEStataCorrettamenteCreata(); + cliccareSulBottoneVaiAlleNotifiche(); + } + private void aggiornamentoNumeroProtocollo() { logger.info("Aggiornamento del numero protocollo"); Map allDatataPopulation = dataPopulation.readDataPopulation("datiNotifica.yaml"); @@ -176,7 +234,6 @@ private void aggiornamentoNumeroProtocollo() { } while (numeroProtocolOld.equals(numeroProtocolNew)); allDatataPopulation.put("numeroProtocollo", numeroProtocolNew); dataPopulation.writeDataPopulation("datiNotifica.yaml", allDatataPopulation); - } @And("Cliccare su continua") @@ -1011,7 +1068,9 @@ public void siVerificaCheLaNotificaAbbiaLoStato(String stato) { logger.info("Si verifica che la notifica abbia lo stato " + stato); piattaformaNotifichePage.verificaPresenzaStato(stato); } - + + + /** * A simple object that represents the esito notifica, i.e. the return value of siVerificaEsitoNotifica. */ diff --git a/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature b/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature new file mode 100644 index 000000000..db4972fe9 --- /dev/null +++ b/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature @@ -0,0 +1,27 @@ +Feature: invio notifica con sequence + + @InvioNotificaConSequence + + Scenario: [TA-FE WORKFLOW DELLA NOTIFICA CON SEQUENCE-@FAIL-DiscoveryIrreperibile_AR] - Il mittente invia una notifica a destinatario con sequence + Given PA - Si effettua la login tramite token exchange, e viene visualizzata la dashboard + When Nella pagina Piattaforma Notifiche cliccare sul bottone Invia una nuova notifica + And Si visualizza correttamente la pagina Piattaforma Notifiche section Informazioni preliminari + And Creazione notifica completa + | oggettoDellaNotifica | Pagamento rata IMU | + | descrizione | PAGAMENTO RATA IMU | + | gruppoTest | test-TA-FE-TEST | + | gruppoDev | GruppoTest | + | codiceTassonometrico | 123456A | + | nomeFileYaml | datiNotifica | + | nomePF | Gaio Giulio | + | cognomePF | Cesare | + | codiceFiscalePF | CSRGGL44L13H501E | + | indirizzoPF | via @FAIL-DiscoveryIrreperibile_AR | + | numeroCivicoPF | 20 | + | comunePF | MILANO | + | provinciaPF | MI | + | codicepostalePF | 20147 | + | statoPF | ITALIA | + | nomeDocumentoNotifica | RATA SCADUTA IMU | + Then Si visualizza correttamente la pagina Piattaforma Notifiche section Destinatario + And Logout da portale mittente From b2152437d2fe7d16a18c712cbcecc55881caba74 Mon Sep 17 00:00:00 2001 From: leleOFA Date: Thu, 18 Apr 2024 10:03:13 +0200 Subject: [PATCH 2/6] Revert "create new logic for create test" This reverts commit d2b664353d2629479a61228182865b9aabaf27aa. --- .../mittente/NotificaMittentePagoPATest.java | 63 +------------------ .../InvioNotificaConSequence.feature | 27 -------- 2 files changed, 2 insertions(+), 88 deletions(-) delete mode 100644 src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature diff --git a/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java b/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java index 09251bab5..e95ad258f 100644 --- a/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java +++ b/src/test/java/it/pn/frontend/e2e/stepDefinitions/mittente/NotificaMittentePagoPATest.java @@ -166,64 +166,6 @@ public void nellaSectionInformazioniPreliminariInserireIDatiDellaNotificaSenzaPa informazioniPreliminariPASection.selectRaccomandataAR(); } - @And("Creazione notifica completa") - public void creazioneNotificaCompleta(Map datiNotificaMap) { - logger.info("Inserimento dei dati della notifica senza pagamento " ); - AllegatiPASection allegatiPASection = new AllegatiPASection(driver); - File notificaFile = new File("src/test/resources/notifichePdf/notifica.pdf"); - datiNotifica = dataPopulation.readDataPopulation(datiNotificaMap.get("nomeFileYaml") + ".yaml"); - - aggiornamentoNumeroProtocollo(); - - String gruppo = ""; - switch (variabileAmbiente) { - case "dev" -> gruppo = datiNotificaMap.get("gruppoDev"); - case "test", "uat" -> gruppo = datiNotificaMap.get("gruppoTest"); - } - - //Sezione preliminare - informazioniPreliminariPASection.insertOggettoNotifica(datiNotificaMap.get("oggettoDellaNotifica")); - informazioniPreliminariPASection.insertDescrizione(datiNotificaMap.get("descrizione")); - informazioniPreliminariPASection.insertNumeroDiProtocollo(datiNotifica.get("numeroProtocollo").toString()); - informazioniPreliminariPASection.insertGruppo(gruppo); - informazioniPreliminariPASection.insertCodiceTassonometrico(datiNotificaMap.get("codiceTassonometrico")); - informazioniPreliminariPASection.selectRaccomandataAR(); - cliccareSuContinua(); - - //Dati destinatario - siVisualizzaCorrettamenteLaPaginaPiattaformaNotificheSectionDestinatario(); - destinatarioPASection.selezionarePersonaFisica(); - destinatarioPASection.inserireNomeDestinatario(datiNotificaMap.get("nomePF")); - destinatarioPASection.inserireCognomeDestinatario(datiNotificaMap.get("cognomePF")); - destinatarioPASection.inserireCodiceFiscaleDestinatario(datiNotificaMap.get("codiceFiscalePF")); - destinatarioPASection.selezionaAggiungiUnIndirizzoFisico(); - destinatarioPASection.inserireIndirizzo(datiNotificaMap.get("indirizzoPF")); - destinatarioPASection.inserireNumeroCivico(datiNotificaMap.get("numeroCivicoPF")); - destinatarioPASection.inserireComune(datiNotificaMap.get("comunePF")); - destinatarioPASection.inserireProvincia(datiNotificaMap.get("provinciaPF")); - destinatarioPASection.inserireCodicePostale(datiNotificaMap.get("codicepostalePF")); - destinatarioPASection.inserireStato(datiNotificaMap.get("statoPF")); - destinatarioPASection.vaiInFondoAllaPagina(); - cliccareSuContinua(); - - - //Sezione allegati - siVisualizzaCorrettamenteLaPaginaPiattaformaNotificheSectionAllegati(); - String pathNotificaFile = notificaFile.getAbsolutePath(); - allegatiPASection.caricareNotificaPdfDalComputer(pathNotificaFile); - - if (allegatiPASection.verificaCaricamentoNotificaPdf()) { - logger.info("File notifica.pdf caricato correttamente"); - } else { - logger.error("File notifica.pdf non caricato"); - Assert.fail("File notifica.pdf non caricato"); - } - allegatiPASection.inserimentoNomeAllegato(datiNotificaMap.get("nomeDocumentoNotifica")); - nellaSectionAllegatiCliccareSulBottoneInvia(); - siVisualizzaCorrettamenteLaFraseLaNotificaEStataCorrettamenteCreata(); - cliccareSulBottoneVaiAlleNotifiche(); - } - private void aggiornamentoNumeroProtocollo() { logger.info("Aggiornamento del numero protocollo"); Map allDatataPopulation = dataPopulation.readDataPopulation("datiNotifica.yaml"); @@ -234,6 +176,7 @@ private void aggiornamentoNumeroProtocollo() { } while (numeroProtocolOld.equals(numeroProtocolNew)); allDatataPopulation.put("numeroProtocollo", numeroProtocolNew); dataPopulation.writeDataPopulation("datiNotifica.yaml", allDatataPopulation); + } @And("Cliccare su continua") @@ -1068,9 +1011,7 @@ public void siVerificaCheLaNotificaAbbiaLoStato(String stato) { logger.info("Si verifica che la notifica abbia lo stato " + stato); piattaformaNotifichePage.verificaPresenzaStato(stato); } - - - + /** * A simple object that represents the esito notifica, i.e. the return value of siVerificaEsitoNotifica. */ diff --git a/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature b/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature deleted file mode 100644 index db4972fe9..000000000 --- a/src/test/resources/feature/2-mittente/InvioNotificaConSequence.feature +++ /dev/null @@ -1,27 +0,0 @@ -Feature: invio notifica con sequence - - @InvioNotificaConSequence - - Scenario: [TA-FE WORKFLOW DELLA NOTIFICA CON SEQUENCE-@FAIL-DiscoveryIrreperibile_AR] - Il mittente invia una notifica a destinatario con sequence - Given PA - Si effettua la login tramite token exchange, e viene visualizzata la dashboard - When Nella pagina Piattaforma Notifiche cliccare sul bottone Invia una nuova notifica - And Si visualizza correttamente la pagina Piattaforma Notifiche section Informazioni preliminari - And Creazione notifica completa - | oggettoDellaNotifica | Pagamento rata IMU | - | descrizione | PAGAMENTO RATA IMU | - | gruppoTest | test-TA-FE-TEST | - | gruppoDev | GruppoTest | - | codiceTassonometrico | 123456A | - | nomeFileYaml | datiNotifica | - | nomePF | Gaio Giulio | - | cognomePF | Cesare | - | codiceFiscalePF | CSRGGL44L13H501E | - | indirizzoPF | via @FAIL-DiscoveryIrreperibile_AR | - | numeroCivicoPF | 20 | - | comunePF | MILANO | - | provinciaPF | MI | - | codicepostalePF | 20147 | - | statoPF | ITALIA | - | nomeDocumentoNotifica | RATA SCADUTA IMU | - Then Si visualizza correttamente la pagina Piattaforma Notifiche section Destinatario - And Logout da portale mittente From ab6f90a6f12795cd0074f506a71a7d235369cada Mon Sep 17 00:00:00 2001 From: leleOFA Date: Tue, 28 May 2024 17:29:55 +0200 Subject: [PATCH 3/6] initial commit and create a test for login, create factory for properties --- README.md | 1 - .../it/pn/frontend/e2e/common/BasePage.java | 2 - .../personaFisica/DeleghePage.java | 11 ++--- .../PiattaformaNotifichePGPAPage.java | 10 ++--- .../e2e/utility/FactoryProperties.java | 19 +++++++++ .../pn/frontend/e2e/run/RunCucumberTest.java | 2 +- .../LoginPersonaFisicaPagoPA.java | 42 +++++++++++++++---- .../personaFisica/notificaAnnullata.feature | 17 ++++---- .../properties/test-config-dev.properties | 10 +++++ .../properties/test-config-test.properties | 11 +++++ .../{ => properties}/test-config.properties | 1 - 11 files changed, 95 insertions(+), 31 deletions(-) create mode 100644 src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java create mode 100644 src/test/resources/properties/test-config-dev.properties create mode 100644 src/test/resources/properties/test-config-test.properties rename src/test/resources/{ => properties}/test-config.properties (78%) diff --git a/README.md b/README.md index 41095bd5d..7446d047f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,6 @@ Lista: - `logFileName`: nome del file di log. Esempio: `-DlogFileName=nomeFile` - `cookie.config`: se `true` inietta i cookie ad ogni scenario senza la comparsa del banner OneTrust. Valori possibili: `true`, `false` -- `loadComponentWaitTime`: valore numerico che stabilisce i secondi di attesa per il caricamento di un componente web ## Altro diff --git a/src/main/java/it/pn/frontend/e2e/common/BasePage.java b/src/main/java/it/pn/frontend/e2e/common/BasePage.java index 35726a84f..3b824eefb 100644 --- a/src/main/java/it/pn/frontend/e2e/common/BasePage.java +++ b/src/main/java/it/pn/frontend/e2e/common/BasePage.java @@ -14,8 +14,6 @@ public class BasePage { protected WebDriver driver; - protected int loadComponentWaitTime = Integer.parseInt(System.getProperty("loadComponentWaitTime")); - private static final Logger loggerBase = LoggerFactory.getLogger("BasePage"); public BasePage(WebDriver driver) { diff --git a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/DeleghePage.java b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/DeleghePage.java index 2111add5b..383713a5c 100644 --- a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/DeleghePage.java +++ b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/DeleghePage.java @@ -136,7 +136,7 @@ public void clickOpzioneRevoca() { public void clickMenuPerRifiuto(String nome, String cognome) { try { By menuDelegheBy = By.xpath("//table[@id='notifications-table']//td[div/p[contains(text(),'" + nome + " " + cognome + "')]]/following-sibling::td//button[@data-testid='delegationMenuIcon']"); - getWebDriverWait(this.loadComponentWaitTime).until(ExpectedConditions.visibilityOfElementLocated(menuDelegheBy)); + getWebDriverWait(10).until(ExpectedConditions.visibilityOfElementLocated(menuDelegheBy)); logger.info("Si clicca correttamente il menu della delega"); this.element(menuDelegheBy).click(); } catch (TimeoutException e) { @@ -233,16 +233,17 @@ public void checkModaleMostraCodice() { getWebDriverWait(10).withMessage("Non si trova il titolo").until(ExpectedConditions.visibilityOfElementLocated(titoloModale)); getWebDriverWait(10).withMessage("Non si trova il sottotitolo").until(ExpectedConditions.visibilityOfElementLocated(sottotitoloModale)); - while(i>=0){ - getWebDriverWait(10).withMessage("Non si trova codice verifica").until(ExpectedConditions.visibilityOfElementLocated(By.id("code-input-"+i))); + while (i >= 0) { + getWebDriverWait(10).withMessage("Non si trova codice verifica").until(ExpectedConditions.visibilityOfElementLocated(By.id("code-input-" + i))); i--; } - }catch (TimeoutException e ){ + } catch (TimeoutException e) { logger.error("modale mostra codice non caricata con errore: " + e.getMessage()); Assert.fail("modale mostra codice non caricata con errore: " + e.getMessage()); } } - public void clickAnnullaRevoca(){ + + public void clickAnnullaRevoca() { getWebDriverWait(10).withMessage("bottone annulla delega non trovato").until(ExpectedConditions.visibilityOf(annullaButton)); logger.info("click sul pulsante annulla revoca"); diff --git a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaGiuridica/PiattaformaNotifichePGPAPage.java b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaGiuridica/PiattaformaNotifichePGPAPage.java index aa348c346..3452136a4 100644 --- a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaGiuridica/PiattaformaNotifichePGPAPage.java +++ b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaGiuridica/PiattaformaNotifichePGPAPage.java @@ -66,10 +66,10 @@ public void waitLoadPiattaformaNotificaPage(String ragioneSociale) { By codiceIunTextFieldBy = By.id("iunMatch"); By dataInizioFieldBy = By.id("startDate"); By dataFineFieldBy = By.id("endDate"); - this.getWebDriverWait(this.loadComponentWaitTime).withMessage("Il titolo della pagina Notifiche PG non è visibile").until(ExpectedConditions.visibilityOfElementLocated(titlePageBy)); - this.getWebDriverWait(40).withMessage("Il campo codice iun della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(codiceIunTextFieldBy)); - this.getWebDriverWait(40).withMessage("Il campo data inizio della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(dataInizioFieldBy)); - this.getWebDriverWait(40).withMessage("Il campo data fine della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(dataFineFieldBy)); + getWebDriverWait(10).withMessage("Il titolo della pagina Notifiche PG non è visibile").until(ExpectedConditions.visibilityOfElementLocated(titlePageBy)); + getWebDriverWait(10).withMessage("Il campo codice iun della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(codiceIunTextFieldBy)); + getWebDriverWait(10).withMessage("Il campo data inizio della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(dataInizioFieldBy)); + getWebDriverWait(10).withMessage("Il campo data fine della pagina Notifiche PG non è cliccabile").until(ExpectedConditions.elementToBeClickable(dataFineFieldBy)); logger.info("La pagina Piattaforma Notifiche si carica correttamente"); } catch (TimeoutException e) { logger.error("La pagina Piattaforma Notifiche non si carica correttamente con errore: " + e.getMessage()); @@ -119,7 +119,6 @@ public void clickRecapitiButton() { } - public void clickIndietroButton() { getWebDriverWait(10).withMessage("Il bottone indietro non è visibile").until(ExpectedConditions.visibilityOf(indietroButton)); this.js().executeScript("arguments[0].click()", this.indietroButton); @@ -133,6 +132,7 @@ public boolean sezionePagamentoDisplayed() { return false; } } + public boolean messaggioNotificaAnnullataDisplayed() { try { return getWebDriverWait(5).withMessage("Il messaggio notifica annullata non è visibile").until(ExpectedConditions.visibilityOf(notificaAnnullata)).isDisplayed(); diff --git a/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java b/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java new file mode 100644 index 000000000..0de840e64 --- /dev/null +++ b/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java @@ -0,0 +1,19 @@ +package it.pn.frontend.e2e.utility; + +import lombok.Data; + +@Data +public class FactoryProperties { + private String codiceFiscaleCesare = System.getProperty("codice.fiscale.cesare"); + private String codiceFiscaleLucrezia = System.getProperty("codice.fiscale.lucrezia"); + private String urlLoginPF = System.getProperty("url.login.pf"); + private String urlLoginPG = System.getProperty("url.login.pg"); + private String urlLoginPA = System.getProperty("url.login.pa"); + + + private String tokenCesare = System.getProperty("token.login.pf.cesare"); + private String tokenLucrezia = System.getProperty("token.login.pf.lucrezia"); + + private String tokenConvivio = System.getProperty("token.login.pg.convivio"); + private String tokenEpistolae = System.getProperty("token.login.pg.epistolae"); +} diff --git a/src/test/java/it/pn/frontend/e2e/run/RunCucumberTest.java b/src/test/java/it/pn/frontend/e2e/run/RunCucumberTest.java index 8312575d1..1e2184e02 100644 --- a/src/test/java/it/pn/frontend/e2e/run/RunCucumberTest.java +++ b/src/test/java/it/pn/frontend/e2e/run/RunCucumberTest.java @@ -26,7 +26,7 @@ monochrome = true ) public class RunCucumberTest { - private static final String TEST_CONFIG_FILE = "test-config.properties"; + private static final String TEST_CONFIG_FILE = "properties/test-config.properties"; private static final Properties properties = new Properties(); private static final Logger logger = LoggerFactory.getLogger("RunCucumberTest"); private static String testSuite; diff --git a/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java b/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java index 72b2d5e1d..1b03659e6 100644 --- a/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java +++ b/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java @@ -21,7 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.URL; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -49,11 +48,12 @@ public void loginPageDestinatarioVieneVisualizzata(String datipersonaFisica) { Assert.fail("Non stato possibile trovare l'ambiente inserito, Inserisci in -Denvironment test o dev o uat"); } } - @Given("Login Page persona fisica test viene visualizzata") - public void loginPageDestinatarioVieneVisualizzataConUrl() { - String url = "https://cittadini.test.notifichedigitali.it/"; - this.driver.get(url); + @Given("Login Page persona fisica test viene visualizzata") + public void loginPageDestinatarioVieneVisualizzataConUrl() { + + String url = "https://cittadini.test.notifichedigitali.it/"; + this.driver.get(url); } @Given("PF - Si effettua la login tramite token exchange come {string}, e viene visualizzata la dashboard") @@ -89,6 +89,31 @@ public void loginMittenteConTokenExchange(String personaFisica) { notifichePFPage.waitLoadNotificheDEPage(); } + @Given("PF - Si effettua la login tramite token exchange come {string}, e viene visualizzata la dashboard") + public void loginMittenteConToken(String personaFisica) { + DataPopulation dataPopulation = new DataPopulation(); + String urlLoginPF = System.getProperty("url.login.pf"); + String tokenCesare = System.getProperty("token.login.pf.cesare"); + String tokenLucrezia = System.getProperty("token.login.pf.lucrezia"); + String urlLogin = ""; + if (personaFisica.equalsIgnoreCase("lucrezia")) { + urlLogin = urlLoginPF + tokenLucrezia; + } else { + urlLogin = urlLoginPF + tokenCesare; + } + + // Si effettua il login con token exchange + driver.get(urlLogin); + logger.info("Login effettuato con successo"); + WebTool.waitTime(10); + + // Si visualizza la dashboard e si verifica che gli elementi base siano presenti (header e title della pagina) + HeaderPFSection headerPFSection = new HeaderPFSection(this.driver); + headerPFSection.waitLoadHeaderDESection(); + NotifichePFPage notifichePFPage = new NotifichePFPage(this.driver); + notifichePFPage.waitLoadNotificheDEPage(); + } + @Given("PF - Si effettua la login tramite token exchange con utente {string} e viene visualizzata la dashboard") public void loginMittenteConTokenExchangeEUtente(String utente) { DataPopulation dataPopulation = new DataPopulation(); @@ -99,8 +124,8 @@ public void loginMittenteConTokenExchangeEUtente(String utente) { //ToDo add token for dev } case "test" -> { - if(utente.equalsIgnoreCase("Cristoforo Colombo")) { - token = dataPopulation.readDataPopulation(FILE_TOKEN_LOGIN).get("tokentestPFColombo").toString(); + if (utente.equalsIgnoreCase("Cristoforo Colombo")) { + token = dataPopulation.readDataPopulation(FILE_TOKEN_LOGIN).get("tokentestPFColombo").toString(); } } default -> { @@ -192,8 +217,9 @@ public void loginConDestinatario(String datipersonaFisica) { confermaDatiSpidPFPage.selezionaConfermaButton(); headerPFSection.waitUrlToken(); } + @When("Login con persona fisica") - public void loginConDestinatario(Map datiPF) { + public void loginConDestinatario(Map datiPF) { logger.info("user persona fisica : " + datiPF.get("user")); logger.info("cookies start"); CookiesSection cookiesPage; diff --git a/src/test/resources/feature/3-destinatario/personaFisica/notificaAnnullata.feature b/src/test/resources/feature/3-destinatario/personaFisica/notificaAnnullata.feature index 7b42a87da..85dcf2fcf 100644 --- a/src/test/resources/feature/3-destinatario/personaFisica/notificaAnnullata.feature +++ b/src/test/resources/feature/3-destinatario/personaFisica/notificaAnnullata.feature @@ -1,13 +1,14 @@ Feature:Controllo dati notifica annullata + @TestSuite @ControlloNotificaAnnullata Scenario:[NOTIFICA-ANNULLATA] Verifica caratteristiche notifica annullata - Given PF - Si effettua la login tramite token exchange come "delegante", e viene visualizzata la dashboard - And Nella pagina Piattaforma Notifiche di PF si visualizzano correttamente i filtri di ricerca - And Nella pagina Piattaforma Notifiche PF si filtra per codice IUN "DETN-WPNP-EPNJ-202405-D-1" - And Cliccare sul bottone Filtra persona fisica - And Nella pagina Piattaforma Notifiche persona fisica vengo restituite tutte le notifiche con il codice IUN "DETN-WPNP-EPNJ-202405-D-1" - And Cliccare sulla notifica restituita - Then Si visualizza correttamente la section Dettaglio Notifica annullata persona fisica - And Logout da portale persona fisica \ No newline at end of file + Given PF - Si effettua la login tramite token exchange come "delegante", e viene visualizzata la dashboard + And Nella pagina Piattaforma Notifiche di PF si visualizzano correttamente i filtri di ricerca + And Nella pagina Piattaforma Notifiche PF si filtra per codice IUN "DETN-WPNP-EPNJ-202405-D-1" + And Cliccare sul bottone Filtra persona fisica + And Nella pagina Piattaforma Notifiche persona fisica vengo restituite tutte le notifiche con il codice IUN "DETN-WPNP-EPNJ-202405-D-1" + And Cliccare sulla notifica restituita + Then Si visualizza correttamente la section Dettaglio Notifica annullata persona fisica + And Logout da portale persona fisica \ No newline at end of file diff --git a/src/test/resources/properties/test-config-dev.properties b/src/test/resources/properties/test-config-dev.properties new file mode 100644 index 000000000..a8229090d --- /dev/null +++ b/src/test/resources/properties/test-config-dev.properties @@ -0,0 +1,10 @@ +token.login.pf.cesare=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjBBS3RoQjlYNS1fNHRWUGxNRmZUTHdWSkt1akxuSEhkODdSUkdtX1VTR0EifQ.eyJuYW1lIjoiR2FpbyBHaXVsaW8iLCJmYW1pbHlfbmFtZSI6IkNlc2FyZSIsInVpZCI6ImEwMWI2MmQ0LWUzZjgtNDhmMy1hNGQ4LWNmNjI4YTM0Yjc0NSIsImZpc2NhbF9udW1iZXIiOiJDU1JHR0w0NEwxM0g1MDFFIiwic3BpZF9sZXZlbCI6Imh0dHBzOi8vd3d3LnNwaWQuZ292Lml0L1NwaWRMMiIsImZyb21fYWEiOmZhbHNlLCJhdWQiOiJjaXR0YWRpbmkuZGV2Lm5vdGlmaWNoZWRpZ2l0YWxpLml0IiwibGV2ZWwiOiJMMiIsImlhdCI6MTY5OTg4NjU3OCwiZXhwIjo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UxNDY0YjlkIl0sInN1YlVuaXRDb2RlIjpudWxsLCJzdWJVbml0VHlwZSI6bnVsbCwiYW9vUGFyZW50IjpudWxsLCJwYXJlbnREZXNjcmlwdGlvbiI6bnVsbCwicm9vdFBhcmVudCI6eyJpZCI6bnVsbCwiZGVzY3JpcHRpb24iOm51bGx9LCJmaXNjYWxfY29kZSI6IjAwMjE1MTUwMjM2IiwiaXBhQ29kZSI6ImNfbDc4MSJ9LCJkZXNpcmVkX2V4cCI6MTkwMDIyMjY3N30.NKZRi2mFvcWeWbrOiqZEqji3V9DQ3dUg3vk9yrZxaNEnKVU4l3nHuip_Ej9qZiyJvN5lPmvU4PhuLCRM1rIZcTIhyXO0uAJFbjBudt1j0oa7ErW-G394ab4dErUWarikhHs_xSW1hgAbOEHfwKPXTsb1-N5c0nl3wEG84YZ0fBdOtFKR__DHVrYyx5PkixaiN2Ch4pTAYnI8myAjsfO3MTEEvVb2qO-9qvpjG-4swG-hzk36NyG1J1jenUHvNvqhymb3maNoZ-aiVZocVZumCRxmWxrGSWmqFXwsD-QwE4iltfCNKqvF4ONKc-itNoAPXjLkFvJqILYiv07XajFaXA +codice.fiscale.cesare=CSRGGL44L13H501E +codice.fiscale.lucrezia=BRGLRZ80D58H501Q +url.login.pf=https://cittadini.dev.notifichedigitali.it/#token= +url.login.pg=https://imprese.dev.notifichedigitali.it/#selfCareToken= +url.login.pa=https://selfcare.dev.notifichedigitali.it/#selfCareToken= \ No newline at end of file diff --git a/src/test/resources/properties/test-config-test.properties b/src/test/resources/properties/test-config-test.properties new file mode 100644 index 000000000..3594e905b --- /dev/null +++ b/src/test/resources/properties/test-config-test.properties @@ -0,0 +1,11 @@ +token.login.pf.CSRGGL44L13H501E=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkU4aDZkaUZ2amtCdk1kYVF3SjBMWFlyVW5BeDYwWm1NQTFoUVc3UGtrSVkifQ.eyJzcGlkX2xldmVsIjoiaHR0cHM6Ly93d3cu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UGFyZW50Ijp7ImlkIjpudWxsLCJkZXNjcmlwdGlvbiI6bnVsbH0sImZpc2NhbF9jb2RlIjoiMDAyMTUxNTAyMzYiLCJpcGFDb2RlIjoiY19sNzgxIn0sImRlc2lyZWRfZXhwIjoxOTAwMjIyNTYxfQ.r4QCr_qE5JZMlWiBmpKDqA9D6iCog0xcodO7g-NzTklZh5lxlrw_FVlqxQi7WA5BdYsPIlvqytGLBCQxQfiTKvuO-ieK_L1W4QxK5R_3DqNWwB1UuNssIWV1nhta2chKZhmZpZisI6MhVTmqBx18Eyh1iEoO1nbM6lfokRNOz2a4gvYqCKkmC58hbWCYFcpIqvxDyEed5fLr84NvcaQxopydCIBIMEcthyHWrWuO7AplFMd-6FOtMm3k4PMSEj6586T0CfZ-IVAqXZw-tP_A1ubygfEhrQGaVNPufkk5eAL_oFtgKb2VaRoyf4tyv0zCogNC9vwnMQZaBuzXiZIHsg +codice.fiscale.cesare=CSRGGL44L13H501E +codice.fiscale.lucrezia=BRGLRZ80D58H501Q +url.login.pf=https://cittadini.test.notifichedigitali.it/#token= +url.login.pg=https://imprese.test.notifichedigitali.it/#selfCareToken= +url.login.pa=https://selfcare.test.notifichedigitali.it/#selfCareToken= \ No newline at end of file diff --git a/src/test/resources/test-config.properties b/src/test/resources/properties/test-config.properties similarity index 78% rename from src/test/resources/test-config.properties rename to src/test/resources/properties/test-config.properties index 215fb7194..319d7c2b6 100644 --- a/src/test/resources/test-config.properties +++ b/src/test/resources/properties/test-config.properties @@ -3,4 +3,3 @@ browser=chrome environment=test cookie.config=true headless=false -loadComponentWaitTime=120 \ No newline at end of file From f8b18ce2a00fdb6ecf431e5beb6b7cbff066b6ae Mon Sep 17 00:00:00 2001 From: leleOFA Date: Tue, 28 May 2024 17:57:08 +0200 Subject: [PATCH 4/6] insert factory in step --- .../personaFisica/LoginPersonaFisicaPagoPA.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java b/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java index 1b03659e6..686f8ebe9 100644 --- a/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java +++ b/src/test/java/it/pn/frontend/e2e/stepDefinitions/destinatario/personaFisica/LoginPersonaFisicaPagoPA.java @@ -15,6 +15,7 @@ import it.pn.frontend.e2e.section.destinatario.personaFisica.HeaderPFSection; import it.pn.frontend.e2e.utility.CookieConfig; import it.pn.frontend.e2e.utility.DataPopulation; +import it.pn.frontend.e2e.utility.FactoryProperties; import it.pn.frontend.e2e.utility.WebTool; import org.junit.Assert; import org.openqa.selenium.WebDriver; @@ -91,10 +92,10 @@ public void loginMittenteConTokenExchange(String personaFisica) { @Given("PF - Si effettua la login tramite token exchange come {string}, e viene visualizzata la dashboard") public void loginMittenteConToken(String personaFisica) { - DataPopulation dataPopulation = new DataPopulation(); - String urlLoginPF = System.getProperty("url.login.pf"); - String tokenCesare = System.getProperty("token.login.pf.cesare"); - String tokenLucrezia = System.getProperty("token.login.pf.lucrezia"); + FactoryProperties factoryProperties = new FactoryProperties(); + String urlLoginPF = factoryProperties.getUrlLoginPF(); + String tokenCesare = factoryProperties.getTokenCesare(); + String tokenLucrezia = factoryProperties.getTokenLucrezia(); String urlLogin = ""; if (personaFisica.equalsIgnoreCase("lucrezia")) { urlLogin = urlLoginPF + tokenLucrezia; From 24a5c36ce5153f0378055a43a70c497289206f96 Mon Sep 17 00:00:00 2001 From: leleOFA Date: Thu, 30 May 2024 10:06:22 +0200 Subject: [PATCH 5/6] reserve and improve time wait --- src/main/java/it/pn/frontend/e2e/common/BasePage.java | 6 ++++++ .../pages/destinatario/personaFisica/NotifichePFPage.java | 4 ++-- src/test/resources/properties/test-config.properties | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/it/pn/frontend/e2e/common/BasePage.java b/src/main/java/it/pn/frontend/e2e/common/BasePage.java index 3b824eefb..469550f45 100644 --- a/src/main/java/it/pn/frontend/e2e/common/BasePage.java +++ b/src/main/java/it/pn/frontend/e2e/common/BasePage.java @@ -11,9 +11,11 @@ import java.util.List; import java.util.concurrent.TimeUnit; + public class BasePage { protected WebDriver driver; + private static final int waitLoadComponentTime = Integer.parseInt(System.getProperty("waitLoadComponentTime")); private static final Logger loggerBase = LoggerFactory.getLogger("BasePage"); public BasePage(WebDriver driver) { @@ -58,6 +60,10 @@ protected WebDriverWait getWebDriverWait(long timeout) { return new WebDriverWait(this.driver, Duration.ofSeconds(timeout), Duration.ofMillis(500)); } + protected WebDriverWait getWebDriverWait() { + return new WebDriverWait(this.driver, Duration.ofSeconds(waitLoadComponentTime), Duration.ofMillis(500)); + } + protected WebElement element(By by) { return this.driver.findElement(by); } diff --git a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/NotifichePFPage.java b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/NotifichePFPage.java index 0e1b276ed..51ee4bc6c 100644 --- a/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/NotifichePFPage.java +++ b/src/main/java/it/pn/frontend/e2e/pages/destinatario/personaFisica/NotifichePFPage.java @@ -66,8 +66,8 @@ public NotifichePFPage(WebDriver driver) { public void waitLoadNotificheDEPage() { try { - this.getWebDriverWait(10).withMessage("Il titolo della pagina Notifiche non è visibile").until(ExpectedConditions.visibilityOf(titleLabel)); - this.getWebDriverWait(10).withMessage("La tabella delle Notifiche non è visibile").until(ExpectedConditions.visibilityOf(tableNotifiche)); + getWebDriverWait(10).withMessage("Il titolo della pagina Notifiche non è visibile").until(ExpectedConditions.visibilityOf(titleLabel)); + getWebDriverWait(10).withMessage("La tabella delle Notifiche non è visibile").until(ExpectedConditions.visibilityOf(tableNotifiche)); logger.info("Notifiche DE Page caricata"); } catch (TimeoutException e) { logger.error("Notifiche DE Page non caricata con errore : " + e.getMessage()); diff --git a/src/test/resources/properties/test-config.properties b/src/test/resources/properties/test-config.properties index 319d7c2b6..31b014247 100644 --- a/src/test/resources/properties/test-config.properties +++ b/src/test/resources/properties/test-config.properties @@ -2,4 +2,5 @@ browser=chrome environment=test cookie.config=true -headless=false +headless=true +waitLoadComponentTime=10 From b7edb0e9bad344dcdd232db106a5f932b3da0379 Mon Sep 17 00:00:00 2001 From: leleOFA Date: Fri, 31 May 2024 14:52:34 +0200 Subject: [PATCH 6/6] minor fix --- .../e2e/utility/FactoryProperties.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java b/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java index 0de840e64..18535f82f 100644 --- a/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java +++ b/src/main/java/it/pn/frontend/e2e/utility/FactoryProperties.java @@ -1,19 +1,25 @@ package it.pn.frontend.e2e.utility; -import lombok.Data; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Setter; -@Data +@Setter +@EqualsAndHashCode +@NoArgsConstructor +@AllArgsConstructor public class FactoryProperties { - private String codiceFiscaleCesare = System.getProperty("codice.fiscale.cesare"); - private String codiceFiscaleLucrezia = System.getProperty("codice.fiscale.lucrezia"); - private String urlLoginPF = System.getProperty("url.login.pf"); - private String urlLoginPG = System.getProperty("url.login.pg"); - private String urlLoginPA = System.getProperty("url.login.pa"); + private final String codiceFiscaleCesare = System.getProperty("codice.fiscale.cesare"); + private final String codiceFiscaleLucrezia = System.getProperty("codice.fiscale.lucrezia"); + private final String urlLoginPF = System.getProperty("url.login.pf"); + private final String urlLoginPG = System.getProperty("url.login.pg"); + private final String urlLoginPA = System.getProperty("url.login.pa"); - private String tokenCesare = System.getProperty("token.login.pf.cesare"); - private String tokenLucrezia = System.getProperty("token.login.pf.lucrezia"); + private final String tokenCesare = System.getProperty("token.login.pf.cesare"); + private final String tokenLucrezia = System.getProperty("token.login.pf.lucrezia"); - private String tokenConvivio = System.getProperty("token.login.pg.convivio"); - private String tokenEpistolae = System.getProperty("token.login.pg.epistolae"); + private final String tokenConvivio = System.getProperty("token.login.pg.convivio"); + private final String tokenEpistolae = System.getProperty("token.login.pg.epistolae"); }