-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлены тесты YaxUnit и Vanessa (#51)
Добавлены тесты YaxUnit и Vanessa Automation, настроены шаги сборки, добавлено руководство по добавлению юнит-тестов
- Loading branch information
Showing
546 changed files
with
31,079 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
src/ConfigDumpInfo.xml | ||
src/dumplist.txt | ||
ConfigDumpInfo.xml | ||
dumplist.txt | ||
.vscode | ||
/.metadata/ | ||
/.scannerwork/ | ||
/.scannerwork/ |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Руководство по написанию тестов YAxUnit | ||
|
||
## Шаг 1: Клонирование репозитория | ||
|
||
Для начала работы вам необходимо клонировать репозиторий с GitHub. Вы можете сделать это, выполнив следующую команду в Git: | ||
|
||
```bash | ||
git clone https://github.com/firstBitSportivnaya/PSSL.git | ||
``` | ||
|
||
## Шаг 2: Загрузка конфигурации | ||
После клонирования репозитория загрузите конфигурацию в информационную базу из каталога: | ||
```bash | ||
PSSL/src/cf/ | ||
``` | ||
## Шаг 3: Добавление расширения конфигурации | ||
Далее необходимо добавить расширение конфигурации YAxUnit, используйте файлы из следующего каталога: | ||
```bash | ||
PSSL/src/cfe/YAXUnit | ||
``` | ||
После добавления расширения в режиме 1С:Предприятие должна появиться панель управления YAxUnit, которая отображается в виде подсистемы. | ||
|
||
## Шаг 4: Создание тестов | ||
### Определение тестируемой функции | ||
Допустим в вашей конфигурации есть общий модуль **__ОбщегоНазначенияВспомогательныеФункции** в котором есть функция определения четности числа: | ||
|
||
```1C | ||
Функция ЧетноеЧисло(Число) Экспорт | ||
Возврат Число % 2 = 0; | ||
КонецФункции | ||
``` | ||
В данном примере рассмотрим написание тестов для этой функции. | ||
|
||
### Составление тестового набора | ||
Для начала необходимо составить тестовый набор для проверки функции, стараясь покрыть пограничные случаи: | ||
| Число | Результат | | ||
|-------|-------------| | ||
| 2 | Четное | | ||
| 1 | Нечетное | | ||
| 0 | Четное | | ||
| -1 | Нечетное | | ||
| -2 | Четное | | ||
| 100 | Четное | | ||
| 99 | Нечетное | | ||
|
||
### Создание модуля для тестов | ||
Создайте новый модуль в расширении YAxUnit, который принято называть по названию объекта, в котором находится тестируемая функция. Для нашего случая это будет модуль **ОМ__ОбщегоНазначенияВспомогательныеФункции**. | ||
|
||
### Написание теста | ||
Теперь напишем сам тест, для этого внутри **ОМ__ОбщегоНазначенияВспомогательныеФункции** создаем процедуру **ИсполняемыеСценарии()**: | ||
```1C | ||
Процедура ИсполняемыеСценарии() Экспорт | ||
// Создание группы тестов | ||
ЮТТесты.ДобавитьТестовыйНабор("Проверка функции ЧетноеЧисло") | ||
// Добавление конкретного теста в группу | ||
.ДобавитьТест("ТестЧетноеЧисло") | ||
// Передача параметров в тест | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", 2, Истина)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", 1, Ложь)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", 0, Истина)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", -1, Ложь)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", -2, Истина)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", 100, Истина)) | ||
.СПараметрами(Новый Структура("Число, ОжидаемыйРезультат", 99, Ложь)); | ||
КонецПроцедуры | ||
``` | ||
#### Структура процедуры ИсполняемыеСценарии() | ||
Процедура обычно содержит вызовы методов для добавления тестов. Основной метод — **ДобавитьТестовыйНабор()**, который создает группу тестов. В каждую группу затем добавляются конкретные тесты с помощью метода **ДобавитьТест()**. Эти тесты могут иметь параметры, задаваемые через метод **СПараметрами()**. | ||
|
||
#### Написание самого теста | ||
Сам тест реализуется в отдельной процедуре, которая вызывается из **ИсполняемыеСценарии()** через **ДобавитьТест()**. В этой процедуре вы описываете логику тестирования. | ||
|
||
Пример процедуры теста: | ||
```1C | ||
Процедура ТестЧетноеЧисло(Параметры) Экспорт | ||
// Вызов тестируемой функции | ||
Результат = __ОбщегоНазначенияВспомогательныеФункции.ЧетноеЧисло(Параметры.Число); | ||
// Проверка результата | ||
ЮТест.ОжидаетЧто(Результат).Равно(Параметры.ОжидаемыйРезультат); | ||
КонецПроцедуры | ||
``` | ||
Теперь при запуске конфигурации в режиме 1С:Предприятие, в подсистеме YAxUnit должен отобразиться наш тест. | ||
Запускаем тест и видим результат его работы. | ||
|
||
Полную и исчерпывающую информацию по работе с расширением можно найти в документации [YAXUnit](https://bia-technologies.github.io/yaxunit/). |
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,29 @@ | ||
#language: ru | ||
|
||
@tree | ||
|
||
Функционал: проверка установки пометки удаления | ||
|
||
Контекст: | ||
Дано Я запускаю сценарий открытия TestClient или подключаю уже существующий | ||
|
||
Сценарий: Проверка установки пометки удаления для элементов справочника Тип соответствия объектов ИБ | ||
* Создание элемента | ||
И В командном интерфейсе я выбираю 'Соответствие объектов ИБ' 'Тип соответствия объектов ИБ' | ||
Тогда открылось окно 'Тип соответствия объектов ИБ' | ||
И я нажимаю на кнопку с именем 'ФормаСоздать' | ||
Тогда открылось окно 'Тип соответствия объектов ИБ (создание)' | ||
И в поле с именем 'Наименование' я ввожу текст 'ВА_Тест' | ||
И я нажимаю на кнопку с именем 'ФормаЗаписатьИЗакрыть' | ||
* Установка пометки | ||
И в таблице 'Список' я выделяю все строки | ||
И я выбираю пункт контекстного меню с именем 'СписокКонтекстноеМенюУстановитьПометкуУдаления' на элементе формы с именем "Список" | ||
Тогда открылось окно '1С:Предприятие' | ||
И я нажимаю на кнопку с именем 'Button0' | ||
* Снятие пометки | ||
Когда открылось окно 'Тип соответствия объектов ИБ' | ||
И в таблице 'Список' я выделяю все строки | ||
И я выбираю пункт контекстного меню с именем 'СписокКонтекстноеМенюУстановитьПометкуУдаления' на элементе формы с именем "Список" | ||
Тогда открылось окно '1С:Предприятие' | ||
И я нажимаю на кнопку с именем 'Button0' | ||
|
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,30 @@ | ||
#language: ru | ||
|
||
@tree | ||
|
||
Функционал: ввод данных | ||
|
||
Контекст: | ||
Дано Я запускаю сценарий открытия TestClient или подключаю уже существующий | ||
|
||
Сценарий: Создание элемента справочника Тип соответствия объектов ИБ | ||
* Создание элемента | ||
И В командном интерфейсе я выбираю 'Соответствие объектов ИБ' 'Тип соответствия объектов ИБ' | ||
Тогда открылось окно 'Тип соответствия объектов ИБ' | ||
И я нажимаю на кнопку с именем 'ФормаСоздать' | ||
Тогда открылось окно 'Тип соответствия объектов ИБ (создание)' | ||
И в поле с именем 'Наименование' я ввожу текст 'ВА - Тест' | ||
И в поле с именем 'ИдентификаторНастройки' я ввожу текст 'ВА - Тест' | ||
И я нажимаю на кнопку с именем 'ФормаЗаписатьИЗакрыть' | ||
И я жду закрытия окна 'Тип соответствия объектов ИБ (создание) *' в течение 20 секунд | ||
* Проверка создания | ||
Когда открылось окно 'Тип соответствия объектов ИБ' | ||
И я нажимаю на кнопку с именем 'ФормаНайти' | ||
Тогда открылось окно 'Найти' | ||
И я меняю значение переключателя с именем 'CompareType' на 'По точному совпадению' | ||
И я нажимаю на кнопку с именем 'Find' | ||
Тогда открылось окно 'Тип соответствия объектов ИБ' | ||
И в таблице "Список" я выбираю текущую строку | ||
Тогда открылось окно 'ВА - Тест (Тип соответствия объектов ИБ)' | ||
И Я закрываю окно 'ВА - Тест (Тип соответствия объектов ИБ)' | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.16"> | ||
<CommonModule uuid="b5c40903-c446-420c-824e-07c58f5b7021"> | ||
<Properties> | ||
<Name>Мокито</Name> | ||
<Synonym> | ||
<v8:item> | ||
<v8:lang>ru</v8:lang> | ||
<v8:content>Мокито</v8:content> | ||
</v8:item> | ||
</Synonym> | ||
<Comment/> | ||
<Global>false</Global> | ||
<ClientManagedApplication>true</ClientManagedApplication> | ||
<Server>true</Server> | ||
<ExternalConnection>false</ExternalConnection> | ||
<ClientOrdinaryApplication>true</ClientOrdinaryApplication> | ||
<ServerCall>false</ServerCall> | ||
<Privileged>false</Privileged> | ||
<ReturnValuesReuse>DontUse</ReturnValuesReuse> | ||
</Properties> | ||
</CommonModule> | ||
</MetaDataObject> |
Oops, something went wrong.