Skip to content

Commit

Permalink
Merge pull request #93 from healenium/feature/EPMHLM-428
Browse files Browse the repository at this point in the history
Feature/epmhlm 428
  • Loading branch information
Alex-Reif authored Oct 17, 2024
2 parents f47f288 + 064309e commit 8a6f7d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
- healenium

healenium:
image: healenium/hlm-backend:3.4.4
image: healenium/hlm-backend:3.4.6
container_name: healenium
restart: on-failure
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
@RequiredArgsConstructor
public class ReportServiceImpl implements ReportService {

private static final String SESSION_ID_REGEX = "^[a-fA-F0-9]+$";

private final ReportRepository reportRepository;
private final HealingResultRepository resultRepository;

Expand Down Expand Up @@ -145,7 +143,7 @@ private String transformPath(String sourcePath) {
*/
@Override
public void createReportRecord(HealingResult result, Healing healing, String sessionId, byte[] screenshot) {
if (!StringUtils.isEmpty(sessionId) && sessionId.matches(SESSION_ID_REGEX)) {
if (!StringUtils.isEmpty(sessionId)) {
String screenshotDir = "/screenshots/" + sessionId;
String screenshotPath = persistScreenshot(screenshot, screenshotDir);
log.debug("[Save Healing] Screenshot Path: {}", screenshotPath);
Expand Down
9 changes: 8 additions & 1 deletion src/test/java/com/epam/healenium/TestSaveLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class TestSaveLocators extends TestContainersInitializer {
@Autowired
private ObjectMapper objectMapper;
private SelectorRequestDto selectorRequest;
private RequestDto requestDto;

@BeforeEach
public void setUp() {
Expand All @@ -58,6 +59,12 @@ public void setUp() {
selectorRequest.setMethodName("testMethod()");
selectorRequest.setUrl("https://test-url");
selectorRequest.setNodePath(getLastValidPath());

requestDto = new RequestDto();
requestDto.setLocator(selectorRequest.getLocator());
requestDto.setClassName(selectorRequest.getClassName());
requestDto.setMethodName(selectorRequest.getMethodName());
requestDto.setUrl(selectorRequest.getUrl());
}

@AfterEach
Expand Down Expand Up @@ -105,7 +112,7 @@ public void testSaveLocatorHealing() throws IOException {

@Test
public void testHealingResultFromEmptyDb() {
Set<HealingResultDto> resultDtos = healingService.getHealingResults(selectorRequest);
Set<HealingResultDto> resultDtos = healingService.getHealingResults(requestDto);
Assertions.assertNotEquals(1, resultDtos.size(), "Incorrect amount of healing results were found");
}

Expand Down

0 comments on commit 8a6f7d3

Please sign in to comment.