Я создаю файл объектов, в который можно вызывать другие шаги из другого сценария. Пожалуйста, найдите ниже и предложите, если что-то отсутствует.
Файл функции:
Особенность: тест нескольких шагов
Scenario: Print All console
Given Print the start console
Given Print All console
do
step "Print the console for numbers"
step "Print first numbers console"
step "Print second numbers console"
end
Scenario: Print All console
Given Print the console for numbers
Then Print first numbers console
Then Print second numbers console
Определения шагов:
import { Then, Given } from 'cucumber';
Given(/^Print the start console$/, async () => {
console.log('------Printing console-----');
});
Then(/^Print All console$/, async () => {
console.log('------Printing all console-----');
});
Given(/^Print the console for numbers$/, async () => {
console.log('------Printing console for numbers-----');
});
Then(/^Print first numbers console$/, async () => {
console.log('------Printing first number console-----');
});
Then(/^Print second numbers console$/, async () => {
console.log('------Printing second number console-----');
});
Во время выполнения я получаю сообщение об ошибке, как показано ниже. Пожалуйста, помогите.
[12:21:35] E / launcher - Ошибка: Ошибка: Ошибка разбора в 'src \ features \ multipleSteps.feature': (6: 5): ожидается: #EOF, #TableRow, #DocStringSeparator, #StepLine , #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'do'