use of com.github.noraui.exception.TechnicalException in project NoraUi by NoraUi.
the class StepUT method testFormatMessageNullPageElement.
@Test
public void testFormatMessageNullPageElement() {
try {
final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
final PageElement pageElement = demoPage.getPageElementByKey("fake");
Messages.format("Message %s in %s.", pageElement, demoPage.getApplication());
} catch (final TechnicalException e) {
Assert.assertEquals("TechnicalException found", "Technical problem in the code Messages.formatMessage(String templateMessage, String... args) in NoraUi.", e.getMessage());
}
}
use of com.github.noraui.exception.TechnicalException in project NoraUi by NoraUi.
the class LogoGameSteps method playWithMyInputFile.
@Alors("Je joue avec mon fichier d'entrée '(.*)'")
@Then("I play with my input file '(.*)'")
public void playWithMyInputFile(String jsonLogos) throws TechnicalException {
Logos logos = new Logos();
logos.deserialize(jsonLogos);
for (int i = 0; i < logos.size(); i++) {
Logo logo = logos.get(i);
logo.setNid(i);
try {
WebElement element = getDriver().findElement(Utilities.getLocator(this.logoGamePage.brandElement, logo.getBrand(), logo.getBrand()));
if (element != null) {
updateText(this.logoGamePage.brandElement, logo.getBrand(), null, logo.getBrand(), logo.getBrand());
}
} catch (Exception e) {
new Result.Warning<>(logo.getBrand(), Messages.format("Brand « %s » does not exist.", logo.getBrand()), true, logo.getNid());
}
}
}
use of com.github.noraui.exception.TechnicalException in project NoraUi by NoraUi.
the class ExcelDataProvider method openOutputData.
/**
* @throws TechnicalException
* is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
*/
void openOutputData() throws TechnicalException {
this.dataOutExtension = validExtension(dataOutPath);
try (FileInputStream fileOut = new FileInputStream(dataOutPath + scenarioName + "." + dataOutExtension)) {
initWorkbook(fileOut, dataOutExtension);
} catch (final IOException e) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_DATA_IOEXCEPTION), e);
}
styleSuccess = workbook.createCellStyle();
final Font fontSuccess = workbook.createFont();
fontSuccess.setColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex());
styleSuccess.setFont(fontSuccess);
styleFailed = workbook.createCellStyle();
final Font fontFailed = workbook.createFont();
fontFailed.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex());
styleFailed.setFont(fontFailed);
styleWarning = workbook.createCellStyle();
final Font fontWarning = workbook.createFont();
fontWarning.setColor(HSSFColor.HSSFColorPredefined.ORANGE.getIndex());
styleWarning.setFont(fontWarning);
}
use of com.github.noraui.exception.TechnicalException in project NoraUi by NoraUi.
the class SecurityUT method testCreateSha1CheckSumFile.
@Test
public void testCreateSha1CheckSumFile() {
Security security = new Security();
try {
security.createSha1CheckSumFile(new File(System.getProperty("user.dir") + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "demoExcel.properties"));
Assert.assertTrue(true);
} catch (TechnicalException e) {
Assert.assertFalse("Erreur car il y a une erreur de type TechnicalException", true);
}
}
Aggregations