How to use initIsCustomTestDir method of com.qaprosoft.carina.core.foundation.report.ReportContext class

Best Carina code snippet using com.qaprosoft.carina.core.foundation.report.ReportContext.initIsCustomTestDir

Source:ReportContext.java Github

copy

Full Screen

...414 }415 }416 private static File renameTestDir(String test) {417 File testDir = testDirectory.get();418 initIsCustomTestDir();419 if (testDir != null && !isCustomTestDirName.get()) {420 File newTestDir = new File(String.format("%s/%s", getBaseDir(), test.replaceAll("[^a-zA-Z0-9.-]", "_")));421 if (!newTestDir.exists()) {422 boolean isRenamed = false;423 int retry = 5;424 while (!isRenamed && retry > 0) {425 // close ThreadLogAppender resources before renaming426 stopThreadLogAppender();427 isRenamed = testDir.renameTo(newTestDir);428 if (!isRenamed) {429 CommonUtils.pause(1);430 System.err.println("renaming failed to '" + newTestDir + "'");431 }432 retry--;433 }434 435 if (isRenamed) {436 testDirectory.set(newTestDir);437 System.out.println("Test directory renamed to '" + newTestDir + "'");438 }439 }440 } else {441 LOGGER.error("Unexpected case with absence of test.log for '" + test + "'");442 }443 return testDir;444 }445 private static void initIsCustomTestDir() {446 if (isCustomTestDirName.get() == null) {447 isCustomTestDirName.set(Boolean.FALSE);448 }449 ;450 }451 /**452 * Removes emailable html report and oldest screenshots directories according to history size defined in config.453 */454 private static void removeOldReports() {455 File baseDir = new File(String.format("%s/%s", System.getProperty("user.dir"),456 Configuration.get(Parameter.PROJECT_REPORT_DIRECTORY)));457 if (baseDir.exists()) {458 // remove old emailable report459 File reportFile = new File(String.format("%s/%s/%s", System.getProperty("user.dir"),...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful