Open lravihs opened 11 months ago
@linchen2chris can you provide me the sample code because I am not able to import world.
import 'package:flutter_gherkin/flutter_gherkin.dart';
import 'package:gherkin/gherkin.dart';
/// take a screenshot
///
/// Examples:
///
/// `When the screenshot "xxx" is taken
/// xxx.png will be taken in screenshot folder
///
final takeScreenshotStep = when1<String, FlutterWidgetTesterWorld>(
RegExp(r'(?:a|an|the|) screenshot {string} is taken$'),
(screenshotName, context) async {
print("going to step: takeScreenshotStep");
await context.world.appDriver.waitForAppToSettle();
var data = await context.world.appDriver
.screenshot(screenshotName: screenshotName);
await context.world.appDriver.waitForAppToSettle();
},
configuration: StepDefinitionConfiguration()
..timeout = const Duration(seconds: 30),
);
you can call context.world.appDriver.screenshot() in your step to take screenshot