2022-01-27 21:59:23 +00:00
|
|
|
//import 'package:flutter_gherkin/flutter_gherkin_integration_test.dart'; // notice new import name
|
|
|
|
import 'package:flutter_gherkin/flutter_gherkin.dart';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:gherkin/gherkin.dart';
|
|
|
|
|
|
|
|
// The application under test.
|
|
|
|
import 'package:cwtch/main.dart' as app;
|
|
|
|
import 'package:glob/glob.dart';
|
|
|
|
|
|
|
|
import 'hooks/env.dart';
|
2022-01-28 06:32:53 +00:00
|
|
|
import 'steps/chat.dart';
|
2022-01-27 21:59:23 +00:00
|
|
|
import 'steps/files.dart';
|
|
|
|
import 'steps/form_elements.dart';
|
|
|
|
import 'steps/overrides.dart';
|
|
|
|
import 'steps/text.dart';
|
|
|
|
import 'steps/utils.dart';
|
|
|
|
|
|
|
|
part 'gherkin_suite_test.g.dart';
|
|
|
|
const REPLACED_BY_SCRIPT = <String>['integration_test/features/**.feature'];
|
|
|
|
|
|
|
|
@GherkinTestSuite(executionOrder: ExecutionOrder.alphabetical, featurePaths: REPLACED_BY_SCRIPT)
|
|
|
|
void main() {
|
|
|
|
executeTestSuite(
|
|
|
|
FlutterTestConfiguration.DEFAULT([])
|
|
|
|
..reporters = [
|
|
|
|
StdoutReporter(MessageLevel.error)
|
|
|
|
..setWriteLineFn(print)
|
|
|
|
..setWriteFn(print),
|
|
|
|
ProgressReporter()
|
|
|
|
..setWriteLineFn(print)
|
|
|
|
..setWriteFn(print),
|
|
|
|
TestRunSummaryReporter()
|
|
|
|
..setWriteLineFn(print)
|
|
|
|
..setWriteFn(print),
|
|
|
|
JsonReporter(
|
|
|
|
writeReport: (_, __) => Future<void>.value(),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
..customStepParameterDefinitions = [
|
|
|
|
SwitchStateParameter(),
|
|
|
|
]
|
|
|
|
..stepDefinitions = [
|
2022-01-28 06:32:53 +00:00
|
|
|
// chat elements
|
|
|
|
ExpectReply(),
|
2022-01-27 21:59:23 +00:00
|
|
|
// form elements
|
|
|
|
CheckSwitchState(),
|
|
|
|
CheckSwitchStateWithText(),
|
|
|
|
DropdownChoose(),
|
|
|
|
// utils
|
|
|
|
TakeScreenshot(),
|
|
|
|
// overrides
|
|
|
|
TapWidgetWithType(),
|
|
|
|
TapFirstWidget(),
|
|
|
|
WaitUntilTypeExists(),
|
|
|
|
ExpectTextToBePresent(),
|
2022-01-28 06:32:53 +00:00
|
|
|
ExpectWidgetWithTextWithin(),
|
|
|
|
WaitUntilTextExists(),
|
|
|
|
SwipeOnType(),
|
2022-01-27 21:59:23 +00:00
|
|
|
// text
|
|
|
|
TorVersionPresent(),
|
|
|
|
TooltipTap(),
|
|
|
|
// files
|
|
|
|
FolderExists(),
|
|
|
|
FileExists(),
|
|
|
|
]
|
|
|
|
..hooks = [
|
|
|
|
ResetCwtchEnvironment(),
|
|
|
|
AttachScreenshotOnFailedStepHook(),
|
|
|
|
],
|
|
|
|
(World world) => app.main(),
|
|
|
|
);
|
|
|
|
}
|