-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2b2f4e
commit b43c0cc
Showing
11 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
# ZucchiniLauncher | ||
# ZucchiniLauncher | ||
|
||
Система запуска автоматизированных тестов "Zucchini Launcher" — это инструмент для создания, запуска, мониторинга | ||
выполнения и предоставление результатов автоматизированного тестирования. | ||
Система должна обладать следующей функциональностью: | ||
|
||
1. Авторизация: пользователь должен авторизовываться в системе, иметь одну из ролей, иметь доступ к функциональности, | ||
согласно роли, доступ к странице настроек. | ||
2. Создание тестовых сценариев: пользователь должен иметь возможность создавать тестовые сценарии в текстовом редакторе | ||
и сохранять их на сервере. | ||
3. Просмотр и редактирование тестовых сценариев: пользователь должен иметь возможность просматривать существующее | ||
сценарии и редактировать их текст. | ||
4. Запуск тестовых сценариев: пользователь должен иметь возможность гибкого запуска тестовых сценариев из каталога. | ||
5. Мониторинг текущих запусков: пользователь должен иметь возможность видеть текущее состояние запусков в системе – | ||
какие сценарии запущены, какие в очереди, какие завершены. В зависимости от роли пользователь может управлять | ||
состоянием сценария (останавливать, повышать приоритет и т.д.). | ||
6. Просмотр результатов: пользователь должен иметь возможность просматривать результаты каждого завершенного запуска и | ||
тестового сценария. | ||
Системе будет иметь серверную и клиентскую часть. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/ru/sakkuratov/autotests/configuration/MvcConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package ru.sakkuratov.autotests.configuration; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class MvcConfig implements WebMvcConfigurer { | ||
|
||
public void addViewControllers(ViewControllerRegistry registry) { | ||
registry.addViewController("/home").setViewName("home"); | ||
registry.addViewController("/").setViewName("home"); | ||
registry.addViewController("/hello").setViewName("hello"); | ||
registry.addViewController("/login").setViewName("login"); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/ru/sakkuratov/autotests/configuration/WebSecurityConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ru.sakkuratov.autotests.configuration; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
import org.springframework.security.config.annotation.web.configurers.LogoutConfigurer; | ||
import org.springframework.security.core.userdetails.User; | ||
import org.springframework.security.core.userdetails.UserDetails; | ||
import org.springframework.security.core.userdetails.UserDetailsService; | ||
import org.springframework.security.provisioning.InMemoryUserDetailsManager; | ||
import org.springframework.security.web.SecurityFilterChain; | ||
|
||
@Configuration | ||
@EnableWebSecurity | ||
public class WebSecurityConfig { | ||
|
||
@Bean | ||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { | ||
http.authorizeHttpRequests((requests) -> requests.requestMatchers("/", "/home").permitAll().anyRequest().authenticated()) | ||
.formLogin((form) -> form.loginPage("/login").permitAll()).logout(LogoutConfigurer::permitAll); | ||
|
||
return http.build(); | ||
} | ||
|
||
@Bean | ||
public UserDetailsService userDetailsService() { | ||
UserDetails user = User.withUsername("admin") | ||
.password("{bcrypt}$2a$10$S57Wxq3Abj6WaXq5BzY5heCrYAgaHy5ZEqIO5zGWsb8LSXR8j.za.") | ||
.roles("ADMIN") | ||
.build(); | ||
|
||
return new InMemoryUserDetailsManager(user); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/> | ||
<title>Zucchini Launcher</title> | ||
</head> | ||
<body> | ||
<div class="main"> | ||
<h3>Hello!</h3> | ||
</div> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.main { | ||
overflow: auto; | ||
margin: 0 auto; | ||
padding: 2rem 2rem; | ||
border: 3px solid #333333; | ||
border-radius: 2% 6% 5% 4% / 1% 1% 2% 4%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity6" | ||
xmlns:th="https://www.thymeleaf.org"> | ||
<head> | ||
<title>Hello World!</title> | ||
</head> | ||
<body> | ||
<h1 th:inline="text">Hello <span sec:authentication="name" th:remove="tag">thymeleaf</span>!</h1> | ||
<form method="post" th:action="@{/logout}"> | ||
<input type="submit" value="Sign Out"/> | ||
</form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"> | ||
<head> | ||
<title>Spring Security Example</title> | ||
</head> | ||
<body> | ||
<h1>Welcome!</h1> | ||
|
||
<p>Click <a th:href="@{/hello}">here</a> to see a greeting.</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"> | ||
<head> | ||
<title>Spring Security Example </title> | ||
</head> | ||
<body> | ||
<div th:if="${param.error}"> | ||
Invalid username and password. | ||
</div> | ||
<div th:if="${param.logout}"> | ||
You have been logged out. | ||
</div> | ||
<form method="post" th:action="@{/login}"> | ||
<div><label> User Name : <input name="username" type="text"/> </label></div> | ||
<div><label> Password: <input name="password" type="password"/> </label></div> | ||
<div><input type="submit" value="Sign In"/></div> | ||
</form> | ||
</body> | ||
</html> |