Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions amazon-linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Commandes pour l'initialisation des services à partir d'un EC2 Amazon Linux vierge
### TODO : Remplacer les textes entre crochets ("[" et "]") par les valeurs adaptées

sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo yum install git -y
git clone [LIEN HTTPS REPO WIKIJS]
cd [NOM REPO WIKIJS]
sudo docker-compose up -d
cd ..
git clone [LIEN HTTPS REPO TAF]
cd [NOM REPO TAF]
sudo docker-compose up -d
20 changes: 18 additions & 2 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>backend</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -83,13 +83,20 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>5.5</version> <!-- Use the latest version available -->
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>

</dependencies>


<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -141,6 +148,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version> <!-- Essayez d'abord avec 3.8.1, stable pour Java 17. Passez à 3.10.1 si nécessaire pour Java 21 -->
<configuration>
<source>17</source> <!-- Changez en 21 si vous utilisez Java 21 -->
<target>17</target> <!-- Changez en 21 si vous utilisez Java 21 -->
</configuration>
</plugin>


</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;

// Non utilisé
@Configuration
public class WebConfigSelenium {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
package ca.etsmtl.taf.controller;

import ca.etsmtl.taf.dto.SeleniumCaseDto;
import ca.etsmtl.taf.entity.SeleniumCaseResponse;
import ca.etsmtl.taf.service.SeleniumService;
import ca.etsmtl.taf.selenium.payload.SeleniumTestService;
import ca.etsmtl.taf.selenium.payload.requests.SeleniumCase;
import ca.etsmtl.taf.selenium.payload.requests.SeleniumResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.stream.Collectors;

@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/api")
public class TestSeleniumController {
private final SeleniumService seleniumService;
private final SeleniumTestService seleniumTestService;

public TestSeleniumController(SeleniumService seleniumService) {
this.seleniumService = seleniumService;
public TestSeleniumController(SeleniumTestService seleniumTestService) {
this.seleniumTestService = seleniumTestService;
}

@PostMapping("/testselenium")
public ResponseEntity<List<SeleniumCaseResponse>> runTests(@RequestBody List<SeleniumCaseDto> seleniumCases) throws URISyntaxException, IOException, InterruptedException {
List<SeleniumCaseResponse> response = seleniumService.sendTestCases(seleniumCases);
return ResponseEntity.ok(response);
public ResponseEntity<List<SeleniumResponse>> runTests(@RequestBody List<SeleniumCase> seleniumCases) {
// Exécute chaque cas de test avec SeleniumTestService
List<SeleniumResponse> responses = seleniumCases.stream()
.map(seleniumTestService::executeTestCase)
.collect(Collectors.toList());

return ResponseEntity.ok(responses);
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ca.etsmtl.selenium.requests.payload.request;
package ca.etsmtl.taf.selenium.payload.requests;

import lombok.Data;

Expand All @@ -11,3 +11,4 @@ public class SeleniumAction {
String input;
String target;
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package ca.etsmtl.selenium.requests.payload.request;

package ca.etsmtl.taf.selenium.payload.requests;
import java.util.List;

import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ca.etsmtl.selenium.requests.payload.request;
package ca.etsmtl.taf.selenium.payload.requests;

import java.io.Serializable;
import java.util.List;
Expand Down
31 changes: 0 additions & 31 deletions backend/src/main/java/ca/etsmtl/taf/service/SeleniumService.java

This file was deleted.

2 changes: 2 additions & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
taf.selenium_container_url=http://localhost
taf.selenium_container_port=8090
22 changes: 20 additions & 2 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ spring:
url: jdbc:mysql://nostrasoft.com:3306/nostr321_taf-db
username: nostr321_taf
password: JKaVLX75iHwtrHc
security:
enabled: false

jpa:
defer-datasource-initialization: true
hibernate:
Expand All @@ -25,8 +28,23 @@ taf:
jwtExpirationMs: 86400000
testAPI_url: http://localhost
testAPI_port: 8082
selenium_container_url: http://selenium
#selenium_container_url: http://10.0.0.29 # URL correcte pour Selenium
#selenium_container_port: 4444 # Port utilisé par Selenium Grid
selenium_container_url: http://localhost
selenium_container_port: 8090


logging:
level:
#root: DEBUG
#org.springframework: DEBUG
#org.springframework.web: DEBUG
org.springframework.web.client.RestTemplate: DEBUG
org.springframework.web.reactive.function.client.WebClient: DEBUG

server.error.whitelabel.enabled: false



server:
port: 8083
port: 8083
Binary file not shown.
10 changes: 10 additions & 0 deletions frontend/src/app/selenium/test-selenium.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ <h5 class="modal-title">New Action</h5>
<option value="5">Clear</option>
<option value="6">Click</option>
<option value="7">IsDisplayed</option>
<option value="8">VerifyText</option> <!-- Nouvelle option -->
<option value="9">SelectDropdown</option> <!-- Nouvelle option -->
<option value="10">HoverOver</option> <!-- Nouvelle option -->
<option value="11">ToggleCheckbox</option> <!-- Nouvelle option -->
<option value="12">SelectRadio</option> <!-- Nouvelle option -->
<option value="13">File upload</option> <!-- Nouvelle option -->
<option value="14">js alert</option> <!-- Nouvelle option -->
<option value="15">input</option> <!-- Nouvelle option -->
<option value="16">redirect link</option> <!-- Nouvelle option -->

</select>
<input type="text" class="form-control" placeholder="Object" id="object" disabled/>
<input type="text" class="form-control" placeholder="Input" id="input" disabled/>
Expand Down
Loading